From 027ea9a22e3939e92cd38c9231d73c627e3e651b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 19 Jul 2026 19:30:00 +0000 Subject: [PATCH] feat: regenerate API client from OpenAPI spec --- src/convoy/__init__.py | 8 + src/convoy/api/__init__.py | 1 + src/convoy/api/delivery_attempts/__init__.py | 1 + .../delivery_attempts/get_delivery_attempt.py | 242 +++++ .../get_delivery_attempts.py | 228 +++++ src/convoy/api/endpoints/__init__.py | 1 + src/convoy/api/endpoints/activate_endpoint.py | 228 +++++ src/convoy/api/endpoints/create_endpoint.py | 235 +++++ src/convoy/api/endpoints/delete_endpoint.py | 228 +++++ src/convoy/api/endpoints/expire_secret.py | 249 +++++ src/convoy/api/endpoints/get_endpoint.py | 228 +++++ src/convoy/api/endpoints/get_endpoints.py | 330 ++++++ src/convoy/api/endpoints/pause_endpoint.py | 228 +++++ .../api/endpoints/test_o_auth_2_connection.py | 243 +++++ src/convoy/api/endpoints/update_endpoint.py | 249 +++++ src/convoy/api/event_deliveries/__init__.py | 1 + .../batch_retry_event_delivery.py | 438 ++++++++ .../force_resend_event_deliveries.py | 243 +++++ .../get_event_deliveries_paged.py | 438 ++++++++ .../event_deliveries/get_event_delivery.py | 228 +++++ .../event_deliveries/resend_event_delivery.py | 228 +++++ src/convoy/api/event_types/__init__.py | 1 + .../api/event_types/create_event_type.py | 235 +++++ .../api/event_types/deprecate_event_type.py | 228 +++++ src/convoy/api/event_types/get_event_types.py | 214 ++++ .../api/event_types/import_open_api_spec.py | 235 +++++ .../api/event_types/update_event_type.py | 249 +++++ src/convoy/api/events/__init__.py | 1 + src/convoy/api/events/batch_replay_events.py | 398 ++++++++ .../api/events/count_affected_events.py | 398 ++++++++ .../api/events/create_broadcast_event.py | 247 +++++ src/convoy/api/events/create_dynamic_event.py | 239 +++++ .../api/events/create_endpoint_event.py | 235 +++++ .../events/create_endpoint_fanout_event.py | 243 +++++ src/convoy/api/events/get_endpoint_event.py | 228 +++++ src/convoy/api/events/get_events_paged.py | 398 ++++++++ .../api/events/replay_endpoint_event.py | 228 +++++ src/convoy/api/filters/__init__.py | 1 + src/convoy/api/filters/bulk_create_filters.py | 252 +++++ src/convoy/api/filters/bulk_update_filters.py | 252 +++++ src/convoy/api/filters/create_filter.py | 249 +++++ src/convoy/api/filters/delete_filter.py | 242 +++++ src/convoy/api/filters/get_filter.py | 242 +++++ src/convoy/api/filters/get_filters.py | 228 +++++ src/convoy/api/filters/test_filter.py | 263 +++++ src/convoy/api/filters/update_filter.py | 263 +++++ src/convoy/api/meta_events/__init__.py | 1 + src/convoy/api/meta_events/get_meta_event.py | 228 +++++ .../api/meta_events/get_meta_events_paged.py | 330 ++++++ .../api/meta_events/resend_meta_event.py | 228 +++++ src/convoy/api/onboard/__init__.py | 1 + src/convoy/api/onboard/bulk_onboard.py | 266 +++++ src/convoy/api/portal_links/__init__.py | 1 + .../api/portal_links/create_portal_link.py | 237 +++++ .../api/portal_links/get_portal_link.py | 228 +++++ .../portal_links/load_portal_links_paged.py | 338 +++++++ .../refresh_portal_link_auth_token.py | 236 +++++ .../api/portal_links/revoke_portal_link.py | 228 +++++ .../api/portal_links/update_portal_link.py | 251 +++++ src/convoy/api/projects/__init__.py | 1 + src/convoy/api/projects/create_project.py | 271 +++++ src/convoy/api/projects/delete_project.py | 226 +++++ src/convoy/api/projects/get_project.py | 214 ++++ src/convoy/api/projects/get_projects.py | 223 ++++ src/convoy/api/projects/update_project.py | 247 +++++ src/convoy/api/sources/__init__.py | 1 + src/convoy/api/sources/create_source.py | 235 +++++ src/convoy/api/sources/delete_source.py | 228 +++++ src/convoy/api/sources/get_source.py | 228 +++++ src/convoy/api/sources/load_sources_paged.py | 330 ++++++ src/convoy/api/sources/update_source.py | 249 +++++ src/convoy/api/subscriptions/__init__.py | 1 + .../api/subscriptions/create_subscription.py | 235 +++++ .../api/subscriptions/delete_subscription.py | 228 +++++ .../api/subscriptions/get_subscription.py | 228 +++++ .../api/subscriptions/get_subscriptions.py | 334 ++++++ ...ojects_project_id_sources_test_function.py | 251 +++++ .../subscriptions/test_subscription_filter.py | 243 +++++ .../test_subscription_function.py | 243 +++++ .../toggle_subscription_status.py | 236 +++++ .../api/subscriptions/update_subscription.py | 249 +++++ src/convoy/client.py | 282 ++++++ src/convoy/errors.py | 16 + src/convoy/models/__init__.py | 955 ++++++++++++++++++ .../models/activate_endpoint_response_202.py | 92 ++ .../models/activate_endpoint_response_400.py | 92 ++ .../models/activate_endpoint_response_401.py | 92 ++ .../models/activate_endpoint_response_404.py | 92 ++ src/convoy/models/auth_role_type.py | 13 + .../models/batch_replay_events_direction.py | 9 + .../batch_replay_events_response_200.py | 79 ++ .../batch_replay_events_response_400.py | 92 ++ .../batch_replay_events_response_401.py | 92 ++ .../batch_replay_events_response_404.py | 92 ++ .../batch_retry_event_delivery_direction.py | 9 + ...batch_retry_event_delivery_response_200.py | 92 ++ ...batch_retry_event_delivery_response_400.py | 92 ++ ...batch_retry_event_delivery_response_401.py | 92 ++ ...batch_retry_event_delivery_response_404.py | 92 ++ .../bulk_create_filters_response_201.py | 97 ++ .../bulk_create_filters_response_400.py | 92 ++ .../bulk_create_filters_response_401.py | 92 ++ .../bulk_create_filters_response_404.py | 92 ++ .../models/bulk_onboard_response_200.py | 96 ++ .../models/bulk_onboard_response_202.py | 96 ++ .../models/bulk_onboard_response_400.py | 92 ++ .../models/bulk_onboard_response_401.py | 92 ++ .../models/bulk_onboard_response_404.py | 92 ++ .../bulk_update_filters_response_200.py | 97 ++ .../bulk_update_filters_response_400.py | 92 ++ .../bulk_update_filters_response_401.py | 92 ++ .../bulk_update_filters_response_404.py | 92 ++ .../config_request_id_header_provider.py | 8 + .../config_signature_header_provider.py | 8 + .../models/count_affected_events_direction.py | 9 + .../count_affected_events_response_200.py | 92 ++ .../count_affected_events_response_400.py | 92 ++ .../count_affected_events_response_401.py | 92 ++ .../count_affected_events_response_404.py | 92 ++ .../create_broadcast_event_response_201.py | 92 ++ .../create_broadcast_event_response_400.py | 92 ++ .../create_broadcast_event_response_401.py | 92 ++ .../create_broadcast_event_response_404.py | 92 ++ .../create_dynamic_event_response_400.py | 92 ++ .../create_dynamic_event_response_401.py | 92 ++ .../create_dynamic_event_response_404.py | 92 ++ .../create_endpoint_event_response_201.py | 92 ++ .../create_endpoint_event_response_400.py | 92 ++ .../create_endpoint_event_response_401.py | 92 ++ .../create_endpoint_event_response_404.py | 92 ++ ...eate_endpoint_fanout_event_response_201.py | 92 ++ ...eate_endpoint_fanout_event_response_400.py | 92 ++ ...eate_endpoint_fanout_event_response_401.py | 92 ++ ...eate_endpoint_fanout_event_response_404.py | 92 ++ .../models/create_endpoint_response_201.py | 92 ++ .../models/create_endpoint_response_400.py | 92 ++ .../models/create_endpoint_response_401.py | 92 ++ .../models/create_endpoint_response_404.py | 92 ++ .../models/create_event_type_response_201.py | 92 ++ .../models/create_event_type_response_400.py | 92 ++ .../models/create_event_type_response_401.py | 92 ++ .../models/create_event_type_response_404.py | 92 ++ .../models/create_filter_response_201.py | 92 ++ .../models/create_filter_response_400.py | 92 ++ .../models/create_filter_response_401.py | 92 ++ .../models/create_filter_response_404.py | 92 ++ .../models/create_portal_link_response_201.py | 92 ++ .../models/create_portal_link_response_400.py | 92 ++ .../models/create_portal_link_response_401.py | 92 ++ .../models/create_portal_link_response_404.py | 92 ++ .../models/create_project_response_201.py | 92 ++ .../models/create_project_response_400.py | 92 ++ .../models/create_project_response_401.py | 92 ++ .../models/create_project_response_402.py | 92 ++ .../models/create_project_response_403.py | 92 ++ .../models/create_project_response_404.py | 92 ++ .../models/create_source_response_201.py | 92 ++ .../models/create_source_response_400.py | 92 ++ .../models/create_source_response_401.py | 92 ++ .../models/create_source_response_404.py | 92 ++ .../create_subscription_response_201.py | 92 ++ .../create_subscription_response_400.py | 92 ++ .../create_subscription_response_401.py | 92 ++ .../create_subscription_response_404.py | 92 ++ .../models/datastore_alert_configuration.py | 70 ++ .../models/datastore_amqp_credentials.py | 70 ++ .../models/datastore_amqp_pub_sub_config.py | 146 +++ src/convoy/models/datastore_api_key.py | 70 ++ .../models/datastore_api_key_response.py | 137 +++ src/convoy/models/datastore_basic_auth.py | 70 ++ ...datastore_circuit_breaker_configuration.py | 115 +++ src/convoy/models/datastore_cli_metadata.py | 70 ++ .../datastore_create_portal_link_request.py | 100 ++ .../models/datastore_custom_response.py | 70 ++ .../models/datastore_delivery_attempt.py | 243 +++++ src/convoy/models/datastore_delivery_mode.py | 9 + src/convoy/models/datastore_device.py | 141 +++ src/convoy/models/datastore_device_status.py | 10 + src/convoy/models/datastore_encoding_type.py | 9 + src/convoy/models/datastore_endpoint.py | 349 +++++++ .../datastore_endpoint_authentication.py | 129 +++ .../datastore_endpoint_authentication_type.py | 10 + .../models/datastore_endpoint_status.py | 10 + src/convoy/models/datastore_event.py | 292 ++++++ .../models/datastore_event_delivery_status.py | 13 + src/convoy/models/datastore_event_status.py | 12 + .../models/datastore_filter_configuration.py | 85 ++ src/convoy/models/datastore_filter_schema.py | 131 +++ .../models/datastore_google_pub_sub_config.py | 81 ++ src/convoy/models/datastore_h_mac.py | 96 ++ src/convoy/models/datastore_http_header.py | 47 + src/convoy/models/datastore_kafka_auth.py | 97 ++ .../models/datastore_kafka_pub_sub_config.py | 103 ++ src/convoy/models/datastore_m.py | 47 + .../models/datastore_meta_event_attempt.py | 99 ++ .../datastore_meta_event_configuration.py | 129 +++ .../models/datastore_meta_event_type.py | 9 + src/convoy/models/datastore_metadata.py | 135 +++ .../models/datastore_mtls_client_cert.py | 70 ++ src/convoy/models/datastore_o_auth_2.py | 213 ++++ .../datastore_o_auth_2_authentication_type.py | 9 + .../datastore_o_auth_2_expiry_time_unit.py | 11 + .../datastore_o_auth_2_field_mapping.py | 79 ++ .../models/datastore_o_auth_2_signing_key.py | 169 ++++ src/convoy/models/datastore_page_direction.py | 9 + .../models/datastore_pagination_data.py | 106 ++ .../models/datastore_portal_auth_type.py | 9 + .../models/datastore_portal_link_response.py | 217 ++++ src/convoy/models/datastore_project_config.py | 263 +++++ .../models/datastore_project_statistics.py | 88 ++ src/convoy/models/datastore_project_type.py | 9 + .../models/datastore_provider_config.py | 78 ++ src/convoy/models/datastore_pub_sub_config.py | 154 +++ src/convoy/models/datastore_pub_sub_type.py | 11 + .../datastore_rate_limit_configuration.py | 70 ++ .../models/datastore_retry_configuration.py | 87 ++ src/convoy/models/datastore_role.py | 87 ++ src/convoy/models/datastore_secret.py | 106 ++ .../datastore_signature_configuration.py | 96 ++ .../models/datastore_signature_version.py | 96 ++ src/convoy/models/datastore_source.py | 292 ++++++ .../models/datastore_source_provider.py | 10 + src/convoy/models/datastore_source_type.py | 11 + .../models/datastore_sqs_pub_sub_config.py | 97 ++ .../models/datastore_ssl_configuration.py | 61 ++ .../datastore_strategy_configuration.py | 87 ++ .../models/datastore_strategy_provider.py | 9 + .../models/datastore_subscription_type.py | 9 + .../datastore_twitter_provider_config.py | 61 ++ .../datastore_update_portal_link_request.py | 100 ++ .../models/datastore_verifier_config.py | 127 +++ src/convoy/models/datastore_verifier_type.py | 11 + .../models/delete_endpoint_response_200.py | 92 ++ .../models/delete_endpoint_response_400.py | 92 ++ .../models/delete_endpoint_response_401.py | 92 ++ .../models/delete_endpoint_response_404.py | 92 ++ .../models/delete_filter_response_200.py | 92 ++ .../models/delete_filter_response_400.py | 92 ++ .../models/delete_filter_response_401.py | 92 ++ .../models/delete_filter_response_404.py | 92 ++ .../models/delete_project_response_200.py | 92 ++ .../models/delete_project_response_400.py | 92 ++ .../models/delete_project_response_401.py | 92 ++ .../models/delete_project_response_403.py | 92 ++ .../models/delete_project_response_404.py | 92 ++ .../models/delete_source_response_200.py | 92 ++ .../models/delete_source_response_400.py | 92 ++ .../models/delete_source_response_401.py | 92 ++ .../models/delete_source_response_404.py | 92 ++ .../delete_subscription_response_200.py | 92 ++ .../delete_subscription_response_400.py | 92 ++ .../delete_subscription_response_401.py | 92 ++ .../delete_subscription_response_404.py | 92 ++ .../deprecate_event_type_response_201.py | 92 ++ .../deprecate_event_type_response_400.py | 92 ++ .../deprecate_event_type_response_401.py | 92 ++ .../deprecate_event_type_response_404.py | 92 ++ .../models/expire_secret_response_200.py | 92 ++ .../models/expire_secret_response_400.py | 92 ++ .../models/expire_secret_response_401.py | 92 ++ .../models/expire_secret_response_404.py | 92 ++ ...ce_resend_event_deliveries_response_200.py | 92 ++ ...ce_resend_event_deliveries_response_400.py | 92 ++ ...ce_resend_event_deliveries_response_401.py | 92 ++ ...ce_resend_event_deliveries_response_404.py | 92 ++ .../get_delivery_attempt_response_200.py | 92 ++ .../get_delivery_attempt_response_400.py | 92 ++ .../get_delivery_attempt_response_401.py | 92 ++ .../get_delivery_attempt_response_404.py | 92 ++ .../get_delivery_attempts_response_200.py | 97 ++ .../get_delivery_attempts_response_400.py | 92 ++ .../get_delivery_attempts_response_401.py | 92 ++ .../get_delivery_attempts_response_404.py | 92 ++ .../models/get_endpoint_event_response_200.py | 92 ++ .../models/get_endpoint_event_response_400.py | 92 ++ .../models/get_endpoint_event_response_401.py | 92 ++ .../models/get_endpoint_event_response_404.py | 92 ++ .../models/get_endpoint_response_200.py | 92 ++ .../models/get_endpoint_response_400.py | 92 ++ .../models/get_endpoint_response_401.py | 92 ++ .../models/get_endpoint_response_404.py | 92 ++ src/convoy/models/get_endpoints_direction.py | 9 + .../models/get_endpoints_response_200.py | 92 ++ .../models/get_endpoints_response_200_data.py | 113 +++ .../models/get_endpoints_response_400.py | 92 ++ .../models/get_endpoints_response_401.py | 92 ++ .../models/get_endpoints_response_404.py | 92 ++ .../get_event_deliveries_paged_direction.py | 9 + ...get_event_deliveries_paged_response_200.py | 96 ++ ...vent_deliveries_paged_response_200_data.py | 113 +++ ...get_event_deliveries_paged_response_400.py | 92 ++ ...get_event_deliveries_paged_response_401.py | 92 ++ ...get_event_deliveries_paged_response_404.py | 92 ++ .../models/get_event_delivery_response_200.py | 92 ++ .../models/get_event_delivery_response_400.py | 92 ++ .../models/get_event_delivery_response_401.py | 92 ++ .../models/get_event_delivery_response_404.py | 92 ++ .../models/get_event_types_response_200.py | 97 ++ .../models/get_event_types_response_400.py | 92 ++ .../models/get_event_types_response_401.py | 92 ++ .../models/get_event_types_response_404.py | 92 ++ .../models/get_events_paged_direction.py | 9 + .../models/get_events_paged_response_200.py | 96 ++ .../get_events_paged_response_200_data.py | 113 +++ .../models/get_events_paged_response_400.py | 92 ++ .../models/get_events_paged_response_401.py | 92 ++ .../models/get_events_paged_response_404.py | 92 ++ src/convoy/models/get_filter_response_200.py | 92 ++ src/convoy/models/get_filter_response_400.py | 92 ++ src/convoy/models/get_filter_response_401.py | 92 ++ src/convoy/models/get_filter_response_404.py | 92 ++ src/convoy/models/get_filters_response_200.py | 97 ++ src/convoy/models/get_filters_response_400.py | 92 ++ src/convoy/models/get_filters_response_401.py | 92 ++ src/convoy/models/get_filters_response_404.py | 92 ++ .../models/get_meta_event_response_200.py | 92 ++ .../models/get_meta_event_response_400.py | 92 ++ .../models/get_meta_event_response_401.py | 92 ++ .../models/get_meta_event_response_404.py | 92 ++ .../models/get_meta_events_paged_direction.py | 9 + .../get_meta_events_paged_response_200.py | 96 ++ ...get_meta_events_paged_response_200_data.py | 113 +++ .../get_meta_events_paged_response_400.py | 92 ++ .../get_meta_events_paged_response_401.py | 92 ++ .../get_meta_events_paged_response_404.py | 92 ++ .../models/get_portal_link_response_200.py | 92 ++ .../models/get_portal_link_response_400.py | 92 ++ .../models/get_portal_link_response_401.py | 92 ++ .../models/get_portal_link_response_404.py | 92 ++ src/convoy/models/get_project_response_200.py | 92 ++ src/convoy/models/get_project_response_400.py | 92 ++ src/convoy/models/get_project_response_401.py | 92 ++ src/convoy/models/get_project_response_404.py | 92 ++ .../models/get_projects_response_200.py | 97 ++ .../models/get_projects_response_400.py | 92 ++ .../models/get_projects_response_401.py | 92 ++ .../models/get_projects_response_404.py | 92 ++ src/convoy/models/get_source_response_200.py | 92 ++ src/convoy/models/get_source_response_400.py | 92 ++ src/convoy/models/get_source_response_401.py | 92 ++ src/convoy/models/get_source_response_404.py | 92 ++ .../models/get_subscription_response_200.py | 92 ++ .../models/get_subscription_response_400.py | 92 ++ .../models/get_subscription_response_401.py | 92 ++ .../models/get_subscription_response_404.py | 92 ++ .../models/get_subscriptions_direction.py | 9 + .../models/get_subscriptions_response_200.py | 96 ++ .../get_subscriptions_response_200_data.py | 113 +++ .../models/get_subscriptions_response_400.py | 92 ++ .../models/get_subscriptions_response_401.py | 92 ++ .../models/get_subscriptions_response_404.py | 92 ++ src/convoy/models/handlers_stub.py | 47 + src/convoy/models/httpheader_http_header.py | 54 + .../import_open_api_spec_response_200.py | 97 ++ .../import_open_api_spec_response_400.py | 92 ++ .../import_open_api_spec_response_401.py | 92 ++ .../import_open_api_spec_response_404.py | 92 ++ .../load_portal_links_paged_direction.py | 9 + .../load_portal_links_paged_response_200.py | 96 ++ ...ad_portal_links_paged_response_200_data.py | 113 +++ .../load_portal_links_paged_response_400.py | 92 ++ .../load_portal_links_paged_response_401.py | 92 ++ .../load_portal_links_paged_response_404.py | 92 ++ .../models/load_sources_paged_direction.py | 9 + .../models/load_sources_paged_response_200.py | 96 ++ .../load_sources_paged_response_200_data.py | 113 +++ .../models/load_sources_paged_response_400.py | 92 ++ .../models/load_sources_paged_response_401.py | 92 ++ .../models/load_sources_paged_response_404.py | 92 ++ .../models/models_alert_configuration.py | 70 ++ src/convoy/models/models_amqp_auth.py | 70 ++ src/convoy/models/models_amqp_exchange.py | 70 ++ .../models/models_amqp_pub_subconfig.py | 146 +++ src/convoy/models/models_api_key.py | 69 ++ src/convoy/models/models_basic_auth.py | 69 ++ src/convoy/models/models_broadcast_event.py | 127 +++ .../models_broadcast_event_custom_headers.py | 47 + .../models/models_broadcast_event_data.py | 50 + .../models_bulk_onboard_accepted_response.py | 79 ++ .../models_bulk_onboard_dry_run_response.py | 99 ++ .../models/models_bulk_onboard_request.py | 79 ++ .../models_bulk_update_filter_request.py | 182 ++++ .../models_bulk_update_filter_request_body.py | 47 + ...dels_bulk_update_filter_request_headers.py | 47 + .../models_bulk_update_filter_request_path.py | 47 + ...models_bulk_update_filter_request_query.py | 47 + src/convoy/models/models_count_response.py | 61 ++ src/convoy/models/models_create_endpoint.py | 227 +++++ src/convoy/models/models_create_event.py | 134 +++ .../models_create_event_custom_headers.py | 47 + src/convoy/models/models_create_event_data.py | 50 + src/convoy/models/models_create_event_type.py | 105 ++ .../models_create_event_type_json_schema.py | 47 + .../models/models_create_filter_request.py | 151 +++ src/convoy/models/models_create_project.py | 101 ++ .../models/models_create_project_response.py | 124 +++ src/convoy/models/models_create_source.py | 195 ++++ .../models/models_create_subscription.py | 178 ++++ src/convoy/models/models_custom_response.py | 70 ++ src/convoy/models/models_dynamic_event.py | 146 +++ .../models_dynamic_event_custom_headers.py | 47 + .../models/models_dynamic_event_data.py | 50 + .../models/models_endpoint_authentication.py | 129 +++ src/convoy/models/models_endpoint_response.py | 349 +++++++ .../models/models_event_delivery_response.py | 369 +++++++ src/convoy/models/models_event_response.py | 292 ++++++ .../models/models_event_type_response.py | 108 ++ src/convoy/models/models_expire_secret.py | 72 ++ src/convoy/models/models_fanout_event.py | 125 +++ .../models_fanout_event_custom_headers.py | 47 + src/convoy/models/models_fanout_event_data.py | 50 + .../models/models_filter_configuration.py | 85 ++ src/convoy/models/models_filter_response.py | 222 ++++ src/convoy/models/models_filter_schema.py | 88 ++ src/convoy/models/models_fs.py | 122 +++ src/convoy/models/models_function_request.py | 94 ++ .../models/models_function_request_payload.py | 47 + src/convoy/models/models_function_response.py | 72 ++ .../models/models_google_pub_sub_config.py | 81 ++ src/convoy/models/models_h_mac.py | 87 ++ src/convoy/models/models_i_ds.py | 63 ++ .../models/models_import_open_api_spec.py | 61 ++ src/convoy/models/models_kafka_auth.py | 97 ++ .../models/models_kafka_pub_sub_config.py | 103 ++ .../models/models_meta_event_configuration.py | 99 ++ .../models/models_meta_event_response.py | 163 +++ src/convoy/models/models_mtls_client_cert.py | 70 ++ src/convoy/models/models_o_auth_2.py | 191 ++++ .../models/models_o_auth_2_field_mapping.py | 79 ++ .../models/models_o_auth_2_signing_key.py | 169 ++++ src/convoy/models/models_onboard_item.py | 97 ++ .../models/models_onboard_validation_error.py | 79 ++ src/convoy/models/models_optional_time.py | 70 ++ src/convoy/models/models_paged_response.py | 99 ++ src/convoy/models/models_project_config.py | 261 +++++ src/convoy/models/models_project_response.py | 181 ++++ src/convoy/models/models_pub_sub_config.py | 154 +++ .../models/models_rate_limit_configuration.py | 70 ++ .../models/models_retry_configuration.py | 98 ++ .../models/models_signature_configuration.py | 96 ++ src/convoy/models/models_signature_version.py | 88 ++ src/convoy/models/models_source_response.py | 292 ++++++ .../models/models_sqs_pub_sub_config.py | 88 ++ src/convoy/models/models_ssl_configuration.py | 61 ++ .../models/models_strategy_configuration.py | 79 ++ .../models/models_subscription_response.py | 285 ++++++ src/convoy/models/models_test_filter.py | 90 ++ .../models/models_test_filter_request.py | 86 ++ .../models_test_filter_request_scopes.py | 131 +++ .../models/models_test_filter_response.py | 61 ++ .../models/models_test_o_auth_2_request.py | 74 ++ .../models/models_test_o_auth_2_response.py | 106 ++ .../models/models_update_custom_response.py | 93 ++ src/convoy/models/models_update_endpoint.py | 218 ++++ src/convoy/models/models_update_event_type.py | 96 ++ .../models_update_event_type_json_schema.py | 47 + .../models/models_update_filter_request.py | 158 +++ src/convoy/models/models_update_project.py | 92 ++ src/convoy/models/models_update_source.py | 199 ++++ .../models/models_update_subscription.py | 196 ++++ src/convoy/models/models_verifier_config.py | 122 +++ .../models/pause_endpoint_response_202.py | 92 ++ .../models/pause_endpoint_response_400.py | 92 ++ .../models/pause_endpoint_response_401.py | 92 ++ .../models/pause_endpoint_response_404.py | 92 ++ ...t_id_sources_test_function_response_200.py | 92 ++ ...t_id_sources_test_function_response_400.py | 92 ++ ...t_id_sources_test_function_response_401.py | 92 ++ ...t_id_sources_test_function_response_404.py | 92 ++ ...esh_portal_link_auth_token_response_200.py | 79 ++ ...esh_portal_link_auth_token_response_400.py | 92 ++ ...esh_portal_link_auth_token_response_401.py | 92 ++ ...esh_portal_link_auth_token_response_404.py | 92 ++ .../replay_endpoint_event_response_200.py | 92 ++ .../replay_endpoint_event_response_400.py | 92 ++ .../replay_endpoint_event_response_401.py | 92 ++ .../replay_endpoint_event_response_404.py | 92 ++ .../resend_event_delivery_response_200.py | 92 ++ .../resend_event_delivery_response_400.py | 92 ++ .../resend_event_delivery_response_401.py | 92 ++ .../resend_event_delivery_response_404.py | 92 ++ .../models/resend_meta_event_response_200.py | 92 ++ .../models/resend_meta_event_response_400.py | 92 ++ .../models/resend_meta_event_response_401.py | 92 ++ .../models/resend_meta_event_response_404.py | 92 ++ .../models/revoke_portal_link_response_200.py | 92 ++ .../models/revoke_portal_link_response_400.py | 92 ++ .../models/revoke_portal_link_response_401.py | 92 ++ .../models/revoke_portal_link_response_404.py | 92 ++ src/convoy/models/test_filter_response_200.py | 92 ++ src/convoy/models/test_filter_response_400.py | 92 ++ src/convoy/models/test_filter_response_401.py | 92 ++ src/convoy/models/test_filter_response_404.py | 92 ++ .../test_o_auth_2_connection_response_200.py | 92 ++ .../test_o_auth_2_connection_response_400.py | 92 ++ .../test_o_auth_2_connection_response_401.py | 92 ++ .../test_o_auth_2_connection_response_404.py | 92 ++ .../test_subscription_filter_response_200.py | 79 ++ .../test_subscription_filter_response_400.py | 92 ++ .../test_subscription_filter_response_401.py | 92 ++ .../test_subscription_filter_response_404.py | 92 ++ ...test_subscription_function_response_200.py | 92 ++ ...test_subscription_function_response_400.py | 92 ++ ...test_subscription_function_response_401.py | 92 ++ ...test_subscription_function_response_404.py | 92 ++ ...toggle_subscription_status_response_202.py | 92 ++ ...toggle_subscription_status_response_400.py | 92 ++ ...toggle_subscription_status_response_401.py | 92 ++ ...toggle_subscription_status_response_404.py | 92 ++ .../models/update_endpoint_response_202.py | 92 ++ .../models/update_endpoint_response_400.py | 92 ++ .../models/update_endpoint_response_401.py | 92 ++ .../models/update_endpoint_response_404.py | 92 ++ .../models/update_event_type_response_201.py | 92 ++ .../models/update_event_type_response_400.py | 92 ++ .../models/update_event_type_response_401.py | 92 ++ .../models/update_event_type_response_404.py | 92 ++ .../models/update_filter_response_200.py | 92 ++ .../models/update_filter_response_400.py | 92 ++ .../models/update_filter_response_401.py | 92 ++ .../models/update_filter_response_404.py | 92 ++ .../models/update_portal_link_response_202.py | 92 ++ .../models/update_portal_link_response_400.py | 92 ++ .../models/update_portal_link_response_401.py | 92 ++ .../models/update_portal_link_response_404.py | 92 ++ .../models/update_project_response_202.py | 92 ++ .../models/update_project_response_400.py | 92 ++ .../models/update_project_response_401.py | 92 ++ .../models/update_project_response_403.py | 92 ++ .../models/update_project_response_404.py | 92 ++ .../models/update_source_response_202.py | 92 ++ .../models/update_source_response_400.py | 92 ++ .../models/update_source_response_401.py | 92 ++ .../models/update_source_response_404.py | 92 ++ .../update_subscription_response_202.py | 92 ++ .../update_subscription_response_400.py | 92 ++ .../update_subscription_response_401.py | 92 ++ .../update_subscription_response_404.py | 92 ++ src/convoy/models/util_server_response.py | 70 ++ src/convoy/types.py | 54 + 540 files changed, 61353 insertions(+) create mode 100644 src/convoy/__init__.py create mode 100644 src/convoy/api/__init__.py create mode 100644 src/convoy/api/delivery_attempts/__init__.py create mode 100644 src/convoy/api/delivery_attempts/get_delivery_attempt.py create mode 100644 src/convoy/api/delivery_attempts/get_delivery_attempts.py create mode 100644 src/convoy/api/endpoints/__init__.py create mode 100644 src/convoy/api/endpoints/activate_endpoint.py create mode 100644 src/convoy/api/endpoints/create_endpoint.py create mode 100644 src/convoy/api/endpoints/delete_endpoint.py create mode 100644 src/convoy/api/endpoints/expire_secret.py create mode 100644 src/convoy/api/endpoints/get_endpoint.py create mode 100644 src/convoy/api/endpoints/get_endpoints.py create mode 100644 src/convoy/api/endpoints/pause_endpoint.py create mode 100644 src/convoy/api/endpoints/test_o_auth_2_connection.py create mode 100644 src/convoy/api/endpoints/update_endpoint.py create mode 100644 src/convoy/api/event_deliveries/__init__.py create mode 100644 src/convoy/api/event_deliveries/batch_retry_event_delivery.py create mode 100644 src/convoy/api/event_deliveries/force_resend_event_deliveries.py create mode 100644 src/convoy/api/event_deliveries/get_event_deliveries_paged.py create mode 100644 src/convoy/api/event_deliveries/get_event_delivery.py create mode 100644 src/convoy/api/event_deliveries/resend_event_delivery.py create mode 100644 src/convoy/api/event_types/__init__.py create mode 100644 src/convoy/api/event_types/create_event_type.py create mode 100644 src/convoy/api/event_types/deprecate_event_type.py create mode 100644 src/convoy/api/event_types/get_event_types.py create mode 100644 src/convoy/api/event_types/import_open_api_spec.py create mode 100644 src/convoy/api/event_types/update_event_type.py create mode 100644 src/convoy/api/events/__init__.py create mode 100644 src/convoy/api/events/batch_replay_events.py create mode 100644 src/convoy/api/events/count_affected_events.py create mode 100644 src/convoy/api/events/create_broadcast_event.py create mode 100644 src/convoy/api/events/create_dynamic_event.py create mode 100644 src/convoy/api/events/create_endpoint_event.py create mode 100644 src/convoy/api/events/create_endpoint_fanout_event.py create mode 100644 src/convoy/api/events/get_endpoint_event.py create mode 100644 src/convoy/api/events/get_events_paged.py create mode 100644 src/convoy/api/events/replay_endpoint_event.py create mode 100644 src/convoy/api/filters/__init__.py create mode 100644 src/convoy/api/filters/bulk_create_filters.py create mode 100644 src/convoy/api/filters/bulk_update_filters.py create mode 100644 src/convoy/api/filters/create_filter.py create mode 100644 src/convoy/api/filters/delete_filter.py create mode 100644 src/convoy/api/filters/get_filter.py create mode 100644 src/convoy/api/filters/get_filters.py create mode 100644 src/convoy/api/filters/test_filter.py create mode 100644 src/convoy/api/filters/update_filter.py create mode 100644 src/convoy/api/meta_events/__init__.py create mode 100644 src/convoy/api/meta_events/get_meta_event.py create mode 100644 src/convoy/api/meta_events/get_meta_events_paged.py create mode 100644 src/convoy/api/meta_events/resend_meta_event.py create mode 100644 src/convoy/api/onboard/__init__.py create mode 100644 src/convoy/api/onboard/bulk_onboard.py create mode 100644 src/convoy/api/portal_links/__init__.py create mode 100644 src/convoy/api/portal_links/create_portal_link.py create mode 100644 src/convoy/api/portal_links/get_portal_link.py create mode 100644 src/convoy/api/portal_links/load_portal_links_paged.py create mode 100644 src/convoy/api/portal_links/refresh_portal_link_auth_token.py create mode 100644 src/convoy/api/portal_links/revoke_portal_link.py create mode 100644 src/convoy/api/portal_links/update_portal_link.py create mode 100644 src/convoy/api/projects/__init__.py create mode 100644 src/convoy/api/projects/create_project.py create mode 100644 src/convoy/api/projects/delete_project.py create mode 100644 src/convoy/api/projects/get_project.py create mode 100644 src/convoy/api/projects/get_projects.py create mode 100644 src/convoy/api/projects/update_project.py create mode 100644 src/convoy/api/sources/__init__.py create mode 100644 src/convoy/api/sources/create_source.py create mode 100644 src/convoy/api/sources/delete_source.py create mode 100644 src/convoy/api/sources/get_source.py create mode 100644 src/convoy/api/sources/load_sources_paged.py create mode 100644 src/convoy/api/sources/update_source.py create mode 100644 src/convoy/api/subscriptions/__init__.py create mode 100644 src/convoy/api/subscriptions/create_subscription.py create mode 100644 src/convoy/api/subscriptions/delete_subscription.py create mode 100644 src/convoy/api/subscriptions/get_subscription.py create mode 100644 src/convoy/api/subscriptions/get_subscriptions.py create mode 100644 src/convoy/api/subscriptions/post_v_1_projects_project_id_sources_test_function.py create mode 100644 src/convoy/api/subscriptions/test_subscription_filter.py create mode 100644 src/convoy/api/subscriptions/test_subscription_function.py create mode 100644 src/convoy/api/subscriptions/toggle_subscription_status.py create mode 100644 src/convoy/api/subscriptions/update_subscription.py create mode 100644 src/convoy/client.py create mode 100644 src/convoy/errors.py create mode 100644 src/convoy/models/__init__.py create mode 100644 src/convoy/models/activate_endpoint_response_202.py create mode 100644 src/convoy/models/activate_endpoint_response_400.py create mode 100644 src/convoy/models/activate_endpoint_response_401.py create mode 100644 src/convoy/models/activate_endpoint_response_404.py create mode 100644 src/convoy/models/auth_role_type.py create mode 100644 src/convoy/models/batch_replay_events_direction.py create mode 100644 src/convoy/models/batch_replay_events_response_200.py create mode 100644 src/convoy/models/batch_replay_events_response_400.py create mode 100644 src/convoy/models/batch_replay_events_response_401.py create mode 100644 src/convoy/models/batch_replay_events_response_404.py create mode 100644 src/convoy/models/batch_retry_event_delivery_direction.py create mode 100644 src/convoy/models/batch_retry_event_delivery_response_200.py create mode 100644 src/convoy/models/batch_retry_event_delivery_response_400.py create mode 100644 src/convoy/models/batch_retry_event_delivery_response_401.py create mode 100644 src/convoy/models/batch_retry_event_delivery_response_404.py create mode 100644 src/convoy/models/bulk_create_filters_response_201.py create mode 100644 src/convoy/models/bulk_create_filters_response_400.py create mode 100644 src/convoy/models/bulk_create_filters_response_401.py create mode 100644 src/convoy/models/bulk_create_filters_response_404.py create mode 100644 src/convoy/models/bulk_onboard_response_200.py create mode 100644 src/convoy/models/bulk_onboard_response_202.py create mode 100644 src/convoy/models/bulk_onboard_response_400.py create mode 100644 src/convoy/models/bulk_onboard_response_401.py create mode 100644 src/convoy/models/bulk_onboard_response_404.py create mode 100644 src/convoy/models/bulk_update_filters_response_200.py create mode 100644 src/convoy/models/bulk_update_filters_response_400.py create mode 100644 src/convoy/models/bulk_update_filters_response_401.py create mode 100644 src/convoy/models/bulk_update_filters_response_404.py create mode 100644 src/convoy/models/config_request_id_header_provider.py create mode 100644 src/convoy/models/config_signature_header_provider.py create mode 100644 src/convoy/models/count_affected_events_direction.py create mode 100644 src/convoy/models/count_affected_events_response_200.py create mode 100644 src/convoy/models/count_affected_events_response_400.py create mode 100644 src/convoy/models/count_affected_events_response_401.py create mode 100644 src/convoy/models/count_affected_events_response_404.py create mode 100644 src/convoy/models/create_broadcast_event_response_201.py create mode 100644 src/convoy/models/create_broadcast_event_response_400.py create mode 100644 src/convoy/models/create_broadcast_event_response_401.py create mode 100644 src/convoy/models/create_broadcast_event_response_404.py create mode 100644 src/convoy/models/create_dynamic_event_response_400.py create mode 100644 src/convoy/models/create_dynamic_event_response_401.py create mode 100644 src/convoy/models/create_dynamic_event_response_404.py create mode 100644 src/convoy/models/create_endpoint_event_response_201.py create mode 100644 src/convoy/models/create_endpoint_event_response_400.py create mode 100644 src/convoy/models/create_endpoint_event_response_401.py create mode 100644 src/convoy/models/create_endpoint_event_response_404.py create mode 100644 src/convoy/models/create_endpoint_fanout_event_response_201.py create mode 100644 src/convoy/models/create_endpoint_fanout_event_response_400.py create mode 100644 src/convoy/models/create_endpoint_fanout_event_response_401.py create mode 100644 src/convoy/models/create_endpoint_fanout_event_response_404.py create mode 100644 src/convoy/models/create_endpoint_response_201.py create mode 100644 src/convoy/models/create_endpoint_response_400.py create mode 100644 src/convoy/models/create_endpoint_response_401.py create mode 100644 src/convoy/models/create_endpoint_response_404.py create mode 100644 src/convoy/models/create_event_type_response_201.py create mode 100644 src/convoy/models/create_event_type_response_400.py create mode 100644 src/convoy/models/create_event_type_response_401.py create mode 100644 src/convoy/models/create_event_type_response_404.py create mode 100644 src/convoy/models/create_filter_response_201.py create mode 100644 src/convoy/models/create_filter_response_400.py create mode 100644 src/convoy/models/create_filter_response_401.py create mode 100644 src/convoy/models/create_filter_response_404.py create mode 100644 src/convoy/models/create_portal_link_response_201.py create mode 100644 src/convoy/models/create_portal_link_response_400.py create mode 100644 src/convoy/models/create_portal_link_response_401.py create mode 100644 src/convoy/models/create_portal_link_response_404.py create mode 100644 src/convoy/models/create_project_response_201.py create mode 100644 src/convoy/models/create_project_response_400.py create mode 100644 src/convoy/models/create_project_response_401.py create mode 100644 src/convoy/models/create_project_response_402.py create mode 100644 src/convoy/models/create_project_response_403.py create mode 100644 src/convoy/models/create_project_response_404.py create mode 100644 src/convoy/models/create_source_response_201.py create mode 100644 src/convoy/models/create_source_response_400.py create mode 100644 src/convoy/models/create_source_response_401.py create mode 100644 src/convoy/models/create_source_response_404.py create mode 100644 src/convoy/models/create_subscription_response_201.py create mode 100644 src/convoy/models/create_subscription_response_400.py create mode 100644 src/convoy/models/create_subscription_response_401.py create mode 100644 src/convoy/models/create_subscription_response_404.py create mode 100644 src/convoy/models/datastore_alert_configuration.py create mode 100644 src/convoy/models/datastore_amqp_credentials.py create mode 100644 src/convoy/models/datastore_amqp_pub_sub_config.py create mode 100644 src/convoy/models/datastore_api_key.py create mode 100644 src/convoy/models/datastore_api_key_response.py create mode 100644 src/convoy/models/datastore_basic_auth.py create mode 100644 src/convoy/models/datastore_circuit_breaker_configuration.py create mode 100644 src/convoy/models/datastore_cli_metadata.py create mode 100644 src/convoy/models/datastore_create_portal_link_request.py create mode 100644 src/convoy/models/datastore_custom_response.py create mode 100644 src/convoy/models/datastore_delivery_attempt.py create mode 100644 src/convoy/models/datastore_delivery_mode.py create mode 100644 src/convoy/models/datastore_device.py create mode 100644 src/convoy/models/datastore_device_status.py create mode 100644 src/convoy/models/datastore_encoding_type.py create mode 100644 src/convoy/models/datastore_endpoint.py create mode 100644 src/convoy/models/datastore_endpoint_authentication.py create mode 100644 src/convoy/models/datastore_endpoint_authentication_type.py create mode 100644 src/convoy/models/datastore_endpoint_status.py create mode 100644 src/convoy/models/datastore_event.py create mode 100644 src/convoy/models/datastore_event_delivery_status.py create mode 100644 src/convoy/models/datastore_event_status.py create mode 100644 src/convoy/models/datastore_filter_configuration.py create mode 100644 src/convoy/models/datastore_filter_schema.py create mode 100644 src/convoy/models/datastore_google_pub_sub_config.py create mode 100644 src/convoy/models/datastore_h_mac.py create mode 100644 src/convoy/models/datastore_http_header.py create mode 100644 src/convoy/models/datastore_kafka_auth.py create mode 100644 src/convoy/models/datastore_kafka_pub_sub_config.py create mode 100644 src/convoy/models/datastore_m.py create mode 100644 src/convoy/models/datastore_meta_event_attempt.py create mode 100644 src/convoy/models/datastore_meta_event_configuration.py create mode 100644 src/convoy/models/datastore_meta_event_type.py create mode 100644 src/convoy/models/datastore_metadata.py create mode 100644 src/convoy/models/datastore_mtls_client_cert.py create mode 100644 src/convoy/models/datastore_o_auth_2.py create mode 100644 src/convoy/models/datastore_o_auth_2_authentication_type.py create mode 100644 src/convoy/models/datastore_o_auth_2_expiry_time_unit.py create mode 100644 src/convoy/models/datastore_o_auth_2_field_mapping.py create mode 100644 src/convoy/models/datastore_o_auth_2_signing_key.py create mode 100644 src/convoy/models/datastore_page_direction.py create mode 100644 src/convoy/models/datastore_pagination_data.py create mode 100644 src/convoy/models/datastore_portal_auth_type.py create mode 100644 src/convoy/models/datastore_portal_link_response.py create mode 100644 src/convoy/models/datastore_project_config.py create mode 100644 src/convoy/models/datastore_project_statistics.py create mode 100644 src/convoy/models/datastore_project_type.py create mode 100644 src/convoy/models/datastore_provider_config.py create mode 100644 src/convoy/models/datastore_pub_sub_config.py create mode 100644 src/convoy/models/datastore_pub_sub_type.py create mode 100644 src/convoy/models/datastore_rate_limit_configuration.py create mode 100644 src/convoy/models/datastore_retry_configuration.py create mode 100644 src/convoy/models/datastore_role.py create mode 100644 src/convoy/models/datastore_secret.py create mode 100644 src/convoy/models/datastore_signature_configuration.py create mode 100644 src/convoy/models/datastore_signature_version.py create mode 100644 src/convoy/models/datastore_source.py create mode 100644 src/convoy/models/datastore_source_provider.py create mode 100644 src/convoy/models/datastore_source_type.py create mode 100644 src/convoy/models/datastore_sqs_pub_sub_config.py create mode 100644 src/convoy/models/datastore_ssl_configuration.py create mode 100644 src/convoy/models/datastore_strategy_configuration.py create mode 100644 src/convoy/models/datastore_strategy_provider.py create mode 100644 src/convoy/models/datastore_subscription_type.py create mode 100644 src/convoy/models/datastore_twitter_provider_config.py create mode 100644 src/convoy/models/datastore_update_portal_link_request.py create mode 100644 src/convoy/models/datastore_verifier_config.py create mode 100644 src/convoy/models/datastore_verifier_type.py create mode 100644 src/convoy/models/delete_endpoint_response_200.py create mode 100644 src/convoy/models/delete_endpoint_response_400.py create mode 100644 src/convoy/models/delete_endpoint_response_401.py create mode 100644 src/convoy/models/delete_endpoint_response_404.py create mode 100644 src/convoy/models/delete_filter_response_200.py create mode 100644 src/convoy/models/delete_filter_response_400.py create mode 100644 src/convoy/models/delete_filter_response_401.py create mode 100644 src/convoy/models/delete_filter_response_404.py create mode 100644 src/convoy/models/delete_project_response_200.py create mode 100644 src/convoy/models/delete_project_response_400.py create mode 100644 src/convoy/models/delete_project_response_401.py create mode 100644 src/convoy/models/delete_project_response_403.py create mode 100644 src/convoy/models/delete_project_response_404.py create mode 100644 src/convoy/models/delete_source_response_200.py create mode 100644 src/convoy/models/delete_source_response_400.py create mode 100644 src/convoy/models/delete_source_response_401.py create mode 100644 src/convoy/models/delete_source_response_404.py create mode 100644 src/convoy/models/delete_subscription_response_200.py create mode 100644 src/convoy/models/delete_subscription_response_400.py create mode 100644 src/convoy/models/delete_subscription_response_401.py create mode 100644 src/convoy/models/delete_subscription_response_404.py create mode 100644 src/convoy/models/deprecate_event_type_response_201.py create mode 100644 src/convoy/models/deprecate_event_type_response_400.py create mode 100644 src/convoy/models/deprecate_event_type_response_401.py create mode 100644 src/convoy/models/deprecate_event_type_response_404.py create mode 100644 src/convoy/models/expire_secret_response_200.py create mode 100644 src/convoy/models/expire_secret_response_400.py create mode 100644 src/convoy/models/expire_secret_response_401.py create mode 100644 src/convoy/models/expire_secret_response_404.py create mode 100644 src/convoy/models/force_resend_event_deliveries_response_200.py create mode 100644 src/convoy/models/force_resend_event_deliveries_response_400.py create mode 100644 src/convoy/models/force_resend_event_deliveries_response_401.py create mode 100644 src/convoy/models/force_resend_event_deliveries_response_404.py create mode 100644 src/convoy/models/get_delivery_attempt_response_200.py create mode 100644 src/convoy/models/get_delivery_attempt_response_400.py create mode 100644 src/convoy/models/get_delivery_attempt_response_401.py create mode 100644 src/convoy/models/get_delivery_attempt_response_404.py create mode 100644 src/convoy/models/get_delivery_attempts_response_200.py create mode 100644 src/convoy/models/get_delivery_attempts_response_400.py create mode 100644 src/convoy/models/get_delivery_attempts_response_401.py create mode 100644 src/convoy/models/get_delivery_attempts_response_404.py create mode 100644 src/convoy/models/get_endpoint_event_response_200.py create mode 100644 src/convoy/models/get_endpoint_event_response_400.py create mode 100644 src/convoy/models/get_endpoint_event_response_401.py create mode 100644 src/convoy/models/get_endpoint_event_response_404.py create mode 100644 src/convoy/models/get_endpoint_response_200.py create mode 100644 src/convoy/models/get_endpoint_response_400.py create mode 100644 src/convoy/models/get_endpoint_response_401.py create mode 100644 src/convoy/models/get_endpoint_response_404.py create mode 100644 src/convoy/models/get_endpoints_direction.py create mode 100644 src/convoy/models/get_endpoints_response_200.py create mode 100644 src/convoy/models/get_endpoints_response_200_data.py create mode 100644 src/convoy/models/get_endpoints_response_400.py create mode 100644 src/convoy/models/get_endpoints_response_401.py create mode 100644 src/convoy/models/get_endpoints_response_404.py create mode 100644 src/convoy/models/get_event_deliveries_paged_direction.py create mode 100644 src/convoy/models/get_event_deliveries_paged_response_200.py create mode 100644 src/convoy/models/get_event_deliveries_paged_response_200_data.py create mode 100644 src/convoy/models/get_event_deliveries_paged_response_400.py create mode 100644 src/convoy/models/get_event_deliveries_paged_response_401.py create mode 100644 src/convoy/models/get_event_deliveries_paged_response_404.py create mode 100644 src/convoy/models/get_event_delivery_response_200.py create mode 100644 src/convoy/models/get_event_delivery_response_400.py create mode 100644 src/convoy/models/get_event_delivery_response_401.py create mode 100644 src/convoy/models/get_event_delivery_response_404.py create mode 100644 src/convoy/models/get_event_types_response_200.py create mode 100644 src/convoy/models/get_event_types_response_400.py create mode 100644 src/convoy/models/get_event_types_response_401.py create mode 100644 src/convoy/models/get_event_types_response_404.py create mode 100644 src/convoy/models/get_events_paged_direction.py create mode 100644 src/convoy/models/get_events_paged_response_200.py create mode 100644 src/convoy/models/get_events_paged_response_200_data.py create mode 100644 src/convoy/models/get_events_paged_response_400.py create mode 100644 src/convoy/models/get_events_paged_response_401.py create mode 100644 src/convoy/models/get_events_paged_response_404.py create mode 100644 src/convoy/models/get_filter_response_200.py create mode 100644 src/convoy/models/get_filter_response_400.py create mode 100644 src/convoy/models/get_filter_response_401.py create mode 100644 src/convoy/models/get_filter_response_404.py create mode 100644 src/convoy/models/get_filters_response_200.py create mode 100644 src/convoy/models/get_filters_response_400.py create mode 100644 src/convoy/models/get_filters_response_401.py create mode 100644 src/convoy/models/get_filters_response_404.py create mode 100644 src/convoy/models/get_meta_event_response_200.py create mode 100644 src/convoy/models/get_meta_event_response_400.py create mode 100644 src/convoy/models/get_meta_event_response_401.py create mode 100644 src/convoy/models/get_meta_event_response_404.py create mode 100644 src/convoy/models/get_meta_events_paged_direction.py create mode 100644 src/convoy/models/get_meta_events_paged_response_200.py create mode 100644 src/convoy/models/get_meta_events_paged_response_200_data.py create mode 100644 src/convoy/models/get_meta_events_paged_response_400.py create mode 100644 src/convoy/models/get_meta_events_paged_response_401.py create mode 100644 src/convoy/models/get_meta_events_paged_response_404.py create mode 100644 src/convoy/models/get_portal_link_response_200.py create mode 100644 src/convoy/models/get_portal_link_response_400.py create mode 100644 src/convoy/models/get_portal_link_response_401.py create mode 100644 src/convoy/models/get_portal_link_response_404.py create mode 100644 src/convoy/models/get_project_response_200.py create mode 100644 src/convoy/models/get_project_response_400.py create mode 100644 src/convoy/models/get_project_response_401.py create mode 100644 src/convoy/models/get_project_response_404.py create mode 100644 src/convoy/models/get_projects_response_200.py create mode 100644 src/convoy/models/get_projects_response_400.py create mode 100644 src/convoy/models/get_projects_response_401.py create mode 100644 src/convoy/models/get_projects_response_404.py create mode 100644 src/convoy/models/get_source_response_200.py create mode 100644 src/convoy/models/get_source_response_400.py create mode 100644 src/convoy/models/get_source_response_401.py create mode 100644 src/convoy/models/get_source_response_404.py create mode 100644 src/convoy/models/get_subscription_response_200.py create mode 100644 src/convoy/models/get_subscription_response_400.py create mode 100644 src/convoy/models/get_subscription_response_401.py create mode 100644 src/convoy/models/get_subscription_response_404.py create mode 100644 src/convoy/models/get_subscriptions_direction.py create mode 100644 src/convoy/models/get_subscriptions_response_200.py create mode 100644 src/convoy/models/get_subscriptions_response_200_data.py create mode 100644 src/convoy/models/get_subscriptions_response_400.py create mode 100644 src/convoy/models/get_subscriptions_response_401.py create mode 100644 src/convoy/models/get_subscriptions_response_404.py create mode 100644 src/convoy/models/handlers_stub.py create mode 100644 src/convoy/models/httpheader_http_header.py create mode 100644 src/convoy/models/import_open_api_spec_response_200.py create mode 100644 src/convoy/models/import_open_api_spec_response_400.py create mode 100644 src/convoy/models/import_open_api_spec_response_401.py create mode 100644 src/convoy/models/import_open_api_spec_response_404.py create mode 100644 src/convoy/models/load_portal_links_paged_direction.py create mode 100644 src/convoy/models/load_portal_links_paged_response_200.py create mode 100644 src/convoy/models/load_portal_links_paged_response_200_data.py create mode 100644 src/convoy/models/load_portal_links_paged_response_400.py create mode 100644 src/convoy/models/load_portal_links_paged_response_401.py create mode 100644 src/convoy/models/load_portal_links_paged_response_404.py create mode 100644 src/convoy/models/load_sources_paged_direction.py create mode 100644 src/convoy/models/load_sources_paged_response_200.py create mode 100644 src/convoy/models/load_sources_paged_response_200_data.py create mode 100644 src/convoy/models/load_sources_paged_response_400.py create mode 100644 src/convoy/models/load_sources_paged_response_401.py create mode 100644 src/convoy/models/load_sources_paged_response_404.py create mode 100644 src/convoy/models/models_alert_configuration.py create mode 100644 src/convoy/models/models_amqp_auth.py create mode 100644 src/convoy/models/models_amqp_exchange.py create mode 100644 src/convoy/models/models_amqp_pub_subconfig.py create mode 100644 src/convoy/models/models_api_key.py create mode 100644 src/convoy/models/models_basic_auth.py create mode 100644 src/convoy/models/models_broadcast_event.py create mode 100644 src/convoy/models/models_broadcast_event_custom_headers.py create mode 100644 src/convoy/models/models_broadcast_event_data.py create mode 100644 src/convoy/models/models_bulk_onboard_accepted_response.py create mode 100644 src/convoy/models/models_bulk_onboard_dry_run_response.py create mode 100644 src/convoy/models/models_bulk_onboard_request.py create mode 100644 src/convoy/models/models_bulk_update_filter_request.py create mode 100644 src/convoy/models/models_bulk_update_filter_request_body.py create mode 100644 src/convoy/models/models_bulk_update_filter_request_headers.py create mode 100644 src/convoy/models/models_bulk_update_filter_request_path.py create mode 100644 src/convoy/models/models_bulk_update_filter_request_query.py create mode 100644 src/convoy/models/models_count_response.py create mode 100644 src/convoy/models/models_create_endpoint.py create mode 100644 src/convoy/models/models_create_event.py create mode 100644 src/convoy/models/models_create_event_custom_headers.py create mode 100644 src/convoy/models/models_create_event_data.py create mode 100644 src/convoy/models/models_create_event_type.py create mode 100644 src/convoy/models/models_create_event_type_json_schema.py create mode 100644 src/convoy/models/models_create_filter_request.py create mode 100644 src/convoy/models/models_create_project.py create mode 100644 src/convoy/models/models_create_project_response.py create mode 100644 src/convoy/models/models_create_source.py create mode 100644 src/convoy/models/models_create_subscription.py create mode 100644 src/convoy/models/models_custom_response.py create mode 100644 src/convoy/models/models_dynamic_event.py create mode 100644 src/convoy/models/models_dynamic_event_custom_headers.py create mode 100644 src/convoy/models/models_dynamic_event_data.py create mode 100644 src/convoy/models/models_endpoint_authentication.py create mode 100644 src/convoy/models/models_endpoint_response.py create mode 100644 src/convoy/models/models_event_delivery_response.py create mode 100644 src/convoy/models/models_event_response.py create mode 100644 src/convoy/models/models_event_type_response.py create mode 100644 src/convoy/models/models_expire_secret.py create mode 100644 src/convoy/models/models_fanout_event.py create mode 100644 src/convoy/models/models_fanout_event_custom_headers.py create mode 100644 src/convoy/models/models_fanout_event_data.py create mode 100644 src/convoy/models/models_filter_configuration.py create mode 100644 src/convoy/models/models_filter_response.py create mode 100644 src/convoy/models/models_filter_schema.py create mode 100644 src/convoy/models/models_fs.py create mode 100644 src/convoy/models/models_function_request.py create mode 100644 src/convoy/models/models_function_request_payload.py create mode 100644 src/convoy/models/models_function_response.py create mode 100644 src/convoy/models/models_google_pub_sub_config.py create mode 100644 src/convoy/models/models_h_mac.py create mode 100644 src/convoy/models/models_i_ds.py create mode 100644 src/convoy/models/models_import_open_api_spec.py create mode 100644 src/convoy/models/models_kafka_auth.py create mode 100644 src/convoy/models/models_kafka_pub_sub_config.py create mode 100644 src/convoy/models/models_meta_event_configuration.py create mode 100644 src/convoy/models/models_meta_event_response.py create mode 100644 src/convoy/models/models_mtls_client_cert.py create mode 100644 src/convoy/models/models_o_auth_2.py create mode 100644 src/convoy/models/models_o_auth_2_field_mapping.py create mode 100644 src/convoy/models/models_o_auth_2_signing_key.py create mode 100644 src/convoy/models/models_onboard_item.py create mode 100644 src/convoy/models/models_onboard_validation_error.py create mode 100644 src/convoy/models/models_optional_time.py create mode 100644 src/convoy/models/models_paged_response.py create mode 100644 src/convoy/models/models_project_config.py create mode 100644 src/convoy/models/models_project_response.py create mode 100644 src/convoy/models/models_pub_sub_config.py create mode 100644 src/convoy/models/models_rate_limit_configuration.py create mode 100644 src/convoy/models/models_retry_configuration.py create mode 100644 src/convoy/models/models_signature_configuration.py create mode 100644 src/convoy/models/models_signature_version.py create mode 100644 src/convoy/models/models_source_response.py create mode 100644 src/convoy/models/models_sqs_pub_sub_config.py create mode 100644 src/convoy/models/models_ssl_configuration.py create mode 100644 src/convoy/models/models_strategy_configuration.py create mode 100644 src/convoy/models/models_subscription_response.py create mode 100644 src/convoy/models/models_test_filter.py create mode 100644 src/convoy/models/models_test_filter_request.py create mode 100644 src/convoy/models/models_test_filter_request_scopes.py create mode 100644 src/convoy/models/models_test_filter_response.py create mode 100644 src/convoy/models/models_test_o_auth_2_request.py create mode 100644 src/convoy/models/models_test_o_auth_2_response.py create mode 100644 src/convoy/models/models_update_custom_response.py create mode 100644 src/convoy/models/models_update_endpoint.py create mode 100644 src/convoy/models/models_update_event_type.py create mode 100644 src/convoy/models/models_update_event_type_json_schema.py create mode 100644 src/convoy/models/models_update_filter_request.py create mode 100644 src/convoy/models/models_update_project.py create mode 100644 src/convoy/models/models_update_source.py create mode 100644 src/convoy/models/models_update_subscription.py create mode 100644 src/convoy/models/models_verifier_config.py create mode 100644 src/convoy/models/pause_endpoint_response_202.py create mode 100644 src/convoy/models/pause_endpoint_response_400.py create mode 100644 src/convoy/models/pause_endpoint_response_401.py create mode 100644 src/convoy/models/pause_endpoint_response_404.py create mode 100644 src/convoy/models/post_v1_projects_project_id_sources_test_function_response_200.py create mode 100644 src/convoy/models/post_v1_projects_project_id_sources_test_function_response_400.py create mode 100644 src/convoy/models/post_v1_projects_project_id_sources_test_function_response_401.py create mode 100644 src/convoy/models/post_v1_projects_project_id_sources_test_function_response_404.py create mode 100644 src/convoy/models/refresh_portal_link_auth_token_response_200.py create mode 100644 src/convoy/models/refresh_portal_link_auth_token_response_400.py create mode 100644 src/convoy/models/refresh_portal_link_auth_token_response_401.py create mode 100644 src/convoy/models/refresh_portal_link_auth_token_response_404.py create mode 100644 src/convoy/models/replay_endpoint_event_response_200.py create mode 100644 src/convoy/models/replay_endpoint_event_response_400.py create mode 100644 src/convoy/models/replay_endpoint_event_response_401.py create mode 100644 src/convoy/models/replay_endpoint_event_response_404.py create mode 100644 src/convoy/models/resend_event_delivery_response_200.py create mode 100644 src/convoy/models/resend_event_delivery_response_400.py create mode 100644 src/convoy/models/resend_event_delivery_response_401.py create mode 100644 src/convoy/models/resend_event_delivery_response_404.py create mode 100644 src/convoy/models/resend_meta_event_response_200.py create mode 100644 src/convoy/models/resend_meta_event_response_400.py create mode 100644 src/convoy/models/resend_meta_event_response_401.py create mode 100644 src/convoy/models/resend_meta_event_response_404.py create mode 100644 src/convoy/models/revoke_portal_link_response_200.py create mode 100644 src/convoy/models/revoke_portal_link_response_400.py create mode 100644 src/convoy/models/revoke_portal_link_response_401.py create mode 100644 src/convoy/models/revoke_portal_link_response_404.py create mode 100644 src/convoy/models/test_filter_response_200.py create mode 100644 src/convoy/models/test_filter_response_400.py create mode 100644 src/convoy/models/test_filter_response_401.py create mode 100644 src/convoy/models/test_filter_response_404.py create mode 100644 src/convoy/models/test_o_auth_2_connection_response_200.py create mode 100644 src/convoy/models/test_o_auth_2_connection_response_400.py create mode 100644 src/convoy/models/test_o_auth_2_connection_response_401.py create mode 100644 src/convoy/models/test_o_auth_2_connection_response_404.py create mode 100644 src/convoy/models/test_subscription_filter_response_200.py create mode 100644 src/convoy/models/test_subscription_filter_response_400.py create mode 100644 src/convoy/models/test_subscription_filter_response_401.py create mode 100644 src/convoy/models/test_subscription_filter_response_404.py create mode 100644 src/convoy/models/test_subscription_function_response_200.py create mode 100644 src/convoy/models/test_subscription_function_response_400.py create mode 100644 src/convoy/models/test_subscription_function_response_401.py create mode 100644 src/convoy/models/test_subscription_function_response_404.py create mode 100644 src/convoy/models/toggle_subscription_status_response_202.py create mode 100644 src/convoy/models/toggle_subscription_status_response_400.py create mode 100644 src/convoy/models/toggle_subscription_status_response_401.py create mode 100644 src/convoy/models/toggle_subscription_status_response_404.py create mode 100644 src/convoy/models/update_endpoint_response_202.py create mode 100644 src/convoy/models/update_endpoint_response_400.py create mode 100644 src/convoy/models/update_endpoint_response_401.py create mode 100644 src/convoy/models/update_endpoint_response_404.py create mode 100644 src/convoy/models/update_event_type_response_201.py create mode 100644 src/convoy/models/update_event_type_response_400.py create mode 100644 src/convoy/models/update_event_type_response_401.py create mode 100644 src/convoy/models/update_event_type_response_404.py create mode 100644 src/convoy/models/update_filter_response_200.py create mode 100644 src/convoy/models/update_filter_response_400.py create mode 100644 src/convoy/models/update_filter_response_401.py create mode 100644 src/convoy/models/update_filter_response_404.py create mode 100644 src/convoy/models/update_portal_link_response_202.py create mode 100644 src/convoy/models/update_portal_link_response_400.py create mode 100644 src/convoy/models/update_portal_link_response_401.py create mode 100644 src/convoy/models/update_portal_link_response_404.py create mode 100644 src/convoy/models/update_project_response_202.py create mode 100644 src/convoy/models/update_project_response_400.py create mode 100644 src/convoy/models/update_project_response_401.py create mode 100644 src/convoy/models/update_project_response_403.py create mode 100644 src/convoy/models/update_project_response_404.py create mode 100644 src/convoy/models/update_source_response_202.py create mode 100644 src/convoy/models/update_source_response_400.py create mode 100644 src/convoy/models/update_source_response_401.py create mode 100644 src/convoy/models/update_source_response_404.py create mode 100644 src/convoy/models/update_subscription_response_202.py create mode 100644 src/convoy/models/update_subscription_response_400.py create mode 100644 src/convoy/models/update_subscription_response_401.py create mode 100644 src/convoy/models/update_subscription_response_404.py create mode 100644 src/convoy/models/util_server_response.py create mode 100644 src/convoy/types.py diff --git a/src/convoy/__init__.py b/src/convoy/__init__.py new file mode 100644 index 0000000..8c95388 --- /dev/null +++ b/src/convoy/__init__.py @@ -0,0 +1,8 @@ +"""A client library for accessing Convoy API Reference""" + +from .client import AuthenticatedClient, Client + +__all__ = ( + "AuthenticatedClient", + "Client", +) diff --git a/src/convoy/api/__init__.py b/src/convoy/api/__init__.py new file mode 100644 index 0000000..81f9fa2 --- /dev/null +++ b/src/convoy/api/__init__.py @@ -0,0 +1 @@ +"""Contains methods for accessing the API""" diff --git a/src/convoy/api/delivery_attempts/__init__.py b/src/convoy/api/delivery_attempts/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/convoy/api/delivery_attempts/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/convoy/api/delivery_attempts/get_delivery_attempt.py b/src/convoy/api/delivery_attempts/get_delivery_attempt.py new file mode 100644 index 0000000..795c559 --- /dev/null +++ b/src/convoy/api/delivery_attempts/get_delivery_attempt.py @@ -0,0 +1,242 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_delivery_attempt_response_200 import GetDeliveryAttemptResponse200 +from ...models.get_delivery_attempt_response_400 import GetDeliveryAttemptResponse400 +from ...models.get_delivery_attempt_response_401 import GetDeliveryAttemptResponse401 +from ...models.get_delivery_attempt_response_404 import GetDeliveryAttemptResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + event_delivery_id: str, + delivery_attempt_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/eventdeliveries/{event_delivery_id}/deliveryattempts/{delivery_attempt_id}".format( + project_id=quote(str(project_id), safe=""), + event_delivery_id=quote(str(event_delivery_id), safe=""), + delivery_attempt_id=quote(str(delivery_attempt_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetDeliveryAttemptResponse200 + | GetDeliveryAttemptResponse400 + | GetDeliveryAttemptResponse401 + | GetDeliveryAttemptResponse404 + | None +): + if response.status_code == 200: + response_200 = GetDeliveryAttemptResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetDeliveryAttemptResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetDeliveryAttemptResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetDeliveryAttemptResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetDeliveryAttemptResponse200 + | GetDeliveryAttemptResponse400 + | GetDeliveryAttemptResponse401 + | GetDeliveryAttemptResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + event_delivery_id: str, + delivery_attempt_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetDeliveryAttemptResponse200 + | GetDeliveryAttemptResponse400 + | GetDeliveryAttemptResponse401 + | GetDeliveryAttemptResponse404 +]: + """Retrieve a delivery attempt + + This endpoint fetches an app event delivery attempt + + Args: + project_id (str): + event_delivery_id (str): + delivery_attempt_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetDeliveryAttemptResponse200 | GetDeliveryAttemptResponse400 | GetDeliveryAttemptResponse401 | GetDeliveryAttemptResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_delivery_id=event_delivery_id, + delivery_attempt_id=delivery_attempt_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + event_delivery_id: str, + delivery_attempt_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetDeliveryAttemptResponse200 + | GetDeliveryAttemptResponse400 + | GetDeliveryAttemptResponse401 + | GetDeliveryAttemptResponse404 + | None +): + """Retrieve a delivery attempt + + This endpoint fetches an app event delivery attempt + + Args: + project_id (str): + event_delivery_id (str): + delivery_attempt_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetDeliveryAttemptResponse200 | GetDeliveryAttemptResponse400 | GetDeliveryAttemptResponse401 | GetDeliveryAttemptResponse404 + """ + + return sync_detailed( + project_id=project_id, + event_delivery_id=event_delivery_id, + delivery_attempt_id=delivery_attempt_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + event_delivery_id: str, + delivery_attempt_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetDeliveryAttemptResponse200 + | GetDeliveryAttemptResponse400 + | GetDeliveryAttemptResponse401 + | GetDeliveryAttemptResponse404 +]: + """Retrieve a delivery attempt + + This endpoint fetches an app event delivery attempt + + Args: + project_id (str): + event_delivery_id (str): + delivery_attempt_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetDeliveryAttemptResponse200 | GetDeliveryAttemptResponse400 | GetDeliveryAttemptResponse401 | GetDeliveryAttemptResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_delivery_id=event_delivery_id, + delivery_attempt_id=delivery_attempt_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + event_delivery_id: str, + delivery_attempt_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetDeliveryAttemptResponse200 + | GetDeliveryAttemptResponse400 + | GetDeliveryAttemptResponse401 + | GetDeliveryAttemptResponse404 + | None +): + """Retrieve a delivery attempt + + This endpoint fetches an app event delivery attempt + + Args: + project_id (str): + event_delivery_id (str): + delivery_attempt_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetDeliveryAttemptResponse200 | GetDeliveryAttemptResponse400 | GetDeliveryAttemptResponse401 | GetDeliveryAttemptResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + event_delivery_id=event_delivery_id, + delivery_attempt_id=delivery_attempt_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/delivery_attempts/get_delivery_attempts.py b/src/convoy/api/delivery_attempts/get_delivery_attempts.py new file mode 100644 index 0000000..833179b --- /dev/null +++ b/src/convoy/api/delivery_attempts/get_delivery_attempts.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_delivery_attempts_response_200 import GetDeliveryAttemptsResponse200 +from ...models.get_delivery_attempts_response_400 import GetDeliveryAttemptsResponse400 +from ...models.get_delivery_attempts_response_401 import GetDeliveryAttemptsResponse401 +from ...models.get_delivery_attempts_response_404 import GetDeliveryAttemptsResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + event_delivery_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/eventdeliveries/{event_delivery_id}/deliveryattempts".format( + project_id=quote(str(project_id), safe=""), + event_delivery_id=quote(str(event_delivery_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetDeliveryAttemptsResponse200 + | GetDeliveryAttemptsResponse400 + | GetDeliveryAttemptsResponse401 + | GetDeliveryAttemptsResponse404 + | None +): + if response.status_code == 200: + response_200 = GetDeliveryAttemptsResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetDeliveryAttemptsResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetDeliveryAttemptsResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetDeliveryAttemptsResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetDeliveryAttemptsResponse200 + | GetDeliveryAttemptsResponse400 + | GetDeliveryAttemptsResponse401 + | GetDeliveryAttemptsResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + event_delivery_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetDeliveryAttemptsResponse200 + | GetDeliveryAttemptsResponse400 + | GetDeliveryAttemptsResponse401 + | GetDeliveryAttemptsResponse404 +]: + """List delivery attempts + + This endpoint fetches an app message's delivery attempts + + Args: + project_id (str): + event_delivery_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetDeliveryAttemptsResponse200 | GetDeliveryAttemptsResponse400 | GetDeliveryAttemptsResponse401 | GetDeliveryAttemptsResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_delivery_id=event_delivery_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + event_delivery_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetDeliveryAttemptsResponse200 + | GetDeliveryAttemptsResponse400 + | GetDeliveryAttemptsResponse401 + | GetDeliveryAttemptsResponse404 + | None +): + """List delivery attempts + + This endpoint fetches an app message's delivery attempts + + Args: + project_id (str): + event_delivery_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetDeliveryAttemptsResponse200 | GetDeliveryAttemptsResponse400 | GetDeliveryAttemptsResponse401 | GetDeliveryAttemptsResponse404 + """ + + return sync_detailed( + project_id=project_id, + event_delivery_id=event_delivery_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + event_delivery_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetDeliveryAttemptsResponse200 + | GetDeliveryAttemptsResponse400 + | GetDeliveryAttemptsResponse401 + | GetDeliveryAttemptsResponse404 +]: + """List delivery attempts + + This endpoint fetches an app message's delivery attempts + + Args: + project_id (str): + event_delivery_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetDeliveryAttemptsResponse200 | GetDeliveryAttemptsResponse400 | GetDeliveryAttemptsResponse401 | GetDeliveryAttemptsResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_delivery_id=event_delivery_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + event_delivery_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetDeliveryAttemptsResponse200 + | GetDeliveryAttemptsResponse400 + | GetDeliveryAttemptsResponse401 + | GetDeliveryAttemptsResponse404 + | None +): + """List delivery attempts + + This endpoint fetches an app message's delivery attempts + + Args: + project_id (str): + event_delivery_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetDeliveryAttemptsResponse200 | GetDeliveryAttemptsResponse400 | GetDeliveryAttemptsResponse401 | GetDeliveryAttemptsResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + event_delivery_id=event_delivery_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/endpoints/__init__.py b/src/convoy/api/endpoints/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/convoy/api/endpoints/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/convoy/api/endpoints/activate_endpoint.py b/src/convoy/api/endpoints/activate_endpoint.py new file mode 100644 index 0000000..816bb43 --- /dev/null +++ b/src/convoy/api/endpoints/activate_endpoint.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.activate_endpoint_response_202 import ActivateEndpointResponse202 +from ...models.activate_endpoint_response_400 import ActivateEndpointResponse400 +from ...models.activate_endpoint_response_401 import ActivateEndpointResponse401 +from ...models.activate_endpoint_response_404 import ActivateEndpointResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + endpoint_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/endpoints/{endpoint_id}/activate".format( + project_id=quote(str(project_id), safe=""), + endpoint_id=quote(str(endpoint_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + ActivateEndpointResponse202 + | ActivateEndpointResponse400 + | ActivateEndpointResponse401 + | ActivateEndpointResponse404 + | None +): + if response.status_code == 202: + response_202 = ActivateEndpointResponse202.from_dict(response.json()) + + return response_202 + + if response.status_code == 400: + response_400 = ActivateEndpointResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ActivateEndpointResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = ActivateEndpointResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + ActivateEndpointResponse202 + | ActivateEndpointResponse400 + | ActivateEndpointResponse401 + | ActivateEndpointResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + ActivateEndpointResponse202 + | ActivateEndpointResponse400 + | ActivateEndpointResponse401 + | ActivateEndpointResponse404 +]: + """Activate endpoint + + Activated an inactive endpoint + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ActivateEndpointResponse202 | ActivateEndpointResponse400 | ActivateEndpointResponse401 | ActivateEndpointResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + endpoint_id=endpoint_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> ( + ActivateEndpointResponse202 + | ActivateEndpointResponse400 + | ActivateEndpointResponse401 + | ActivateEndpointResponse404 + | None +): + """Activate endpoint + + Activated an inactive endpoint + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ActivateEndpointResponse202 | ActivateEndpointResponse400 | ActivateEndpointResponse401 | ActivateEndpointResponse404 + """ + + return sync_detailed( + project_id=project_id, + endpoint_id=endpoint_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + ActivateEndpointResponse202 + | ActivateEndpointResponse400 + | ActivateEndpointResponse401 + | ActivateEndpointResponse404 +]: + """Activate endpoint + + Activated an inactive endpoint + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ActivateEndpointResponse202 | ActivateEndpointResponse400 | ActivateEndpointResponse401 | ActivateEndpointResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + endpoint_id=endpoint_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> ( + ActivateEndpointResponse202 + | ActivateEndpointResponse400 + | ActivateEndpointResponse401 + | ActivateEndpointResponse404 + | None +): + """Activate endpoint + + Activated an inactive endpoint + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ActivateEndpointResponse202 | ActivateEndpointResponse400 | ActivateEndpointResponse401 | ActivateEndpointResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + endpoint_id=endpoint_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/endpoints/create_endpoint.py b/src/convoy/api/endpoints/create_endpoint.py new file mode 100644 index 0000000..b72de20 --- /dev/null +++ b/src/convoy/api/endpoints/create_endpoint.py @@ -0,0 +1,235 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_endpoint_response_201 import CreateEndpointResponse201 +from ...models.create_endpoint_response_400 import CreateEndpointResponse400 +from ...models.create_endpoint_response_401 import CreateEndpointResponse401 +from ...models.create_endpoint_response_404 import CreateEndpointResponse404 +from ...models.models_create_endpoint import ModelsCreateEndpoint +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsCreateEndpoint, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/endpoints".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + CreateEndpointResponse201 + | CreateEndpointResponse400 + | CreateEndpointResponse401 + | CreateEndpointResponse404 + | None +): + if response.status_code == 201: + response_201 = CreateEndpointResponse201.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = CreateEndpointResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = CreateEndpointResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = CreateEndpointResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + CreateEndpointResponse201 + | CreateEndpointResponse400 + | CreateEndpointResponse401 + | CreateEndpointResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateEndpoint, +) -> Response[ + CreateEndpointResponse201 + | CreateEndpointResponse400 + | CreateEndpointResponse401 + | CreateEndpointResponse404 +]: + """Create an endpoint + + This endpoint creates an endpoint + + Args: + project_id (str): + body (ModelsCreateEndpoint): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateEndpointResponse201 | CreateEndpointResponse400 | CreateEndpointResponse401 | CreateEndpointResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateEndpoint, +) -> ( + CreateEndpointResponse201 + | CreateEndpointResponse400 + | CreateEndpointResponse401 + | CreateEndpointResponse404 + | None +): + """Create an endpoint + + This endpoint creates an endpoint + + Args: + project_id (str): + body (ModelsCreateEndpoint): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateEndpointResponse201 | CreateEndpointResponse400 | CreateEndpointResponse401 | CreateEndpointResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateEndpoint, +) -> Response[ + CreateEndpointResponse201 + | CreateEndpointResponse400 + | CreateEndpointResponse401 + | CreateEndpointResponse404 +]: + """Create an endpoint + + This endpoint creates an endpoint + + Args: + project_id (str): + body (ModelsCreateEndpoint): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateEndpointResponse201 | CreateEndpointResponse400 | CreateEndpointResponse401 | CreateEndpointResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateEndpoint, +) -> ( + CreateEndpointResponse201 + | CreateEndpointResponse400 + | CreateEndpointResponse401 + | CreateEndpointResponse404 + | None +): + """Create an endpoint + + This endpoint creates an endpoint + + Args: + project_id (str): + body (ModelsCreateEndpoint): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateEndpointResponse201 | CreateEndpointResponse400 | CreateEndpointResponse401 | CreateEndpointResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/endpoints/delete_endpoint.py b/src/convoy/api/endpoints/delete_endpoint.py new file mode 100644 index 0000000..736b091 --- /dev/null +++ b/src/convoy/api/endpoints/delete_endpoint.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.delete_endpoint_response_200 import DeleteEndpointResponse200 +from ...models.delete_endpoint_response_400 import DeleteEndpointResponse400 +from ...models.delete_endpoint_response_401 import DeleteEndpointResponse401 +from ...models.delete_endpoint_response_404 import DeleteEndpointResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + endpoint_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v1/projects/{project_id}/endpoints/{endpoint_id}".format( + project_id=quote(str(project_id), safe=""), + endpoint_id=quote(str(endpoint_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + DeleteEndpointResponse200 + | DeleteEndpointResponse400 + | DeleteEndpointResponse401 + | DeleteEndpointResponse404 + | None +): + if response.status_code == 200: + response_200 = DeleteEndpointResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = DeleteEndpointResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = DeleteEndpointResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = DeleteEndpointResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + DeleteEndpointResponse200 + | DeleteEndpointResponse400 + | DeleteEndpointResponse401 + | DeleteEndpointResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + DeleteEndpointResponse200 + | DeleteEndpointResponse400 + | DeleteEndpointResponse401 + | DeleteEndpointResponse404 +]: + """Delete endpoint + + This endpoint deletes an endpoint + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteEndpointResponse200 | DeleteEndpointResponse400 | DeleteEndpointResponse401 | DeleteEndpointResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + endpoint_id=endpoint_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> ( + DeleteEndpointResponse200 + | DeleteEndpointResponse400 + | DeleteEndpointResponse401 + | DeleteEndpointResponse404 + | None +): + """Delete endpoint + + This endpoint deletes an endpoint + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteEndpointResponse200 | DeleteEndpointResponse400 | DeleteEndpointResponse401 | DeleteEndpointResponse404 + """ + + return sync_detailed( + project_id=project_id, + endpoint_id=endpoint_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + DeleteEndpointResponse200 + | DeleteEndpointResponse400 + | DeleteEndpointResponse401 + | DeleteEndpointResponse404 +]: + """Delete endpoint + + This endpoint deletes an endpoint + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteEndpointResponse200 | DeleteEndpointResponse400 | DeleteEndpointResponse401 | DeleteEndpointResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + endpoint_id=endpoint_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> ( + DeleteEndpointResponse200 + | DeleteEndpointResponse400 + | DeleteEndpointResponse401 + | DeleteEndpointResponse404 + | None +): + """Delete endpoint + + This endpoint deletes an endpoint + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteEndpointResponse200 | DeleteEndpointResponse400 | DeleteEndpointResponse401 | DeleteEndpointResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + endpoint_id=endpoint_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/endpoints/expire_secret.py b/src/convoy/api/endpoints/expire_secret.py new file mode 100644 index 0000000..2ea4bf3 --- /dev/null +++ b/src/convoy/api/endpoints/expire_secret.py @@ -0,0 +1,249 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.expire_secret_response_200 import ExpireSecretResponse200 +from ...models.expire_secret_response_400 import ExpireSecretResponse400 +from ...models.expire_secret_response_401 import ExpireSecretResponse401 +from ...models.expire_secret_response_404 import ExpireSecretResponse404 +from ...models.models_expire_secret import ModelsExpireSecret +from ...types import Response + + +def _get_kwargs( + project_id: str, + endpoint_id: str, + *, + body: ModelsExpireSecret, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/endpoints/{endpoint_id}/expire_secret".format( + project_id=quote(str(project_id), safe=""), + endpoint_id=quote(str(endpoint_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + ExpireSecretResponse200 + | ExpireSecretResponse400 + | ExpireSecretResponse401 + | ExpireSecretResponse404 + | None +): + if response.status_code == 200: + response_200 = ExpireSecretResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ExpireSecretResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ExpireSecretResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = ExpireSecretResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + ExpireSecretResponse200 + | ExpireSecretResponse400 + | ExpireSecretResponse401 + | ExpireSecretResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, + body: ModelsExpireSecret, +) -> Response[ + ExpireSecretResponse200 + | ExpireSecretResponse400 + | ExpireSecretResponse401 + | ExpireSecretResponse404 +]: + """Roll endpoint secret + + This endpoint expires and re-generates the endpoint secret. + + Args: + project_id (str): + endpoint_id (str): + body (ModelsExpireSecret): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExpireSecretResponse200 | ExpireSecretResponse400 | ExpireSecretResponse401 | ExpireSecretResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + endpoint_id=endpoint_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, + body: ModelsExpireSecret, +) -> ( + ExpireSecretResponse200 + | ExpireSecretResponse400 + | ExpireSecretResponse401 + | ExpireSecretResponse404 + | None +): + """Roll endpoint secret + + This endpoint expires and re-generates the endpoint secret. + + Args: + project_id (str): + endpoint_id (str): + body (ModelsExpireSecret): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExpireSecretResponse200 | ExpireSecretResponse400 | ExpireSecretResponse401 | ExpireSecretResponse404 + """ + + return sync_detailed( + project_id=project_id, + endpoint_id=endpoint_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, + body: ModelsExpireSecret, +) -> Response[ + ExpireSecretResponse200 + | ExpireSecretResponse400 + | ExpireSecretResponse401 + | ExpireSecretResponse404 +]: + """Roll endpoint secret + + This endpoint expires and re-generates the endpoint secret. + + Args: + project_id (str): + endpoint_id (str): + body (ModelsExpireSecret): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ExpireSecretResponse200 | ExpireSecretResponse400 | ExpireSecretResponse401 | ExpireSecretResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + endpoint_id=endpoint_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, + body: ModelsExpireSecret, +) -> ( + ExpireSecretResponse200 + | ExpireSecretResponse400 + | ExpireSecretResponse401 + | ExpireSecretResponse404 + | None +): + """Roll endpoint secret + + This endpoint expires and re-generates the endpoint secret. + + Args: + project_id (str): + endpoint_id (str): + body (ModelsExpireSecret): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ExpireSecretResponse200 | ExpireSecretResponse400 | ExpireSecretResponse401 | ExpireSecretResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + endpoint_id=endpoint_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/endpoints/get_endpoint.py b/src/convoy/api/endpoints/get_endpoint.py new file mode 100644 index 0000000..5dfcc40 --- /dev/null +++ b/src/convoy/api/endpoints/get_endpoint.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_endpoint_response_200 import GetEndpointResponse200 +from ...models.get_endpoint_response_400 import GetEndpointResponse400 +from ...models.get_endpoint_response_401 import GetEndpointResponse401 +from ...models.get_endpoint_response_404 import GetEndpointResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + endpoint_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/endpoints/{endpoint_id}".format( + project_id=quote(str(project_id), safe=""), + endpoint_id=quote(str(endpoint_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetEndpointResponse200 + | GetEndpointResponse400 + | GetEndpointResponse401 + | GetEndpointResponse404 + | None +): + if response.status_code == 200: + response_200 = GetEndpointResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetEndpointResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetEndpointResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetEndpointResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetEndpointResponse200 + | GetEndpointResponse400 + | GetEndpointResponse401 + | GetEndpointResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetEndpointResponse200 + | GetEndpointResponse400 + | GetEndpointResponse401 + | GetEndpointResponse404 +]: + """Retrieve endpoint + + This endpoint fetches an endpoint + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEndpointResponse200 | GetEndpointResponse400 | GetEndpointResponse401 | GetEndpointResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + endpoint_id=endpoint_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetEndpointResponse200 + | GetEndpointResponse400 + | GetEndpointResponse401 + | GetEndpointResponse404 + | None +): + """Retrieve endpoint + + This endpoint fetches an endpoint + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEndpointResponse200 | GetEndpointResponse400 | GetEndpointResponse401 | GetEndpointResponse404 + """ + + return sync_detailed( + project_id=project_id, + endpoint_id=endpoint_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetEndpointResponse200 + | GetEndpointResponse400 + | GetEndpointResponse401 + | GetEndpointResponse404 +]: + """Retrieve endpoint + + This endpoint fetches an endpoint + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEndpointResponse200 | GetEndpointResponse400 | GetEndpointResponse401 | GetEndpointResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + endpoint_id=endpoint_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetEndpointResponse200 + | GetEndpointResponse400 + | GetEndpointResponse401 + | GetEndpointResponse404 + | None +): + """Retrieve endpoint + + This endpoint fetches an endpoint + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEndpointResponse200 | GetEndpointResponse400 | GetEndpointResponse401 | GetEndpointResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + endpoint_id=endpoint_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/endpoints/get_endpoints.py b/src/convoy/api/endpoints/get_endpoints.py new file mode 100644 index 0000000..3aee598 --- /dev/null +++ b/src/convoy/api/endpoints/get_endpoints.py @@ -0,0 +1,330 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_endpoints_direction import GetEndpointsDirection +from ...models.get_endpoints_response_200 import GetEndpointsResponse200 +from ...models.get_endpoints_response_400 import GetEndpointsResponse400 +from ...models.get_endpoints_response_401 import GetEndpointsResponse401 +from ...models.get_endpoints_response_404 import GetEndpointsResponse404 +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + project_id: str, + *, + direction: GetEndpointsDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + owner_id: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + q: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_direction: str | Unset = UNSET + if not isinstance(direction, Unset): + json_direction = direction.value + + params["direction"] = json_direction + + params["next_page_cursor"] = next_page_cursor + + params["ownerId"] = owner_id + + params["perPage"] = per_page + + params["prev_page_cursor"] = prev_page_cursor + + params["q"] = q + + params["sort"] = sort + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/endpoints".format( + project_id=quote(str(project_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetEndpointsResponse200 + | GetEndpointsResponse400 + | GetEndpointsResponse401 + | GetEndpointsResponse404 + | None +): + if response.status_code == 200: + response_200 = GetEndpointsResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetEndpointsResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetEndpointsResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetEndpointsResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetEndpointsResponse200 + | GetEndpointsResponse400 + | GetEndpointsResponse401 + | GetEndpointsResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetEndpointsDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + owner_id: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + q: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> Response[ + GetEndpointsResponse200 + | GetEndpointsResponse400 + | GetEndpointsResponse401 + | GetEndpointsResponse404 +]: + """List all endpoints + + This endpoint fetches an endpoints + + Args: + project_id (str): + direction (GetEndpointsDirection | Unset): + next_page_cursor (str | Unset): + owner_id (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + q (str | Unset): + sort (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEndpointsResponse200 | GetEndpointsResponse400 | GetEndpointsResponse401 | GetEndpointsResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + next_page_cursor=next_page_cursor, + owner_id=owner_id, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + q=q, + sort=sort, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetEndpointsDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + owner_id: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + q: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> ( + GetEndpointsResponse200 + | GetEndpointsResponse400 + | GetEndpointsResponse401 + | GetEndpointsResponse404 + | None +): + """List all endpoints + + This endpoint fetches an endpoints + + Args: + project_id (str): + direction (GetEndpointsDirection | Unset): + next_page_cursor (str | Unset): + owner_id (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + q (str | Unset): + sort (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEndpointsResponse200 | GetEndpointsResponse400 | GetEndpointsResponse401 | GetEndpointsResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + direction=direction, + next_page_cursor=next_page_cursor, + owner_id=owner_id, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + q=q, + sort=sort, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetEndpointsDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + owner_id: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + q: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> Response[ + GetEndpointsResponse200 + | GetEndpointsResponse400 + | GetEndpointsResponse401 + | GetEndpointsResponse404 +]: + """List all endpoints + + This endpoint fetches an endpoints + + Args: + project_id (str): + direction (GetEndpointsDirection | Unset): + next_page_cursor (str | Unset): + owner_id (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + q (str | Unset): + sort (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEndpointsResponse200 | GetEndpointsResponse400 | GetEndpointsResponse401 | GetEndpointsResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + next_page_cursor=next_page_cursor, + owner_id=owner_id, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + q=q, + sort=sort, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetEndpointsDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + owner_id: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + q: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> ( + GetEndpointsResponse200 + | GetEndpointsResponse400 + | GetEndpointsResponse401 + | GetEndpointsResponse404 + | None +): + """List all endpoints + + This endpoint fetches an endpoints + + Args: + project_id (str): + direction (GetEndpointsDirection | Unset): + next_page_cursor (str | Unset): + owner_id (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + q (str | Unset): + sort (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEndpointsResponse200 | GetEndpointsResponse400 | GetEndpointsResponse401 | GetEndpointsResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + direction=direction, + next_page_cursor=next_page_cursor, + owner_id=owner_id, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + q=q, + sort=sort, + ) + ).parsed diff --git a/src/convoy/api/endpoints/pause_endpoint.py b/src/convoy/api/endpoints/pause_endpoint.py new file mode 100644 index 0000000..ab5c0fa --- /dev/null +++ b/src/convoy/api/endpoints/pause_endpoint.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.pause_endpoint_response_202 import PauseEndpointResponse202 +from ...models.pause_endpoint_response_400 import PauseEndpointResponse400 +from ...models.pause_endpoint_response_401 import PauseEndpointResponse401 +from ...models.pause_endpoint_response_404 import PauseEndpointResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + endpoint_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/endpoints/{endpoint_id}/pause".format( + project_id=quote(str(project_id), safe=""), + endpoint_id=quote(str(endpoint_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + PauseEndpointResponse202 + | PauseEndpointResponse400 + | PauseEndpointResponse401 + | PauseEndpointResponse404 + | None +): + if response.status_code == 202: + response_202 = PauseEndpointResponse202.from_dict(response.json()) + + return response_202 + + if response.status_code == 400: + response_400 = PauseEndpointResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = PauseEndpointResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = PauseEndpointResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + PauseEndpointResponse202 + | PauseEndpointResponse400 + | PauseEndpointResponse401 + | PauseEndpointResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + PauseEndpointResponse202 + | PauseEndpointResponse400 + | PauseEndpointResponse401 + | PauseEndpointResponse404 +]: + """Pause endpoint + + Toggles an endpoint's status between active and paused states + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PauseEndpointResponse202 | PauseEndpointResponse400 | PauseEndpointResponse401 | PauseEndpointResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + endpoint_id=endpoint_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> ( + PauseEndpointResponse202 + | PauseEndpointResponse400 + | PauseEndpointResponse401 + | PauseEndpointResponse404 + | None +): + """Pause endpoint + + Toggles an endpoint's status between active and paused states + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PauseEndpointResponse202 | PauseEndpointResponse400 | PauseEndpointResponse401 | PauseEndpointResponse404 + """ + + return sync_detailed( + project_id=project_id, + endpoint_id=endpoint_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + PauseEndpointResponse202 + | PauseEndpointResponse400 + | PauseEndpointResponse401 + | PauseEndpointResponse404 +]: + """Pause endpoint + + Toggles an endpoint's status between active and paused states + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PauseEndpointResponse202 | PauseEndpointResponse400 | PauseEndpointResponse401 | PauseEndpointResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + endpoint_id=endpoint_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, +) -> ( + PauseEndpointResponse202 + | PauseEndpointResponse400 + | PauseEndpointResponse401 + | PauseEndpointResponse404 + | None +): + """Pause endpoint + + Toggles an endpoint's status between active and paused states + + Args: + project_id (str): + endpoint_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PauseEndpointResponse202 | PauseEndpointResponse400 | PauseEndpointResponse401 | PauseEndpointResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + endpoint_id=endpoint_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/endpoints/test_o_auth_2_connection.py b/src/convoy/api/endpoints/test_o_auth_2_connection.py new file mode 100644 index 0000000..08307b8 --- /dev/null +++ b/src/convoy/api/endpoints/test_o_auth_2_connection.py @@ -0,0 +1,243 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.models_test_o_auth_2_request import ModelsTestOAuth2Request +from ...models.test_o_auth_2_connection_response_200 import ( + TestOAuth2ConnectionResponse200, +) +from ...models.test_o_auth_2_connection_response_400 import ( + TestOAuth2ConnectionResponse400, +) +from ...models.test_o_auth_2_connection_response_401 import ( + TestOAuth2ConnectionResponse401, +) +from ...models.test_o_auth_2_connection_response_404 import ( + TestOAuth2ConnectionResponse404, +) +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsTestOAuth2Request, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/endpoints/oauth2/test".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + TestOAuth2ConnectionResponse200 + | TestOAuth2ConnectionResponse400 + | TestOAuth2ConnectionResponse401 + | TestOAuth2ConnectionResponse404 + | None +): + if response.status_code == 200: + response_200 = TestOAuth2ConnectionResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = TestOAuth2ConnectionResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = TestOAuth2ConnectionResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = TestOAuth2ConnectionResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + TestOAuth2ConnectionResponse200 + | TestOAuth2ConnectionResponse400 + | TestOAuth2ConnectionResponse401 + | TestOAuth2ConnectionResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsTestOAuth2Request, +) -> Response[ + TestOAuth2ConnectionResponse200 + | TestOAuth2ConnectionResponse400 + | TestOAuth2ConnectionResponse401 + | TestOAuth2ConnectionResponse404 +]: + """Test OAuth2 connection + + This endpoint tests the OAuth2 connection by attempting to exchange a token + + Args: + project_id (str): + body (ModelsTestOAuth2Request): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TestOAuth2ConnectionResponse200 | TestOAuth2ConnectionResponse400 | TestOAuth2ConnectionResponse401 | TestOAuth2ConnectionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsTestOAuth2Request, +) -> ( + TestOAuth2ConnectionResponse200 + | TestOAuth2ConnectionResponse400 + | TestOAuth2ConnectionResponse401 + | TestOAuth2ConnectionResponse404 + | None +): + """Test OAuth2 connection + + This endpoint tests the OAuth2 connection by attempting to exchange a token + + Args: + project_id (str): + body (ModelsTestOAuth2Request): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TestOAuth2ConnectionResponse200 | TestOAuth2ConnectionResponse400 | TestOAuth2ConnectionResponse401 | TestOAuth2ConnectionResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsTestOAuth2Request, +) -> Response[ + TestOAuth2ConnectionResponse200 + | TestOAuth2ConnectionResponse400 + | TestOAuth2ConnectionResponse401 + | TestOAuth2ConnectionResponse404 +]: + """Test OAuth2 connection + + This endpoint tests the OAuth2 connection by attempting to exchange a token + + Args: + project_id (str): + body (ModelsTestOAuth2Request): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TestOAuth2ConnectionResponse200 | TestOAuth2ConnectionResponse400 | TestOAuth2ConnectionResponse401 | TestOAuth2ConnectionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsTestOAuth2Request, +) -> ( + TestOAuth2ConnectionResponse200 + | TestOAuth2ConnectionResponse400 + | TestOAuth2ConnectionResponse401 + | TestOAuth2ConnectionResponse404 + | None +): + """Test OAuth2 connection + + This endpoint tests the OAuth2 connection by attempting to exchange a token + + Args: + project_id (str): + body (ModelsTestOAuth2Request): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TestOAuth2ConnectionResponse200 | TestOAuth2ConnectionResponse400 | TestOAuth2ConnectionResponse401 | TestOAuth2ConnectionResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/endpoints/update_endpoint.py b/src/convoy/api/endpoints/update_endpoint.py new file mode 100644 index 0000000..4c31d51 --- /dev/null +++ b/src/convoy/api/endpoints/update_endpoint.py @@ -0,0 +1,249 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.models_update_endpoint import ModelsUpdateEndpoint +from ...models.update_endpoint_response_202 import UpdateEndpointResponse202 +from ...models.update_endpoint_response_400 import UpdateEndpointResponse400 +from ...models.update_endpoint_response_401 import UpdateEndpointResponse401 +from ...models.update_endpoint_response_404 import UpdateEndpointResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + endpoint_id: str, + *, + body: ModelsUpdateEndpoint, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/endpoints/{endpoint_id}".format( + project_id=quote(str(project_id), safe=""), + endpoint_id=quote(str(endpoint_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + UpdateEndpointResponse202 + | UpdateEndpointResponse400 + | UpdateEndpointResponse401 + | UpdateEndpointResponse404 + | None +): + if response.status_code == 202: + response_202 = UpdateEndpointResponse202.from_dict(response.json()) + + return response_202 + + if response.status_code == 400: + response_400 = UpdateEndpointResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = UpdateEndpointResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = UpdateEndpointResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + UpdateEndpointResponse202 + | UpdateEndpointResponse400 + | UpdateEndpointResponse401 + | UpdateEndpointResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateEndpoint, +) -> Response[ + UpdateEndpointResponse202 + | UpdateEndpointResponse400 + | UpdateEndpointResponse401 + | UpdateEndpointResponse404 +]: + """Update an endpoint + + This endpoint updates an endpoint + + Args: + project_id (str): + endpoint_id (str): + body (ModelsUpdateEndpoint): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdateEndpointResponse202 | UpdateEndpointResponse400 | UpdateEndpointResponse401 | UpdateEndpointResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + endpoint_id=endpoint_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateEndpoint, +) -> ( + UpdateEndpointResponse202 + | UpdateEndpointResponse400 + | UpdateEndpointResponse401 + | UpdateEndpointResponse404 + | None +): + """Update an endpoint + + This endpoint updates an endpoint + + Args: + project_id (str): + endpoint_id (str): + body (ModelsUpdateEndpoint): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdateEndpointResponse202 | UpdateEndpointResponse400 | UpdateEndpointResponse401 | UpdateEndpointResponse404 + """ + + return sync_detailed( + project_id=project_id, + endpoint_id=endpoint_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateEndpoint, +) -> Response[ + UpdateEndpointResponse202 + | UpdateEndpointResponse400 + | UpdateEndpointResponse401 + | UpdateEndpointResponse404 +]: + """Update an endpoint + + This endpoint updates an endpoint + + Args: + project_id (str): + endpoint_id (str): + body (ModelsUpdateEndpoint): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdateEndpointResponse202 | UpdateEndpointResponse400 | UpdateEndpointResponse401 | UpdateEndpointResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + endpoint_id=endpoint_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + endpoint_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateEndpoint, +) -> ( + UpdateEndpointResponse202 + | UpdateEndpointResponse400 + | UpdateEndpointResponse401 + | UpdateEndpointResponse404 + | None +): + """Update an endpoint + + This endpoint updates an endpoint + + Args: + project_id (str): + endpoint_id (str): + body (ModelsUpdateEndpoint): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdateEndpointResponse202 | UpdateEndpointResponse400 | UpdateEndpointResponse401 | UpdateEndpointResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + endpoint_id=endpoint_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/event_deliveries/__init__.py b/src/convoy/api/event_deliveries/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/convoy/api/event_deliveries/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/convoy/api/event_deliveries/batch_retry_event_delivery.py b/src/convoy/api/event_deliveries/batch_retry_event_delivery.py new file mode 100644 index 0000000..4f71738 --- /dev/null +++ b/src/convoy/api/event_deliveries/batch_retry_event_delivery.py @@ -0,0 +1,438 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.batch_retry_event_delivery_direction import ( + BatchRetryEventDeliveryDirection, +) +from ...models.batch_retry_event_delivery_response_200 import ( + BatchRetryEventDeliveryResponse200, +) +from ...models.batch_retry_event_delivery_response_400 import ( + BatchRetryEventDeliveryResponse400, +) +from ...models.batch_retry_event_delivery_response_401 import ( + BatchRetryEventDeliveryResponse401, +) +from ...models.batch_retry_event_delivery_response_404 import ( + BatchRetryEventDeliveryResponse404, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + project_id: str, + *, + direction: BatchRetryEventDeliveryDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + event_id: str | Unset = UNSET, + event_type: str | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, + status: list[str] | Unset = UNSET, + subscription_id: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_direction: str | Unset = UNSET + if not isinstance(direction, Unset): + json_direction = direction.value + + params["direction"] = json_direction + + params["endDate"] = end_date + + json_endpoint_id: list[str] | Unset = UNSET + if not isinstance(endpoint_id, Unset): + json_endpoint_id = endpoint_id + + params["endpointId"] = json_endpoint_id + + params["eventId"] = event_id + + params["event_type"] = event_type + + params["idempotencyKey"] = idempotency_key + + params["next_page_cursor"] = next_page_cursor + + params["perPage"] = per_page + + params["prev_page_cursor"] = prev_page_cursor + + params["sort"] = sort + + params["startDate"] = start_date + + json_status: list[str] | Unset = UNSET + if not isinstance(status, Unset): + json_status = status + + params["status"] = json_status + + params["subscriptionId"] = subscription_id + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/eventdeliveries/batchretry".format( + project_id=quote(str(project_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + BatchRetryEventDeliveryResponse200 + | BatchRetryEventDeliveryResponse400 + | BatchRetryEventDeliveryResponse401 + | BatchRetryEventDeliveryResponse404 + | None +): + if response.status_code == 200: + response_200 = BatchRetryEventDeliveryResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = BatchRetryEventDeliveryResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = BatchRetryEventDeliveryResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = BatchRetryEventDeliveryResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + BatchRetryEventDeliveryResponse200 + | BatchRetryEventDeliveryResponse400 + | BatchRetryEventDeliveryResponse401 + | BatchRetryEventDeliveryResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: BatchRetryEventDeliveryDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + event_id: str | Unset = UNSET, + event_type: str | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, + status: list[str] | Unset = UNSET, + subscription_id: str | Unset = UNSET, +) -> Response[ + BatchRetryEventDeliveryResponse200 + | BatchRetryEventDeliveryResponse400 + | BatchRetryEventDeliveryResponse401 + | BatchRetryEventDeliveryResponse404 +]: + """Batch retry event delivery + + This endpoint batch retries multiple event deliveries at once. + + Args: + project_id (str): + direction (BatchRetryEventDeliveryDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + event_id (str | Unset): + event_type (str | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + start_date (str | Unset): + status (list[str] | Unset): + subscription_id (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BatchRetryEventDeliveryResponse200 | BatchRetryEventDeliveryResponse400 | BatchRetryEventDeliveryResponse401 | BatchRetryEventDeliveryResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + event_id=event_id, + event_type=event_type, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + start_date=start_date, + status=status, + subscription_id=subscription_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + direction: BatchRetryEventDeliveryDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + event_id: str | Unset = UNSET, + event_type: str | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, + status: list[str] | Unset = UNSET, + subscription_id: str | Unset = UNSET, +) -> ( + BatchRetryEventDeliveryResponse200 + | BatchRetryEventDeliveryResponse400 + | BatchRetryEventDeliveryResponse401 + | BatchRetryEventDeliveryResponse404 + | None +): + """Batch retry event delivery + + This endpoint batch retries multiple event deliveries at once. + + Args: + project_id (str): + direction (BatchRetryEventDeliveryDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + event_id (str | Unset): + event_type (str | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + start_date (str | Unset): + status (list[str] | Unset): + subscription_id (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BatchRetryEventDeliveryResponse200 | BatchRetryEventDeliveryResponse400 | BatchRetryEventDeliveryResponse401 | BatchRetryEventDeliveryResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + event_id=event_id, + event_type=event_type, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + start_date=start_date, + status=status, + subscription_id=subscription_id, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: BatchRetryEventDeliveryDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + event_id: str | Unset = UNSET, + event_type: str | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, + status: list[str] | Unset = UNSET, + subscription_id: str | Unset = UNSET, +) -> Response[ + BatchRetryEventDeliveryResponse200 + | BatchRetryEventDeliveryResponse400 + | BatchRetryEventDeliveryResponse401 + | BatchRetryEventDeliveryResponse404 +]: + """Batch retry event delivery + + This endpoint batch retries multiple event deliveries at once. + + Args: + project_id (str): + direction (BatchRetryEventDeliveryDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + event_id (str | Unset): + event_type (str | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + start_date (str | Unset): + status (list[str] | Unset): + subscription_id (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BatchRetryEventDeliveryResponse200 | BatchRetryEventDeliveryResponse400 | BatchRetryEventDeliveryResponse401 | BatchRetryEventDeliveryResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + event_id=event_id, + event_type=event_type, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + start_date=start_date, + status=status, + subscription_id=subscription_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + direction: BatchRetryEventDeliveryDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + event_id: str | Unset = UNSET, + event_type: str | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, + status: list[str] | Unset = UNSET, + subscription_id: str | Unset = UNSET, +) -> ( + BatchRetryEventDeliveryResponse200 + | BatchRetryEventDeliveryResponse400 + | BatchRetryEventDeliveryResponse401 + | BatchRetryEventDeliveryResponse404 + | None +): + """Batch retry event delivery + + This endpoint batch retries multiple event deliveries at once. + + Args: + project_id (str): + direction (BatchRetryEventDeliveryDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + event_id (str | Unset): + event_type (str | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + start_date (str | Unset): + status (list[str] | Unset): + subscription_id (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BatchRetryEventDeliveryResponse200 | BatchRetryEventDeliveryResponse400 | BatchRetryEventDeliveryResponse401 | BatchRetryEventDeliveryResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + event_id=event_id, + event_type=event_type, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + start_date=start_date, + status=status, + subscription_id=subscription_id, + ) + ).parsed diff --git a/src/convoy/api/event_deliveries/force_resend_event_deliveries.py b/src/convoy/api/event_deliveries/force_resend_event_deliveries.py new file mode 100644 index 0000000..0249cbe --- /dev/null +++ b/src/convoy/api/event_deliveries/force_resend_event_deliveries.py @@ -0,0 +1,243 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.force_resend_event_deliveries_response_200 import ( + ForceResendEventDeliveriesResponse200, +) +from ...models.force_resend_event_deliveries_response_400 import ( + ForceResendEventDeliveriesResponse400, +) +from ...models.force_resend_event_deliveries_response_401 import ( + ForceResendEventDeliveriesResponse401, +) +from ...models.force_resend_event_deliveries_response_404 import ( + ForceResendEventDeliveriesResponse404, +) +from ...models.models_i_ds import ModelsIDs +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsIDs, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/eventdeliveries/forceresend".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + ForceResendEventDeliveriesResponse200 + | ForceResendEventDeliveriesResponse400 + | ForceResendEventDeliveriesResponse401 + | ForceResendEventDeliveriesResponse404 + | None +): + if response.status_code == 200: + response_200 = ForceResendEventDeliveriesResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ForceResendEventDeliveriesResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ForceResendEventDeliveriesResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = ForceResendEventDeliveriesResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + ForceResendEventDeliveriesResponse200 + | ForceResendEventDeliveriesResponse400 + | ForceResendEventDeliveriesResponse401 + | ForceResendEventDeliveriesResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsIDs, +) -> Response[ + ForceResendEventDeliveriesResponse200 + | ForceResendEventDeliveriesResponse400 + | ForceResendEventDeliveriesResponse401 + | ForceResendEventDeliveriesResponse404 +]: + """Force retry event delivery + + This endpoint enables you retry a previously successful event delivery + + Args: + project_id (str): + body (ModelsIDs): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ForceResendEventDeliveriesResponse200 | ForceResendEventDeliveriesResponse400 | ForceResendEventDeliveriesResponse401 | ForceResendEventDeliveriesResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsIDs, +) -> ( + ForceResendEventDeliveriesResponse200 + | ForceResendEventDeliveriesResponse400 + | ForceResendEventDeliveriesResponse401 + | ForceResendEventDeliveriesResponse404 + | None +): + """Force retry event delivery + + This endpoint enables you retry a previously successful event delivery + + Args: + project_id (str): + body (ModelsIDs): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ForceResendEventDeliveriesResponse200 | ForceResendEventDeliveriesResponse400 | ForceResendEventDeliveriesResponse401 | ForceResendEventDeliveriesResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsIDs, +) -> Response[ + ForceResendEventDeliveriesResponse200 + | ForceResendEventDeliveriesResponse400 + | ForceResendEventDeliveriesResponse401 + | ForceResendEventDeliveriesResponse404 +]: + """Force retry event delivery + + This endpoint enables you retry a previously successful event delivery + + Args: + project_id (str): + body (ModelsIDs): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ForceResendEventDeliveriesResponse200 | ForceResendEventDeliveriesResponse400 | ForceResendEventDeliveriesResponse401 | ForceResendEventDeliveriesResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsIDs, +) -> ( + ForceResendEventDeliveriesResponse200 + | ForceResendEventDeliveriesResponse400 + | ForceResendEventDeliveriesResponse401 + | ForceResendEventDeliveriesResponse404 + | None +): + """Force retry event delivery + + This endpoint enables you retry a previously successful event delivery + + Args: + project_id (str): + body (ModelsIDs): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ForceResendEventDeliveriesResponse200 | ForceResendEventDeliveriesResponse400 | ForceResendEventDeliveriesResponse401 | ForceResendEventDeliveriesResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/event_deliveries/get_event_deliveries_paged.py b/src/convoy/api/event_deliveries/get_event_deliveries_paged.py new file mode 100644 index 0000000..12991dc --- /dev/null +++ b/src/convoy/api/event_deliveries/get_event_deliveries_paged.py @@ -0,0 +1,438 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_event_deliveries_paged_direction import ( + GetEventDeliveriesPagedDirection, +) +from ...models.get_event_deliveries_paged_response_200 import ( + GetEventDeliveriesPagedResponse200, +) +from ...models.get_event_deliveries_paged_response_400 import ( + GetEventDeliveriesPagedResponse400, +) +from ...models.get_event_deliveries_paged_response_401 import ( + GetEventDeliveriesPagedResponse401, +) +from ...models.get_event_deliveries_paged_response_404 import ( + GetEventDeliveriesPagedResponse404, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + project_id: str, + *, + direction: GetEventDeliveriesPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + event_id: str | Unset = UNSET, + event_type: str | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, + status: list[str] | Unset = UNSET, + subscription_id: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_direction: str | Unset = UNSET + if not isinstance(direction, Unset): + json_direction = direction.value + + params["direction"] = json_direction + + params["endDate"] = end_date + + json_endpoint_id: list[str] | Unset = UNSET + if not isinstance(endpoint_id, Unset): + json_endpoint_id = endpoint_id + + params["endpointId"] = json_endpoint_id + + params["eventId"] = event_id + + params["event_type"] = event_type + + params["idempotencyKey"] = idempotency_key + + params["next_page_cursor"] = next_page_cursor + + params["perPage"] = per_page + + params["prev_page_cursor"] = prev_page_cursor + + params["sort"] = sort + + params["startDate"] = start_date + + json_status: list[str] | Unset = UNSET + if not isinstance(status, Unset): + json_status = status + + params["status"] = json_status + + params["subscriptionId"] = subscription_id + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/eventdeliveries".format( + project_id=quote(str(project_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetEventDeliveriesPagedResponse200 + | GetEventDeliveriesPagedResponse400 + | GetEventDeliveriesPagedResponse401 + | GetEventDeliveriesPagedResponse404 + | None +): + if response.status_code == 200: + response_200 = GetEventDeliveriesPagedResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetEventDeliveriesPagedResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetEventDeliveriesPagedResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetEventDeliveriesPagedResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetEventDeliveriesPagedResponse200 + | GetEventDeliveriesPagedResponse400 + | GetEventDeliveriesPagedResponse401 + | GetEventDeliveriesPagedResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetEventDeliveriesPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + event_id: str | Unset = UNSET, + event_type: str | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, + status: list[str] | Unset = UNSET, + subscription_id: str | Unset = UNSET, +) -> Response[ + GetEventDeliveriesPagedResponse200 + | GetEventDeliveriesPagedResponse400 + | GetEventDeliveriesPagedResponse401 + | GetEventDeliveriesPagedResponse404 +]: + """List all event deliveries + + This endpoint retrieves all event deliveries paginated. + + Args: + project_id (str): + direction (GetEventDeliveriesPagedDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + event_id (str | Unset): + event_type (str | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + start_date (str | Unset): + status (list[str] | Unset): + subscription_id (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEventDeliveriesPagedResponse200 | GetEventDeliveriesPagedResponse400 | GetEventDeliveriesPagedResponse401 | GetEventDeliveriesPagedResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + event_id=event_id, + event_type=event_type, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + start_date=start_date, + status=status, + subscription_id=subscription_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetEventDeliveriesPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + event_id: str | Unset = UNSET, + event_type: str | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, + status: list[str] | Unset = UNSET, + subscription_id: str | Unset = UNSET, +) -> ( + GetEventDeliveriesPagedResponse200 + | GetEventDeliveriesPagedResponse400 + | GetEventDeliveriesPagedResponse401 + | GetEventDeliveriesPagedResponse404 + | None +): + """List all event deliveries + + This endpoint retrieves all event deliveries paginated. + + Args: + project_id (str): + direction (GetEventDeliveriesPagedDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + event_id (str | Unset): + event_type (str | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + start_date (str | Unset): + status (list[str] | Unset): + subscription_id (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEventDeliveriesPagedResponse200 | GetEventDeliveriesPagedResponse400 | GetEventDeliveriesPagedResponse401 | GetEventDeliveriesPagedResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + event_id=event_id, + event_type=event_type, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + start_date=start_date, + status=status, + subscription_id=subscription_id, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetEventDeliveriesPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + event_id: str | Unset = UNSET, + event_type: str | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, + status: list[str] | Unset = UNSET, + subscription_id: str | Unset = UNSET, +) -> Response[ + GetEventDeliveriesPagedResponse200 + | GetEventDeliveriesPagedResponse400 + | GetEventDeliveriesPagedResponse401 + | GetEventDeliveriesPagedResponse404 +]: + """List all event deliveries + + This endpoint retrieves all event deliveries paginated. + + Args: + project_id (str): + direction (GetEventDeliveriesPagedDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + event_id (str | Unset): + event_type (str | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + start_date (str | Unset): + status (list[str] | Unset): + subscription_id (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEventDeliveriesPagedResponse200 | GetEventDeliveriesPagedResponse400 | GetEventDeliveriesPagedResponse401 | GetEventDeliveriesPagedResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + event_id=event_id, + event_type=event_type, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + start_date=start_date, + status=status, + subscription_id=subscription_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetEventDeliveriesPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + event_id: str | Unset = UNSET, + event_type: str | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, + status: list[str] | Unset = UNSET, + subscription_id: str | Unset = UNSET, +) -> ( + GetEventDeliveriesPagedResponse200 + | GetEventDeliveriesPagedResponse400 + | GetEventDeliveriesPagedResponse401 + | GetEventDeliveriesPagedResponse404 + | None +): + """List all event deliveries + + This endpoint retrieves all event deliveries paginated. + + Args: + project_id (str): + direction (GetEventDeliveriesPagedDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + event_id (str | Unset): + event_type (str | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + start_date (str | Unset): + status (list[str] | Unset): + subscription_id (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEventDeliveriesPagedResponse200 | GetEventDeliveriesPagedResponse400 | GetEventDeliveriesPagedResponse401 | GetEventDeliveriesPagedResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + event_id=event_id, + event_type=event_type, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + start_date=start_date, + status=status, + subscription_id=subscription_id, + ) + ).parsed diff --git a/src/convoy/api/event_deliveries/get_event_delivery.py b/src/convoy/api/event_deliveries/get_event_delivery.py new file mode 100644 index 0000000..55eeddd --- /dev/null +++ b/src/convoy/api/event_deliveries/get_event_delivery.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_event_delivery_response_200 import GetEventDeliveryResponse200 +from ...models.get_event_delivery_response_400 import GetEventDeliveryResponse400 +from ...models.get_event_delivery_response_401 import GetEventDeliveryResponse401 +from ...models.get_event_delivery_response_404 import GetEventDeliveryResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + event_delivery_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/eventdeliveries/{event_delivery_id}".format( + project_id=quote(str(project_id), safe=""), + event_delivery_id=quote(str(event_delivery_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetEventDeliveryResponse200 + | GetEventDeliveryResponse400 + | GetEventDeliveryResponse401 + | GetEventDeliveryResponse404 + | None +): + if response.status_code == 200: + response_200 = GetEventDeliveryResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetEventDeliveryResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetEventDeliveryResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetEventDeliveryResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetEventDeliveryResponse200 + | GetEventDeliveryResponse400 + | GetEventDeliveryResponse401 + | GetEventDeliveryResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + event_delivery_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetEventDeliveryResponse200 + | GetEventDeliveryResponse400 + | GetEventDeliveryResponse401 + | GetEventDeliveryResponse404 +]: + """Retrieve an event delivery + + This endpoint fetches an event delivery. + + Args: + project_id (str): + event_delivery_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEventDeliveryResponse200 | GetEventDeliveryResponse400 | GetEventDeliveryResponse401 | GetEventDeliveryResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_delivery_id=event_delivery_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + event_delivery_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetEventDeliveryResponse200 + | GetEventDeliveryResponse400 + | GetEventDeliveryResponse401 + | GetEventDeliveryResponse404 + | None +): + """Retrieve an event delivery + + This endpoint fetches an event delivery. + + Args: + project_id (str): + event_delivery_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEventDeliveryResponse200 | GetEventDeliveryResponse400 | GetEventDeliveryResponse401 | GetEventDeliveryResponse404 + """ + + return sync_detailed( + project_id=project_id, + event_delivery_id=event_delivery_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + event_delivery_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetEventDeliveryResponse200 + | GetEventDeliveryResponse400 + | GetEventDeliveryResponse401 + | GetEventDeliveryResponse404 +]: + """Retrieve an event delivery + + This endpoint fetches an event delivery. + + Args: + project_id (str): + event_delivery_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEventDeliveryResponse200 | GetEventDeliveryResponse400 | GetEventDeliveryResponse401 | GetEventDeliveryResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_delivery_id=event_delivery_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + event_delivery_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetEventDeliveryResponse200 + | GetEventDeliveryResponse400 + | GetEventDeliveryResponse401 + | GetEventDeliveryResponse404 + | None +): + """Retrieve an event delivery + + This endpoint fetches an event delivery. + + Args: + project_id (str): + event_delivery_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEventDeliveryResponse200 | GetEventDeliveryResponse400 | GetEventDeliveryResponse401 | GetEventDeliveryResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + event_delivery_id=event_delivery_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/event_deliveries/resend_event_delivery.py b/src/convoy/api/event_deliveries/resend_event_delivery.py new file mode 100644 index 0000000..006344d --- /dev/null +++ b/src/convoy/api/event_deliveries/resend_event_delivery.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.resend_event_delivery_response_200 import ResendEventDeliveryResponse200 +from ...models.resend_event_delivery_response_400 import ResendEventDeliveryResponse400 +from ...models.resend_event_delivery_response_401 import ResendEventDeliveryResponse401 +from ...models.resend_event_delivery_response_404 import ResendEventDeliveryResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + event_delivery_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/eventdeliveries/{event_delivery_id}/resend".format( + project_id=quote(str(project_id), safe=""), + event_delivery_id=quote(str(event_delivery_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + ResendEventDeliveryResponse200 + | ResendEventDeliveryResponse400 + | ResendEventDeliveryResponse401 + | ResendEventDeliveryResponse404 + | None +): + if response.status_code == 200: + response_200 = ResendEventDeliveryResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ResendEventDeliveryResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ResendEventDeliveryResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = ResendEventDeliveryResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + ResendEventDeliveryResponse200 + | ResendEventDeliveryResponse400 + | ResendEventDeliveryResponse401 + | ResendEventDeliveryResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + event_delivery_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + ResendEventDeliveryResponse200 + | ResendEventDeliveryResponse400 + | ResendEventDeliveryResponse401 + | ResendEventDeliveryResponse404 +]: + """Retry event delivery + + This endpoint retries an event delivery. + + Args: + project_id (str): + event_delivery_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ResendEventDeliveryResponse200 | ResendEventDeliveryResponse400 | ResendEventDeliveryResponse401 | ResendEventDeliveryResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_delivery_id=event_delivery_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + event_delivery_id: str, + *, + client: AuthenticatedClient, +) -> ( + ResendEventDeliveryResponse200 + | ResendEventDeliveryResponse400 + | ResendEventDeliveryResponse401 + | ResendEventDeliveryResponse404 + | None +): + """Retry event delivery + + This endpoint retries an event delivery. + + Args: + project_id (str): + event_delivery_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ResendEventDeliveryResponse200 | ResendEventDeliveryResponse400 | ResendEventDeliveryResponse401 | ResendEventDeliveryResponse404 + """ + + return sync_detailed( + project_id=project_id, + event_delivery_id=event_delivery_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + event_delivery_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + ResendEventDeliveryResponse200 + | ResendEventDeliveryResponse400 + | ResendEventDeliveryResponse401 + | ResendEventDeliveryResponse404 +]: + """Retry event delivery + + This endpoint retries an event delivery. + + Args: + project_id (str): + event_delivery_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ResendEventDeliveryResponse200 | ResendEventDeliveryResponse400 | ResendEventDeliveryResponse401 | ResendEventDeliveryResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_delivery_id=event_delivery_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + event_delivery_id: str, + *, + client: AuthenticatedClient, +) -> ( + ResendEventDeliveryResponse200 + | ResendEventDeliveryResponse400 + | ResendEventDeliveryResponse401 + | ResendEventDeliveryResponse404 + | None +): + """Retry event delivery + + This endpoint retries an event delivery. + + Args: + project_id (str): + event_delivery_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ResendEventDeliveryResponse200 | ResendEventDeliveryResponse400 | ResendEventDeliveryResponse401 | ResendEventDeliveryResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + event_delivery_id=event_delivery_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/event_types/__init__.py b/src/convoy/api/event_types/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/convoy/api/event_types/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/convoy/api/event_types/create_event_type.py b/src/convoy/api/event_types/create_event_type.py new file mode 100644 index 0000000..bf30fbe --- /dev/null +++ b/src/convoy/api/event_types/create_event_type.py @@ -0,0 +1,235 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_event_type_response_201 import CreateEventTypeResponse201 +from ...models.create_event_type_response_400 import CreateEventTypeResponse400 +from ...models.create_event_type_response_401 import CreateEventTypeResponse401 +from ...models.create_event_type_response_404 import CreateEventTypeResponse404 +from ...models.models_create_event_type import ModelsCreateEventType +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsCreateEventType, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/event-types".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + CreateEventTypeResponse201 + | CreateEventTypeResponse400 + | CreateEventTypeResponse401 + | CreateEventTypeResponse404 + | None +): + if response.status_code == 201: + response_201 = CreateEventTypeResponse201.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = CreateEventTypeResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = CreateEventTypeResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = CreateEventTypeResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + CreateEventTypeResponse201 + | CreateEventTypeResponse400 + | CreateEventTypeResponse401 + | CreateEventTypeResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateEventType, +) -> Response[ + CreateEventTypeResponse201 + | CreateEventTypeResponse400 + | CreateEventTypeResponse401 + | CreateEventTypeResponse404 +]: + """Create an event type + + This endpoint creates an event type + + Args: + project_id (str): + body (ModelsCreateEventType): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateEventTypeResponse201 | CreateEventTypeResponse400 | CreateEventTypeResponse401 | CreateEventTypeResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateEventType, +) -> ( + CreateEventTypeResponse201 + | CreateEventTypeResponse400 + | CreateEventTypeResponse401 + | CreateEventTypeResponse404 + | None +): + """Create an event type + + This endpoint creates an event type + + Args: + project_id (str): + body (ModelsCreateEventType): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateEventTypeResponse201 | CreateEventTypeResponse400 | CreateEventTypeResponse401 | CreateEventTypeResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateEventType, +) -> Response[ + CreateEventTypeResponse201 + | CreateEventTypeResponse400 + | CreateEventTypeResponse401 + | CreateEventTypeResponse404 +]: + """Create an event type + + This endpoint creates an event type + + Args: + project_id (str): + body (ModelsCreateEventType): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateEventTypeResponse201 | CreateEventTypeResponse400 | CreateEventTypeResponse401 | CreateEventTypeResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateEventType, +) -> ( + CreateEventTypeResponse201 + | CreateEventTypeResponse400 + | CreateEventTypeResponse401 + | CreateEventTypeResponse404 + | None +): + """Create an event type + + This endpoint creates an event type + + Args: + project_id (str): + body (ModelsCreateEventType): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateEventTypeResponse201 | CreateEventTypeResponse400 | CreateEventTypeResponse401 | CreateEventTypeResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/event_types/deprecate_event_type.py b/src/convoy/api/event_types/deprecate_event_type.py new file mode 100644 index 0000000..0d1c22b --- /dev/null +++ b/src/convoy/api/event_types/deprecate_event_type.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.deprecate_event_type_response_201 import DeprecateEventTypeResponse201 +from ...models.deprecate_event_type_response_400 import DeprecateEventTypeResponse400 +from ...models.deprecate_event_type_response_401 import DeprecateEventTypeResponse401 +from ...models.deprecate_event_type_response_404 import DeprecateEventTypeResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + event_type_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/event-types/{event_type_id}/deprecate".format( + project_id=quote(str(project_id), safe=""), + event_type_id=quote(str(event_type_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + DeprecateEventTypeResponse201 + | DeprecateEventTypeResponse400 + | DeprecateEventTypeResponse401 + | DeprecateEventTypeResponse404 + | None +): + if response.status_code == 201: + response_201 = DeprecateEventTypeResponse201.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = DeprecateEventTypeResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = DeprecateEventTypeResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = DeprecateEventTypeResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + DeprecateEventTypeResponse201 + | DeprecateEventTypeResponse400 + | DeprecateEventTypeResponse401 + | DeprecateEventTypeResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + event_type_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + DeprecateEventTypeResponse201 + | DeprecateEventTypeResponse400 + | DeprecateEventTypeResponse401 + | DeprecateEventTypeResponse404 +]: + """Deprecates an event type + + This endpoint deprecates an event type + + Args: + project_id (str): + event_type_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeprecateEventTypeResponse201 | DeprecateEventTypeResponse400 | DeprecateEventTypeResponse401 | DeprecateEventTypeResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_type_id=event_type_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + event_type_id: str, + *, + client: AuthenticatedClient, +) -> ( + DeprecateEventTypeResponse201 + | DeprecateEventTypeResponse400 + | DeprecateEventTypeResponse401 + | DeprecateEventTypeResponse404 + | None +): + """Deprecates an event type + + This endpoint deprecates an event type + + Args: + project_id (str): + event_type_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeprecateEventTypeResponse201 | DeprecateEventTypeResponse400 | DeprecateEventTypeResponse401 | DeprecateEventTypeResponse404 + """ + + return sync_detailed( + project_id=project_id, + event_type_id=event_type_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + event_type_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + DeprecateEventTypeResponse201 + | DeprecateEventTypeResponse400 + | DeprecateEventTypeResponse401 + | DeprecateEventTypeResponse404 +]: + """Deprecates an event type + + This endpoint deprecates an event type + + Args: + project_id (str): + event_type_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeprecateEventTypeResponse201 | DeprecateEventTypeResponse400 | DeprecateEventTypeResponse401 | DeprecateEventTypeResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_type_id=event_type_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + event_type_id: str, + *, + client: AuthenticatedClient, +) -> ( + DeprecateEventTypeResponse201 + | DeprecateEventTypeResponse400 + | DeprecateEventTypeResponse401 + | DeprecateEventTypeResponse404 + | None +): + """Deprecates an event type + + This endpoint deprecates an event type + + Args: + project_id (str): + event_type_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeprecateEventTypeResponse201 | DeprecateEventTypeResponse400 | DeprecateEventTypeResponse401 | DeprecateEventTypeResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + event_type_id=event_type_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/event_types/get_event_types.py b/src/convoy/api/event_types/get_event_types.py new file mode 100644 index 0000000..568b20e --- /dev/null +++ b/src/convoy/api/event_types/get_event_types.py @@ -0,0 +1,214 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_event_types_response_200 import GetEventTypesResponse200 +from ...models.get_event_types_response_400 import GetEventTypesResponse400 +from ...models.get_event_types_response_401 import GetEventTypesResponse401 +from ...models.get_event_types_response_404 import GetEventTypesResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/event-types".format( + project_id=quote(str(project_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetEventTypesResponse200 + | GetEventTypesResponse400 + | GetEventTypesResponse401 + | GetEventTypesResponse404 + | None +): + if response.status_code == 200: + response_200 = GetEventTypesResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetEventTypesResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetEventTypesResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetEventTypesResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetEventTypesResponse200 + | GetEventTypesResponse400 + | GetEventTypesResponse401 + | GetEventTypesResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetEventTypesResponse200 + | GetEventTypesResponse400 + | GetEventTypesResponse401 + | GetEventTypesResponse404 +]: + """Retrieves a project's event types + + This endpoint fetches the project's event types + + Args: + project_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEventTypesResponse200 | GetEventTypesResponse400 | GetEventTypesResponse401 | GetEventTypesResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetEventTypesResponse200 + | GetEventTypesResponse400 + | GetEventTypesResponse401 + | GetEventTypesResponse404 + | None +): + """Retrieves a project's event types + + This endpoint fetches the project's event types + + Args: + project_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEventTypesResponse200 | GetEventTypesResponse400 | GetEventTypesResponse401 | GetEventTypesResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetEventTypesResponse200 + | GetEventTypesResponse400 + | GetEventTypesResponse401 + | GetEventTypesResponse404 +]: + """Retrieves a project's event types + + This endpoint fetches the project's event types + + Args: + project_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEventTypesResponse200 | GetEventTypesResponse400 | GetEventTypesResponse401 | GetEventTypesResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetEventTypesResponse200 + | GetEventTypesResponse400 + | GetEventTypesResponse401 + | GetEventTypesResponse404 + | None +): + """Retrieves a project's event types + + This endpoint fetches the project's event types + + Args: + project_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEventTypesResponse200 | GetEventTypesResponse400 | GetEventTypesResponse401 | GetEventTypesResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/event_types/import_open_api_spec.py b/src/convoy/api/event_types/import_open_api_spec.py new file mode 100644 index 0000000..4d0aff1 --- /dev/null +++ b/src/convoy/api/event_types/import_open_api_spec.py @@ -0,0 +1,235 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.import_open_api_spec_response_200 import ImportOpenApiSpecResponse200 +from ...models.import_open_api_spec_response_400 import ImportOpenApiSpecResponse400 +from ...models.import_open_api_spec_response_401 import ImportOpenApiSpecResponse401 +from ...models.import_open_api_spec_response_404 import ImportOpenApiSpecResponse404 +from ...models.models_import_open_api_spec import ModelsImportOpenAPISpec +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsImportOpenAPISpec, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/event-types/import".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + ImportOpenApiSpecResponse200 + | ImportOpenApiSpecResponse400 + | ImportOpenApiSpecResponse401 + | ImportOpenApiSpecResponse404 + | None +): + if response.status_code == 200: + response_200 = ImportOpenApiSpecResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ImportOpenApiSpecResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ImportOpenApiSpecResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = ImportOpenApiSpecResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + ImportOpenApiSpecResponse200 + | ImportOpenApiSpecResponse400 + | ImportOpenApiSpecResponse401 + | ImportOpenApiSpecResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsImportOpenAPISpec, +) -> Response[ + ImportOpenApiSpecResponse200 + | ImportOpenApiSpecResponse400 + | ImportOpenApiSpecResponse401 + | ImportOpenApiSpecResponse404 +]: + """Import event types from OpenAPI spec + + This endpoint imports event types from an OpenAPI specification + + Args: + project_id (str): + body (ModelsImportOpenAPISpec): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ImportOpenApiSpecResponse200 | ImportOpenApiSpecResponse400 | ImportOpenApiSpecResponse401 | ImportOpenApiSpecResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsImportOpenAPISpec, +) -> ( + ImportOpenApiSpecResponse200 + | ImportOpenApiSpecResponse400 + | ImportOpenApiSpecResponse401 + | ImportOpenApiSpecResponse404 + | None +): + """Import event types from OpenAPI spec + + This endpoint imports event types from an OpenAPI specification + + Args: + project_id (str): + body (ModelsImportOpenAPISpec): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ImportOpenApiSpecResponse200 | ImportOpenApiSpecResponse400 | ImportOpenApiSpecResponse401 | ImportOpenApiSpecResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsImportOpenAPISpec, +) -> Response[ + ImportOpenApiSpecResponse200 + | ImportOpenApiSpecResponse400 + | ImportOpenApiSpecResponse401 + | ImportOpenApiSpecResponse404 +]: + """Import event types from OpenAPI spec + + This endpoint imports event types from an OpenAPI specification + + Args: + project_id (str): + body (ModelsImportOpenAPISpec): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ImportOpenApiSpecResponse200 | ImportOpenApiSpecResponse400 | ImportOpenApiSpecResponse401 | ImportOpenApiSpecResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsImportOpenAPISpec, +) -> ( + ImportOpenApiSpecResponse200 + | ImportOpenApiSpecResponse400 + | ImportOpenApiSpecResponse401 + | ImportOpenApiSpecResponse404 + | None +): + """Import event types from OpenAPI spec + + This endpoint imports event types from an OpenAPI specification + + Args: + project_id (str): + body (ModelsImportOpenAPISpec): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ImportOpenApiSpecResponse200 | ImportOpenApiSpecResponse400 | ImportOpenApiSpecResponse401 | ImportOpenApiSpecResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/event_types/update_event_type.py b/src/convoy/api/event_types/update_event_type.py new file mode 100644 index 0000000..84a9216 --- /dev/null +++ b/src/convoy/api/event_types/update_event_type.py @@ -0,0 +1,249 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.models_update_event_type import ModelsUpdateEventType +from ...models.update_event_type_response_201 import UpdateEventTypeResponse201 +from ...models.update_event_type_response_400 import UpdateEventTypeResponse400 +from ...models.update_event_type_response_401 import UpdateEventTypeResponse401 +from ...models.update_event_type_response_404 import UpdateEventTypeResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + event_type_id: str, + *, + body: ModelsUpdateEventType, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/event-types/{event_type_id}".format( + project_id=quote(str(project_id), safe=""), + event_type_id=quote(str(event_type_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + UpdateEventTypeResponse201 + | UpdateEventTypeResponse400 + | UpdateEventTypeResponse401 + | UpdateEventTypeResponse404 + | None +): + if response.status_code == 201: + response_201 = UpdateEventTypeResponse201.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = UpdateEventTypeResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = UpdateEventTypeResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = UpdateEventTypeResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + UpdateEventTypeResponse201 + | UpdateEventTypeResponse400 + | UpdateEventTypeResponse401 + | UpdateEventTypeResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + event_type_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateEventType, +) -> Response[ + UpdateEventTypeResponse201 + | UpdateEventTypeResponse400 + | UpdateEventTypeResponse401 + | UpdateEventTypeResponse404 +]: + """Updates an event type + + This endpoint updates an event type + + Args: + project_id (str): + event_type_id (str): + body (ModelsUpdateEventType): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdateEventTypeResponse201 | UpdateEventTypeResponse400 | UpdateEventTypeResponse401 | UpdateEventTypeResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_type_id=event_type_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + event_type_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateEventType, +) -> ( + UpdateEventTypeResponse201 + | UpdateEventTypeResponse400 + | UpdateEventTypeResponse401 + | UpdateEventTypeResponse404 + | None +): + """Updates an event type + + This endpoint updates an event type + + Args: + project_id (str): + event_type_id (str): + body (ModelsUpdateEventType): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdateEventTypeResponse201 | UpdateEventTypeResponse400 | UpdateEventTypeResponse401 | UpdateEventTypeResponse404 + """ + + return sync_detailed( + project_id=project_id, + event_type_id=event_type_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + event_type_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateEventType, +) -> Response[ + UpdateEventTypeResponse201 + | UpdateEventTypeResponse400 + | UpdateEventTypeResponse401 + | UpdateEventTypeResponse404 +]: + """Updates an event type + + This endpoint updates an event type + + Args: + project_id (str): + event_type_id (str): + body (ModelsUpdateEventType): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdateEventTypeResponse201 | UpdateEventTypeResponse400 | UpdateEventTypeResponse401 | UpdateEventTypeResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_type_id=event_type_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + event_type_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateEventType, +) -> ( + UpdateEventTypeResponse201 + | UpdateEventTypeResponse400 + | UpdateEventTypeResponse401 + | UpdateEventTypeResponse404 + | None +): + """Updates an event type + + This endpoint updates an event type + + Args: + project_id (str): + event_type_id (str): + body (ModelsUpdateEventType): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdateEventTypeResponse201 | UpdateEventTypeResponse400 | UpdateEventTypeResponse401 | UpdateEventTypeResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + event_type_id=event_type_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/events/__init__.py b/src/convoy/api/events/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/convoy/api/events/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/convoy/api/events/batch_replay_events.py b/src/convoy/api/events/batch_replay_events.py new file mode 100644 index 0000000..b20e2ef --- /dev/null +++ b/src/convoy/api/events/batch_replay_events.py @@ -0,0 +1,398 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.batch_replay_events_direction import BatchReplayEventsDirection +from ...models.batch_replay_events_response_200 import BatchReplayEventsResponse200 +from ...models.batch_replay_events_response_400 import BatchReplayEventsResponse400 +from ...models.batch_replay_events_response_401 import BatchReplayEventsResponse401 +from ...models.batch_replay_events_response_404 import BatchReplayEventsResponse404 +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + project_id: str, + *, + direction: BatchReplayEventsDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_direction: str | Unset = UNSET + if not isinstance(direction, Unset): + json_direction = direction.value + + params["direction"] = json_direction + + params["endDate"] = end_date + + json_endpoint_id: list[str] | Unset = UNSET + if not isinstance(endpoint_id, Unset): + json_endpoint_id = endpoint_id + + params["endpointId"] = json_endpoint_id + + params["idempotencyKey"] = idempotency_key + + params["next_page_cursor"] = next_page_cursor + + params["perPage"] = per_page + + params["prev_page_cursor"] = prev_page_cursor + + params["query"] = query + + params["sort"] = sort + + json_source_id: list[str] | Unset = UNSET + if not isinstance(source_id, Unset): + json_source_id = source_id + + params["sourceId"] = json_source_id + + params["startDate"] = start_date + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/events/batchreplay".format( + project_id=quote(str(project_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + BatchReplayEventsResponse200 + | BatchReplayEventsResponse400 + | BatchReplayEventsResponse401 + | BatchReplayEventsResponse404 + | None +): + if response.status_code == 200: + response_200 = BatchReplayEventsResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = BatchReplayEventsResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = BatchReplayEventsResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = BatchReplayEventsResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + BatchReplayEventsResponse200 + | BatchReplayEventsResponse400 + | BatchReplayEventsResponse401 + | BatchReplayEventsResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: BatchReplayEventsDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> Response[ + BatchReplayEventsResponse200 + | BatchReplayEventsResponse400 + | BatchReplayEventsResponse401 + | BatchReplayEventsResponse404 +]: + """Batch replay events + + This endpoint replays multiple events at once. + + Args: + project_id (str): + direction (BatchReplayEventsDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + query (str | Unset): + sort (str | Unset): + source_id (list[str] | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BatchReplayEventsResponse200 | BatchReplayEventsResponse400 | BatchReplayEventsResponse401 | BatchReplayEventsResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + query=query, + sort=sort, + source_id=source_id, + start_date=start_date, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + direction: BatchReplayEventsDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> ( + BatchReplayEventsResponse200 + | BatchReplayEventsResponse400 + | BatchReplayEventsResponse401 + | BatchReplayEventsResponse404 + | None +): + """Batch replay events + + This endpoint replays multiple events at once. + + Args: + project_id (str): + direction (BatchReplayEventsDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + query (str | Unset): + sort (str | Unset): + source_id (list[str] | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BatchReplayEventsResponse200 | BatchReplayEventsResponse400 | BatchReplayEventsResponse401 | BatchReplayEventsResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + query=query, + sort=sort, + source_id=source_id, + start_date=start_date, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: BatchReplayEventsDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> Response[ + BatchReplayEventsResponse200 + | BatchReplayEventsResponse400 + | BatchReplayEventsResponse401 + | BatchReplayEventsResponse404 +]: + """Batch replay events + + This endpoint replays multiple events at once. + + Args: + project_id (str): + direction (BatchReplayEventsDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + query (str | Unset): + sort (str | Unset): + source_id (list[str] | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BatchReplayEventsResponse200 | BatchReplayEventsResponse400 | BatchReplayEventsResponse401 | BatchReplayEventsResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + query=query, + sort=sort, + source_id=source_id, + start_date=start_date, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + direction: BatchReplayEventsDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> ( + BatchReplayEventsResponse200 + | BatchReplayEventsResponse400 + | BatchReplayEventsResponse401 + | BatchReplayEventsResponse404 + | None +): + """Batch replay events + + This endpoint replays multiple events at once. + + Args: + project_id (str): + direction (BatchReplayEventsDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + query (str | Unset): + sort (str | Unset): + source_id (list[str] | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BatchReplayEventsResponse200 | BatchReplayEventsResponse400 | BatchReplayEventsResponse401 | BatchReplayEventsResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + query=query, + sort=sort, + source_id=source_id, + start_date=start_date, + ) + ).parsed diff --git a/src/convoy/api/events/count_affected_events.py b/src/convoy/api/events/count_affected_events.py new file mode 100644 index 0000000..1410684 --- /dev/null +++ b/src/convoy/api/events/count_affected_events.py @@ -0,0 +1,398 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.count_affected_events_direction import CountAffectedEventsDirection +from ...models.count_affected_events_response_200 import CountAffectedEventsResponse200 +from ...models.count_affected_events_response_400 import CountAffectedEventsResponse400 +from ...models.count_affected_events_response_401 import CountAffectedEventsResponse401 +from ...models.count_affected_events_response_404 import CountAffectedEventsResponse404 +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + project_id: str, + *, + direction: CountAffectedEventsDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_direction: str | Unset = UNSET + if not isinstance(direction, Unset): + json_direction = direction.value + + params["direction"] = json_direction + + params["endDate"] = end_date + + json_endpoint_id: list[str] | Unset = UNSET + if not isinstance(endpoint_id, Unset): + json_endpoint_id = endpoint_id + + params["endpointId"] = json_endpoint_id + + params["idempotencyKey"] = idempotency_key + + params["next_page_cursor"] = next_page_cursor + + params["perPage"] = per_page + + params["prev_page_cursor"] = prev_page_cursor + + params["query"] = query + + params["sort"] = sort + + json_source_id: list[str] | Unset = UNSET + if not isinstance(source_id, Unset): + json_source_id = source_id + + params["sourceId"] = json_source_id + + params["startDate"] = start_date + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/events/countbatchreplayevents".format( + project_id=quote(str(project_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + CountAffectedEventsResponse200 + | CountAffectedEventsResponse400 + | CountAffectedEventsResponse401 + | CountAffectedEventsResponse404 + | None +): + if response.status_code == 200: + response_200 = CountAffectedEventsResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = CountAffectedEventsResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = CountAffectedEventsResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = CountAffectedEventsResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + CountAffectedEventsResponse200 + | CountAffectedEventsResponse400 + | CountAffectedEventsResponse401 + | CountAffectedEventsResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: CountAffectedEventsDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> Response[ + CountAffectedEventsResponse200 + | CountAffectedEventsResponse400 + | CountAffectedEventsResponse401 + | CountAffectedEventsResponse404 +]: + """Count events matching batch replay filters + + This endpoint returns how many events would be affected by a batch replay with the given filters. + + Args: + project_id (str): + direction (CountAffectedEventsDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + query (str | Unset): + sort (str | Unset): + source_id (list[str] | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CountAffectedEventsResponse200 | CountAffectedEventsResponse400 | CountAffectedEventsResponse401 | CountAffectedEventsResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + query=query, + sort=sort, + source_id=source_id, + start_date=start_date, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + direction: CountAffectedEventsDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> ( + CountAffectedEventsResponse200 + | CountAffectedEventsResponse400 + | CountAffectedEventsResponse401 + | CountAffectedEventsResponse404 + | None +): + """Count events matching batch replay filters + + This endpoint returns how many events would be affected by a batch replay with the given filters. + + Args: + project_id (str): + direction (CountAffectedEventsDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + query (str | Unset): + sort (str | Unset): + source_id (list[str] | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CountAffectedEventsResponse200 | CountAffectedEventsResponse400 | CountAffectedEventsResponse401 | CountAffectedEventsResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + query=query, + sort=sort, + source_id=source_id, + start_date=start_date, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: CountAffectedEventsDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> Response[ + CountAffectedEventsResponse200 + | CountAffectedEventsResponse400 + | CountAffectedEventsResponse401 + | CountAffectedEventsResponse404 +]: + """Count events matching batch replay filters + + This endpoint returns how many events would be affected by a batch replay with the given filters. + + Args: + project_id (str): + direction (CountAffectedEventsDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + query (str | Unset): + sort (str | Unset): + source_id (list[str] | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CountAffectedEventsResponse200 | CountAffectedEventsResponse400 | CountAffectedEventsResponse401 | CountAffectedEventsResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + query=query, + sort=sort, + source_id=source_id, + start_date=start_date, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + direction: CountAffectedEventsDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> ( + CountAffectedEventsResponse200 + | CountAffectedEventsResponse400 + | CountAffectedEventsResponse401 + | CountAffectedEventsResponse404 + | None +): + """Count events matching batch replay filters + + This endpoint returns how many events would be affected by a batch replay with the given filters. + + Args: + project_id (str): + direction (CountAffectedEventsDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + query (str | Unset): + sort (str | Unset): + source_id (list[str] | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CountAffectedEventsResponse200 | CountAffectedEventsResponse400 | CountAffectedEventsResponse401 | CountAffectedEventsResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + query=query, + sort=sort, + source_id=source_id, + start_date=start_date, + ) + ).parsed diff --git a/src/convoy/api/events/create_broadcast_event.py b/src/convoy/api/events/create_broadcast_event.py new file mode 100644 index 0000000..4453eab --- /dev/null +++ b/src/convoy/api/events/create_broadcast_event.py @@ -0,0 +1,247 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_broadcast_event_response_201 import ( + CreateBroadcastEventResponse201, +) +from ...models.create_broadcast_event_response_400 import ( + CreateBroadcastEventResponse400, +) +from ...models.create_broadcast_event_response_401 import ( + CreateBroadcastEventResponse401, +) +from ...models.create_broadcast_event_response_404 import ( + CreateBroadcastEventResponse404, +) +from ...models.models_broadcast_event import ModelsBroadcastEvent +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsBroadcastEvent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/events/broadcast".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + CreateBroadcastEventResponse201 + | CreateBroadcastEventResponse400 + | CreateBroadcastEventResponse401 + | CreateBroadcastEventResponse404 + | None +): + if response.status_code == 201: + response_201 = CreateBroadcastEventResponse201.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = CreateBroadcastEventResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = CreateBroadcastEventResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = CreateBroadcastEventResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + CreateBroadcastEventResponse201 + | CreateBroadcastEventResponse400 + | CreateBroadcastEventResponse401 + | CreateBroadcastEventResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsBroadcastEvent, +) -> Response[ + CreateBroadcastEventResponse201 + | CreateBroadcastEventResponse400 + | CreateBroadcastEventResponse401 + | CreateBroadcastEventResponse404 +]: + """Create a broadcast event + + This endpoint creates a event that is broadcast to every endpoint whose subscription matches the + given event type. + + Args: + project_id (str): + body (ModelsBroadcastEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateBroadcastEventResponse201 | CreateBroadcastEventResponse400 | CreateBroadcastEventResponse401 | CreateBroadcastEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsBroadcastEvent, +) -> ( + CreateBroadcastEventResponse201 + | CreateBroadcastEventResponse400 + | CreateBroadcastEventResponse401 + | CreateBroadcastEventResponse404 + | None +): + """Create a broadcast event + + This endpoint creates a event that is broadcast to every endpoint whose subscription matches the + given event type. + + Args: + project_id (str): + body (ModelsBroadcastEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateBroadcastEventResponse201 | CreateBroadcastEventResponse400 | CreateBroadcastEventResponse401 | CreateBroadcastEventResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsBroadcastEvent, +) -> Response[ + CreateBroadcastEventResponse201 + | CreateBroadcastEventResponse400 + | CreateBroadcastEventResponse401 + | CreateBroadcastEventResponse404 +]: + """Create a broadcast event + + This endpoint creates a event that is broadcast to every endpoint whose subscription matches the + given event type. + + Args: + project_id (str): + body (ModelsBroadcastEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateBroadcastEventResponse201 | CreateBroadcastEventResponse400 | CreateBroadcastEventResponse401 | CreateBroadcastEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsBroadcastEvent, +) -> ( + CreateBroadcastEventResponse201 + | CreateBroadcastEventResponse400 + | CreateBroadcastEventResponse401 + | CreateBroadcastEventResponse404 + | None +): + """Create a broadcast event + + This endpoint creates a event that is broadcast to every endpoint whose subscription matches the + given event type. + + Args: + project_id (str): + body (ModelsBroadcastEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateBroadcastEventResponse201 | CreateBroadcastEventResponse400 | CreateBroadcastEventResponse401 | CreateBroadcastEventResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/events/create_dynamic_event.py b/src/convoy/api/events/create_dynamic_event.py new file mode 100644 index 0000000..adae2d6 --- /dev/null +++ b/src/convoy/api/events/create_dynamic_event.py @@ -0,0 +1,239 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_dynamic_event_response_400 import CreateDynamicEventResponse400 +from ...models.create_dynamic_event_response_401 import CreateDynamicEventResponse401 +from ...models.create_dynamic_event_response_404 import CreateDynamicEventResponse404 +from ...models.handlers_stub import HandlersStub +from ...models.models_dynamic_event import ModelsDynamicEvent +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsDynamicEvent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/events/dynamic".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + CreateDynamicEventResponse400 + | CreateDynamicEventResponse401 + | CreateDynamicEventResponse404 + | HandlersStub + | None +): + if response.status_code == 201: + response_201 = HandlersStub.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = CreateDynamicEventResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = CreateDynamicEventResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = CreateDynamicEventResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + CreateDynamicEventResponse400 + | CreateDynamicEventResponse401 + | CreateDynamicEventResponse404 + | HandlersStub +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsDynamicEvent, +) -> Response[ + CreateDynamicEventResponse400 + | CreateDynamicEventResponse401 + | CreateDynamicEventResponse404 + | HandlersStub +]: + """Dynamic Events + + This endpoint does not require creating endpoint and subscriptions ahead of time. Instead, you + supply the endpoint and the payload, and Convoy delivers the events + + Args: + project_id (str): + body (ModelsDynamicEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateDynamicEventResponse400 | CreateDynamicEventResponse401 | CreateDynamicEventResponse404 | HandlersStub] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsDynamicEvent, +) -> ( + CreateDynamicEventResponse400 + | CreateDynamicEventResponse401 + | CreateDynamicEventResponse404 + | HandlersStub + | None +): + """Dynamic Events + + This endpoint does not require creating endpoint and subscriptions ahead of time. Instead, you + supply the endpoint and the payload, and Convoy delivers the events + + Args: + project_id (str): + body (ModelsDynamicEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateDynamicEventResponse400 | CreateDynamicEventResponse401 | CreateDynamicEventResponse404 | HandlersStub + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsDynamicEvent, +) -> Response[ + CreateDynamicEventResponse400 + | CreateDynamicEventResponse401 + | CreateDynamicEventResponse404 + | HandlersStub +]: + """Dynamic Events + + This endpoint does not require creating endpoint and subscriptions ahead of time. Instead, you + supply the endpoint and the payload, and Convoy delivers the events + + Args: + project_id (str): + body (ModelsDynamicEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateDynamicEventResponse400 | CreateDynamicEventResponse401 | CreateDynamicEventResponse404 | HandlersStub] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsDynamicEvent, +) -> ( + CreateDynamicEventResponse400 + | CreateDynamicEventResponse401 + | CreateDynamicEventResponse404 + | HandlersStub + | None +): + """Dynamic Events + + This endpoint does not require creating endpoint and subscriptions ahead of time. Instead, you + supply the endpoint and the payload, and Convoy delivers the events + + Args: + project_id (str): + body (ModelsDynamicEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateDynamicEventResponse400 | CreateDynamicEventResponse401 | CreateDynamicEventResponse404 | HandlersStub + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/events/create_endpoint_event.py b/src/convoy/api/events/create_endpoint_event.py new file mode 100644 index 0000000..6ce2ec1 --- /dev/null +++ b/src/convoy/api/events/create_endpoint_event.py @@ -0,0 +1,235 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_endpoint_event_response_201 import CreateEndpointEventResponse201 +from ...models.create_endpoint_event_response_400 import CreateEndpointEventResponse400 +from ...models.create_endpoint_event_response_401 import CreateEndpointEventResponse401 +from ...models.create_endpoint_event_response_404 import CreateEndpointEventResponse404 +from ...models.models_create_event import ModelsCreateEvent +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsCreateEvent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/events".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + CreateEndpointEventResponse201 + | CreateEndpointEventResponse400 + | CreateEndpointEventResponse401 + | CreateEndpointEventResponse404 + | None +): + if response.status_code == 201: + response_201 = CreateEndpointEventResponse201.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = CreateEndpointEventResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = CreateEndpointEventResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = CreateEndpointEventResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + CreateEndpointEventResponse201 + | CreateEndpointEventResponse400 + | CreateEndpointEventResponse401 + | CreateEndpointEventResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateEvent, +) -> Response[ + CreateEndpointEventResponse201 + | CreateEndpointEventResponse400 + | CreateEndpointEventResponse401 + | CreateEndpointEventResponse404 +]: + """Create an event + + This endpoint creates an endpoint event + + Args: + project_id (str): + body (ModelsCreateEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateEndpointEventResponse201 | CreateEndpointEventResponse400 | CreateEndpointEventResponse401 | CreateEndpointEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateEvent, +) -> ( + CreateEndpointEventResponse201 + | CreateEndpointEventResponse400 + | CreateEndpointEventResponse401 + | CreateEndpointEventResponse404 + | None +): + """Create an event + + This endpoint creates an endpoint event + + Args: + project_id (str): + body (ModelsCreateEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateEndpointEventResponse201 | CreateEndpointEventResponse400 | CreateEndpointEventResponse401 | CreateEndpointEventResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateEvent, +) -> Response[ + CreateEndpointEventResponse201 + | CreateEndpointEventResponse400 + | CreateEndpointEventResponse401 + | CreateEndpointEventResponse404 +]: + """Create an event + + This endpoint creates an endpoint event + + Args: + project_id (str): + body (ModelsCreateEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateEndpointEventResponse201 | CreateEndpointEventResponse400 | CreateEndpointEventResponse401 | CreateEndpointEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateEvent, +) -> ( + CreateEndpointEventResponse201 + | CreateEndpointEventResponse400 + | CreateEndpointEventResponse401 + | CreateEndpointEventResponse404 + | None +): + """Create an event + + This endpoint creates an endpoint event + + Args: + project_id (str): + body (ModelsCreateEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateEndpointEventResponse201 | CreateEndpointEventResponse400 | CreateEndpointEventResponse401 | CreateEndpointEventResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/events/create_endpoint_fanout_event.py b/src/convoy/api/events/create_endpoint_fanout_event.py new file mode 100644 index 0000000..ade5e39 --- /dev/null +++ b/src/convoy/api/events/create_endpoint_fanout_event.py @@ -0,0 +1,243 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_endpoint_fanout_event_response_201 import ( + CreateEndpointFanoutEventResponse201, +) +from ...models.create_endpoint_fanout_event_response_400 import ( + CreateEndpointFanoutEventResponse400, +) +from ...models.create_endpoint_fanout_event_response_401 import ( + CreateEndpointFanoutEventResponse401, +) +from ...models.create_endpoint_fanout_event_response_404 import ( + CreateEndpointFanoutEventResponse404, +) +from ...models.models_fanout_event import ModelsFanoutEvent +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsFanoutEvent, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/events/fanout".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + CreateEndpointFanoutEventResponse201 + | CreateEndpointFanoutEventResponse400 + | CreateEndpointFanoutEventResponse401 + | CreateEndpointFanoutEventResponse404 + | None +): + if response.status_code == 201: + response_201 = CreateEndpointFanoutEventResponse201.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = CreateEndpointFanoutEventResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = CreateEndpointFanoutEventResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = CreateEndpointFanoutEventResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + CreateEndpointFanoutEventResponse201 + | CreateEndpointFanoutEventResponse400 + | CreateEndpointFanoutEventResponse401 + | CreateEndpointFanoutEventResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsFanoutEvent, +) -> Response[ + CreateEndpointFanoutEventResponse201 + | CreateEndpointFanoutEventResponse400 + | CreateEndpointFanoutEventResponse401 + | CreateEndpointFanoutEventResponse404 +]: + """Fan out an event + + This endpoint uses the owner_id to fan out an event to multiple endpoints. + + Args: + project_id (str): + body (ModelsFanoutEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateEndpointFanoutEventResponse201 | CreateEndpointFanoutEventResponse400 | CreateEndpointFanoutEventResponse401 | CreateEndpointFanoutEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsFanoutEvent, +) -> ( + CreateEndpointFanoutEventResponse201 + | CreateEndpointFanoutEventResponse400 + | CreateEndpointFanoutEventResponse401 + | CreateEndpointFanoutEventResponse404 + | None +): + """Fan out an event + + This endpoint uses the owner_id to fan out an event to multiple endpoints. + + Args: + project_id (str): + body (ModelsFanoutEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateEndpointFanoutEventResponse201 | CreateEndpointFanoutEventResponse400 | CreateEndpointFanoutEventResponse401 | CreateEndpointFanoutEventResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsFanoutEvent, +) -> Response[ + CreateEndpointFanoutEventResponse201 + | CreateEndpointFanoutEventResponse400 + | CreateEndpointFanoutEventResponse401 + | CreateEndpointFanoutEventResponse404 +]: + """Fan out an event + + This endpoint uses the owner_id to fan out an event to multiple endpoints. + + Args: + project_id (str): + body (ModelsFanoutEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateEndpointFanoutEventResponse201 | CreateEndpointFanoutEventResponse400 | CreateEndpointFanoutEventResponse401 | CreateEndpointFanoutEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsFanoutEvent, +) -> ( + CreateEndpointFanoutEventResponse201 + | CreateEndpointFanoutEventResponse400 + | CreateEndpointFanoutEventResponse401 + | CreateEndpointFanoutEventResponse404 + | None +): + """Fan out an event + + This endpoint uses the owner_id to fan out an event to multiple endpoints. + + Args: + project_id (str): + body (ModelsFanoutEvent): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateEndpointFanoutEventResponse201 | CreateEndpointFanoutEventResponse400 | CreateEndpointFanoutEventResponse401 | CreateEndpointFanoutEventResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/events/get_endpoint_event.py b/src/convoy/api/events/get_endpoint_event.py new file mode 100644 index 0000000..e49cd7c --- /dev/null +++ b/src/convoy/api/events/get_endpoint_event.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_endpoint_event_response_200 import GetEndpointEventResponse200 +from ...models.get_endpoint_event_response_400 import GetEndpointEventResponse400 +from ...models.get_endpoint_event_response_401 import GetEndpointEventResponse401 +from ...models.get_endpoint_event_response_404 import GetEndpointEventResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + event_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/events/{event_id}".format( + project_id=quote(str(project_id), safe=""), + event_id=quote(str(event_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetEndpointEventResponse200 + | GetEndpointEventResponse400 + | GetEndpointEventResponse401 + | GetEndpointEventResponse404 + | None +): + if response.status_code == 200: + response_200 = GetEndpointEventResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetEndpointEventResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetEndpointEventResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetEndpointEventResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetEndpointEventResponse200 + | GetEndpointEventResponse400 + | GetEndpointEventResponse401 + | GetEndpointEventResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + event_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetEndpointEventResponse200 + | GetEndpointEventResponse400 + | GetEndpointEventResponse401 + | GetEndpointEventResponse404 +]: + """Retrieve an event + + This endpoint retrieves an event + + Args: + project_id (str): + event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEndpointEventResponse200 | GetEndpointEventResponse400 | GetEndpointEventResponse401 | GetEndpointEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_id=event_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + event_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetEndpointEventResponse200 + | GetEndpointEventResponse400 + | GetEndpointEventResponse401 + | GetEndpointEventResponse404 + | None +): + """Retrieve an event + + This endpoint retrieves an event + + Args: + project_id (str): + event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEndpointEventResponse200 | GetEndpointEventResponse400 | GetEndpointEventResponse401 | GetEndpointEventResponse404 + """ + + return sync_detailed( + project_id=project_id, + event_id=event_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + event_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetEndpointEventResponse200 + | GetEndpointEventResponse400 + | GetEndpointEventResponse401 + | GetEndpointEventResponse404 +]: + """Retrieve an event + + This endpoint retrieves an event + + Args: + project_id (str): + event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEndpointEventResponse200 | GetEndpointEventResponse400 | GetEndpointEventResponse401 | GetEndpointEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_id=event_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + event_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetEndpointEventResponse200 + | GetEndpointEventResponse400 + | GetEndpointEventResponse401 + | GetEndpointEventResponse404 + | None +): + """Retrieve an event + + This endpoint retrieves an event + + Args: + project_id (str): + event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEndpointEventResponse200 | GetEndpointEventResponse400 | GetEndpointEventResponse401 | GetEndpointEventResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + event_id=event_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/events/get_events_paged.py b/src/convoy/api/events/get_events_paged.py new file mode 100644 index 0000000..82db4f9 --- /dev/null +++ b/src/convoy/api/events/get_events_paged.py @@ -0,0 +1,398 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_events_paged_direction import GetEventsPagedDirection +from ...models.get_events_paged_response_200 import GetEventsPagedResponse200 +from ...models.get_events_paged_response_400 import GetEventsPagedResponse400 +from ...models.get_events_paged_response_401 import GetEventsPagedResponse401 +from ...models.get_events_paged_response_404 import GetEventsPagedResponse404 +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + project_id: str, + *, + direction: GetEventsPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_direction: str | Unset = UNSET + if not isinstance(direction, Unset): + json_direction = direction.value + + params["direction"] = json_direction + + params["endDate"] = end_date + + json_endpoint_id: list[str] | Unset = UNSET + if not isinstance(endpoint_id, Unset): + json_endpoint_id = endpoint_id + + params["endpointId"] = json_endpoint_id + + params["idempotencyKey"] = idempotency_key + + params["next_page_cursor"] = next_page_cursor + + params["perPage"] = per_page + + params["prev_page_cursor"] = prev_page_cursor + + params["query"] = query + + params["sort"] = sort + + json_source_id: list[str] | Unset = UNSET + if not isinstance(source_id, Unset): + json_source_id = source_id + + params["sourceId"] = json_source_id + + params["startDate"] = start_date + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/events".format( + project_id=quote(str(project_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetEventsPagedResponse200 + | GetEventsPagedResponse400 + | GetEventsPagedResponse401 + | GetEventsPagedResponse404 + | None +): + if response.status_code == 200: + response_200 = GetEventsPagedResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetEventsPagedResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetEventsPagedResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetEventsPagedResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetEventsPagedResponse200 + | GetEventsPagedResponse400 + | GetEventsPagedResponse401 + | GetEventsPagedResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetEventsPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> Response[ + GetEventsPagedResponse200 + | GetEventsPagedResponse400 + | GetEventsPagedResponse401 + | GetEventsPagedResponse404 +]: + """List all events + + This endpoint fetches app events with pagination + + Args: + project_id (str): + direction (GetEventsPagedDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + query (str | Unset): + sort (str | Unset): + source_id (list[str] | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 | GetEventsPagedResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + query=query, + sort=sort, + source_id=source_id, + start_date=start_date, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetEventsPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> ( + GetEventsPagedResponse200 + | GetEventsPagedResponse400 + | GetEventsPagedResponse401 + | GetEventsPagedResponse404 + | None +): + """List all events + + This endpoint fetches app events with pagination + + Args: + project_id (str): + direction (GetEventsPagedDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + query (str | Unset): + sort (str | Unset): + source_id (list[str] | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 | GetEventsPagedResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + query=query, + sort=sort, + source_id=source_id, + start_date=start_date, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetEventsPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> Response[ + GetEventsPagedResponse200 + | GetEventsPagedResponse400 + | GetEventsPagedResponse401 + | GetEventsPagedResponse404 +]: + """List all events + + This endpoint fetches app events with pagination + + Args: + project_id (str): + direction (GetEventsPagedDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + query (str | Unset): + sort (str | Unset): + source_id (list[str] | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 | GetEventsPagedResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + query=query, + sort=sort, + source_id=source_id, + start_date=start_date, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetEventsPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + idempotency_key: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + query: str | Unset = UNSET, + sort: str | Unset = UNSET, + source_id: list[str] | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> ( + GetEventsPagedResponse200 + | GetEventsPagedResponse400 + | GetEventsPagedResponse401 + | GetEventsPagedResponse404 + | None +): + """List all events + + This endpoint fetches app events with pagination + + Args: + project_id (str): + direction (GetEventsPagedDirection | Unset): + end_date (str | Unset): + endpoint_id (list[str] | Unset): + idempotency_key (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + query (str | Unset): + sort (str | Unset): + source_id (list[str] | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetEventsPagedResponse200 | GetEventsPagedResponse400 | GetEventsPagedResponse401 | GetEventsPagedResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + direction=direction, + end_date=end_date, + endpoint_id=endpoint_id, + idempotency_key=idempotency_key, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + query=query, + sort=sort, + source_id=source_id, + start_date=start_date, + ) + ).parsed diff --git a/src/convoy/api/events/replay_endpoint_event.py b/src/convoy/api/events/replay_endpoint_event.py new file mode 100644 index 0000000..4d514fe --- /dev/null +++ b/src/convoy/api/events/replay_endpoint_event.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.replay_endpoint_event_response_200 import ReplayEndpointEventResponse200 +from ...models.replay_endpoint_event_response_400 import ReplayEndpointEventResponse400 +from ...models.replay_endpoint_event_response_401 import ReplayEndpointEventResponse401 +from ...models.replay_endpoint_event_response_404 import ReplayEndpointEventResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + event_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/events/{event_id}/replay".format( + project_id=quote(str(project_id), safe=""), + event_id=quote(str(event_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + ReplayEndpointEventResponse200 + | ReplayEndpointEventResponse400 + | ReplayEndpointEventResponse401 + | ReplayEndpointEventResponse404 + | None +): + if response.status_code == 200: + response_200 = ReplayEndpointEventResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ReplayEndpointEventResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ReplayEndpointEventResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = ReplayEndpointEventResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + ReplayEndpointEventResponse200 + | ReplayEndpointEventResponse400 + | ReplayEndpointEventResponse401 + | ReplayEndpointEventResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + event_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + ReplayEndpointEventResponse200 + | ReplayEndpointEventResponse400 + | ReplayEndpointEventResponse401 + | ReplayEndpointEventResponse404 +]: + """Replay event + + This endpoint replays an event afresh assuming it is a new event. + + Args: + project_id (str): + event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ReplayEndpointEventResponse200 | ReplayEndpointEventResponse400 | ReplayEndpointEventResponse401 | ReplayEndpointEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_id=event_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + event_id: str, + *, + client: AuthenticatedClient, +) -> ( + ReplayEndpointEventResponse200 + | ReplayEndpointEventResponse400 + | ReplayEndpointEventResponse401 + | ReplayEndpointEventResponse404 + | None +): + """Replay event + + This endpoint replays an event afresh assuming it is a new event. + + Args: + project_id (str): + event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ReplayEndpointEventResponse200 | ReplayEndpointEventResponse400 | ReplayEndpointEventResponse401 | ReplayEndpointEventResponse404 + """ + + return sync_detailed( + project_id=project_id, + event_id=event_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + event_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + ReplayEndpointEventResponse200 + | ReplayEndpointEventResponse400 + | ReplayEndpointEventResponse401 + | ReplayEndpointEventResponse404 +]: + """Replay event + + This endpoint replays an event afresh assuming it is a new event. + + Args: + project_id (str): + event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ReplayEndpointEventResponse200 | ReplayEndpointEventResponse400 | ReplayEndpointEventResponse401 | ReplayEndpointEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + event_id=event_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + event_id: str, + *, + client: AuthenticatedClient, +) -> ( + ReplayEndpointEventResponse200 + | ReplayEndpointEventResponse400 + | ReplayEndpointEventResponse401 + | ReplayEndpointEventResponse404 + | None +): + """Replay event + + This endpoint replays an event afresh assuming it is a new event. + + Args: + project_id (str): + event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ReplayEndpointEventResponse200 | ReplayEndpointEventResponse400 | ReplayEndpointEventResponse401 | ReplayEndpointEventResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + event_id=event_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/filters/__init__.py b/src/convoy/api/filters/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/convoy/api/filters/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/convoy/api/filters/bulk_create_filters.py b/src/convoy/api/filters/bulk_create_filters.py new file mode 100644 index 0000000..0822c39 --- /dev/null +++ b/src/convoy/api/filters/bulk_create_filters.py @@ -0,0 +1,252 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.bulk_create_filters_response_201 import BulkCreateFiltersResponse201 +from ...models.bulk_create_filters_response_400 import BulkCreateFiltersResponse400 +from ...models.bulk_create_filters_response_401 import BulkCreateFiltersResponse401 +from ...models.bulk_create_filters_response_404 import BulkCreateFiltersResponse404 +from ...models.models_create_filter_request import ModelsCreateFilterRequest +from ...types import Response + + +def _get_kwargs( + project_id: str, + subscription_id: str, + *, + body: list[ModelsCreateFilterRequest], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/subscriptions/{subscription_id}/filters/bulk".format( + project_id=quote(str(project_id), safe=""), + subscription_id=quote(str(subscription_id), safe=""), + ), + } + + _kwargs["json"] = [] + for body_item_data in body: + body_item = body_item_data.to_dict() + _kwargs["json"].append(body_item) + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + BulkCreateFiltersResponse201 + | BulkCreateFiltersResponse400 + | BulkCreateFiltersResponse401 + | BulkCreateFiltersResponse404 + | None +): + if response.status_code == 201: + response_201 = BulkCreateFiltersResponse201.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = BulkCreateFiltersResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = BulkCreateFiltersResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = BulkCreateFiltersResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + BulkCreateFiltersResponse201 + | BulkCreateFiltersResponse400 + | BulkCreateFiltersResponse401 + | BulkCreateFiltersResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: list[ModelsCreateFilterRequest], +) -> Response[ + BulkCreateFiltersResponse201 + | BulkCreateFiltersResponse400 + | BulkCreateFiltersResponse401 + | BulkCreateFiltersResponse404 +]: + """Create multiple subscription filters + + This endpoint creates multiple filters for a subscription + + Args: + project_id (str): + subscription_id (str): + body (list[ModelsCreateFilterRequest]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BulkCreateFiltersResponse201 | BulkCreateFiltersResponse400 | BulkCreateFiltersResponse401 | BulkCreateFiltersResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: list[ModelsCreateFilterRequest], +) -> ( + BulkCreateFiltersResponse201 + | BulkCreateFiltersResponse400 + | BulkCreateFiltersResponse401 + | BulkCreateFiltersResponse404 + | None +): + """Create multiple subscription filters + + This endpoint creates multiple filters for a subscription + + Args: + project_id (str): + subscription_id (str): + body (list[ModelsCreateFilterRequest]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BulkCreateFiltersResponse201 | BulkCreateFiltersResponse400 | BulkCreateFiltersResponse401 | BulkCreateFiltersResponse404 + """ + + return sync_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: list[ModelsCreateFilterRequest], +) -> Response[ + BulkCreateFiltersResponse201 + | BulkCreateFiltersResponse400 + | BulkCreateFiltersResponse401 + | BulkCreateFiltersResponse404 +]: + """Create multiple subscription filters + + This endpoint creates multiple filters for a subscription + + Args: + project_id (str): + subscription_id (str): + body (list[ModelsCreateFilterRequest]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BulkCreateFiltersResponse201 | BulkCreateFiltersResponse400 | BulkCreateFiltersResponse401 | BulkCreateFiltersResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: list[ModelsCreateFilterRequest], +) -> ( + BulkCreateFiltersResponse201 + | BulkCreateFiltersResponse400 + | BulkCreateFiltersResponse401 + | BulkCreateFiltersResponse404 + | None +): + """Create multiple subscription filters + + This endpoint creates multiple filters for a subscription + + Args: + project_id (str): + subscription_id (str): + body (list[ModelsCreateFilterRequest]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BulkCreateFiltersResponse201 | BulkCreateFiltersResponse400 | BulkCreateFiltersResponse401 | BulkCreateFiltersResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/filters/bulk_update_filters.py b/src/convoy/api/filters/bulk_update_filters.py new file mode 100644 index 0000000..ec20e78 --- /dev/null +++ b/src/convoy/api/filters/bulk_update_filters.py @@ -0,0 +1,252 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.bulk_update_filters_response_200 import BulkUpdateFiltersResponse200 +from ...models.bulk_update_filters_response_400 import BulkUpdateFiltersResponse400 +from ...models.bulk_update_filters_response_401 import BulkUpdateFiltersResponse401 +from ...models.bulk_update_filters_response_404 import BulkUpdateFiltersResponse404 +from ...models.models_bulk_update_filter_request import ModelsBulkUpdateFilterRequest +from ...types import Response + + +def _get_kwargs( + project_id: str, + subscription_id: str, + *, + body: list[ModelsBulkUpdateFilterRequest], +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/subscriptions/{subscription_id}/filters/bulk_update".format( + project_id=quote(str(project_id), safe=""), + subscription_id=quote(str(subscription_id), safe=""), + ), + } + + _kwargs["json"] = [] + for body_item_data in body: + body_item = body_item_data.to_dict() + _kwargs["json"].append(body_item) + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + BulkUpdateFiltersResponse200 + | BulkUpdateFiltersResponse400 + | BulkUpdateFiltersResponse401 + | BulkUpdateFiltersResponse404 + | None +): + if response.status_code == 200: + response_200 = BulkUpdateFiltersResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = BulkUpdateFiltersResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = BulkUpdateFiltersResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = BulkUpdateFiltersResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + BulkUpdateFiltersResponse200 + | BulkUpdateFiltersResponse400 + | BulkUpdateFiltersResponse401 + | BulkUpdateFiltersResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: list[ModelsBulkUpdateFilterRequest], +) -> Response[ + BulkUpdateFiltersResponse200 + | BulkUpdateFiltersResponse400 + | BulkUpdateFiltersResponse401 + | BulkUpdateFiltersResponse404 +]: + """Update multiple subscription filters + + This endpoint updates multiple filters for a subscription + + Args: + project_id (str): + subscription_id (str): + body (list[ModelsBulkUpdateFilterRequest]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BulkUpdateFiltersResponse200 | BulkUpdateFiltersResponse400 | BulkUpdateFiltersResponse401 | BulkUpdateFiltersResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: list[ModelsBulkUpdateFilterRequest], +) -> ( + BulkUpdateFiltersResponse200 + | BulkUpdateFiltersResponse400 + | BulkUpdateFiltersResponse401 + | BulkUpdateFiltersResponse404 + | None +): + """Update multiple subscription filters + + This endpoint updates multiple filters for a subscription + + Args: + project_id (str): + subscription_id (str): + body (list[ModelsBulkUpdateFilterRequest]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BulkUpdateFiltersResponse200 | BulkUpdateFiltersResponse400 | BulkUpdateFiltersResponse401 | BulkUpdateFiltersResponse404 + """ + + return sync_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: list[ModelsBulkUpdateFilterRequest], +) -> Response[ + BulkUpdateFiltersResponse200 + | BulkUpdateFiltersResponse400 + | BulkUpdateFiltersResponse401 + | BulkUpdateFiltersResponse404 +]: + """Update multiple subscription filters + + This endpoint updates multiple filters for a subscription + + Args: + project_id (str): + subscription_id (str): + body (list[ModelsBulkUpdateFilterRequest]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BulkUpdateFiltersResponse200 | BulkUpdateFiltersResponse400 | BulkUpdateFiltersResponse401 | BulkUpdateFiltersResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: list[ModelsBulkUpdateFilterRequest], +) -> ( + BulkUpdateFiltersResponse200 + | BulkUpdateFiltersResponse400 + | BulkUpdateFiltersResponse401 + | BulkUpdateFiltersResponse404 + | None +): + """Update multiple subscription filters + + This endpoint updates multiple filters for a subscription + + Args: + project_id (str): + subscription_id (str): + body (list[ModelsBulkUpdateFilterRequest]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BulkUpdateFiltersResponse200 | BulkUpdateFiltersResponse400 | BulkUpdateFiltersResponse401 | BulkUpdateFiltersResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/filters/create_filter.py b/src/convoy/api/filters/create_filter.py new file mode 100644 index 0000000..b5477a7 --- /dev/null +++ b/src/convoy/api/filters/create_filter.py @@ -0,0 +1,249 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_filter_response_201 import CreateFilterResponse201 +from ...models.create_filter_response_400 import CreateFilterResponse400 +from ...models.create_filter_response_401 import CreateFilterResponse401 +from ...models.create_filter_response_404 import CreateFilterResponse404 +from ...models.models_create_filter_request import ModelsCreateFilterRequest +from ...types import Response + + +def _get_kwargs( + project_id: str, + subscription_id: str, + *, + body: ModelsCreateFilterRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/subscriptions/{subscription_id}/filters".format( + project_id=quote(str(project_id), safe=""), + subscription_id=quote(str(subscription_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + CreateFilterResponse201 + | CreateFilterResponse400 + | CreateFilterResponse401 + | CreateFilterResponse404 + | None +): + if response.status_code == 201: + response_201 = CreateFilterResponse201.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = CreateFilterResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = CreateFilterResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = CreateFilterResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + CreateFilterResponse201 + | CreateFilterResponse400 + | CreateFilterResponse401 + | CreateFilterResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateFilterRequest, +) -> Response[ + CreateFilterResponse201 + | CreateFilterResponse400 + | CreateFilterResponse401 + | CreateFilterResponse404 +]: + """Create a new filter + + This endpoint creates a new filter for a subscription + + Args: + project_id (str): + subscription_id (str): + body (ModelsCreateFilterRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateFilterResponse201 | CreateFilterResponse400 | CreateFilterResponse401 | CreateFilterResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateFilterRequest, +) -> ( + CreateFilterResponse201 + | CreateFilterResponse400 + | CreateFilterResponse401 + | CreateFilterResponse404 + | None +): + """Create a new filter + + This endpoint creates a new filter for a subscription + + Args: + project_id (str): + subscription_id (str): + body (ModelsCreateFilterRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateFilterResponse201 | CreateFilterResponse400 | CreateFilterResponse401 | CreateFilterResponse404 + """ + + return sync_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateFilterRequest, +) -> Response[ + CreateFilterResponse201 + | CreateFilterResponse400 + | CreateFilterResponse401 + | CreateFilterResponse404 +]: + """Create a new filter + + This endpoint creates a new filter for a subscription + + Args: + project_id (str): + subscription_id (str): + body (ModelsCreateFilterRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateFilterResponse201 | CreateFilterResponse400 | CreateFilterResponse401 | CreateFilterResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateFilterRequest, +) -> ( + CreateFilterResponse201 + | CreateFilterResponse400 + | CreateFilterResponse401 + | CreateFilterResponse404 + | None +): + """Create a new filter + + This endpoint creates a new filter for a subscription + + Args: + project_id (str): + subscription_id (str): + body (ModelsCreateFilterRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateFilterResponse201 | CreateFilterResponse400 | CreateFilterResponse401 | CreateFilterResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/filters/delete_filter.py b/src/convoy/api/filters/delete_filter.py new file mode 100644 index 0000000..ef4d73f --- /dev/null +++ b/src/convoy/api/filters/delete_filter.py @@ -0,0 +1,242 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.delete_filter_response_200 import DeleteFilterResponse200 +from ...models.delete_filter_response_400 import DeleteFilterResponse400 +from ...models.delete_filter_response_401 import DeleteFilterResponse401 +from ...models.delete_filter_response_404 import DeleteFilterResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + subscription_id: str, + filter_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v1/projects/{project_id}/subscriptions/{subscription_id}/filters/{filter_id}".format( + project_id=quote(str(project_id), safe=""), + subscription_id=quote(str(subscription_id), safe=""), + filter_id=quote(str(filter_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + DeleteFilterResponse200 + | DeleteFilterResponse400 + | DeleteFilterResponse401 + | DeleteFilterResponse404 + | None +): + if response.status_code == 200: + response_200 = DeleteFilterResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = DeleteFilterResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = DeleteFilterResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = DeleteFilterResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + DeleteFilterResponse200 + | DeleteFilterResponse400 + | DeleteFilterResponse401 + | DeleteFilterResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + subscription_id: str, + filter_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + DeleteFilterResponse200 + | DeleteFilterResponse400 + | DeleteFilterResponse401 + | DeleteFilterResponse404 +]: + """Delete a filter + + This endpoint deletes a filter + + Args: + project_id (str): + subscription_id (str): + filter_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteFilterResponse200 | DeleteFilterResponse400 | DeleteFilterResponse401 | DeleteFilterResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + filter_id=filter_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + subscription_id: str, + filter_id: str, + *, + client: AuthenticatedClient, +) -> ( + DeleteFilterResponse200 + | DeleteFilterResponse400 + | DeleteFilterResponse401 + | DeleteFilterResponse404 + | None +): + """Delete a filter + + This endpoint deletes a filter + + Args: + project_id (str): + subscription_id (str): + filter_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteFilterResponse200 | DeleteFilterResponse400 | DeleteFilterResponse401 | DeleteFilterResponse404 + """ + + return sync_detailed( + project_id=project_id, + subscription_id=subscription_id, + filter_id=filter_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + subscription_id: str, + filter_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + DeleteFilterResponse200 + | DeleteFilterResponse400 + | DeleteFilterResponse401 + | DeleteFilterResponse404 +]: + """Delete a filter + + This endpoint deletes a filter + + Args: + project_id (str): + subscription_id (str): + filter_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteFilterResponse200 | DeleteFilterResponse400 | DeleteFilterResponse401 | DeleteFilterResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + filter_id=filter_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + subscription_id: str, + filter_id: str, + *, + client: AuthenticatedClient, +) -> ( + DeleteFilterResponse200 + | DeleteFilterResponse400 + | DeleteFilterResponse401 + | DeleteFilterResponse404 + | None +): + """Delete a filter + + This endpoint deletes a filter + + Args: + project_id (str): + subscription_id (str): + filter_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteFilterResponse200 | DeleteFilterResponse400 | DeleteFilterResponse401 | DeleteFilterResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + subscription_id=subscription_id, + filter_id=filter_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/filters/get_filter.py b/src/convoy/api/filters/get_filter.py new file mode 100644 index 0000000..464f66d --- /dev/null +++ b/src/convoy/api/filters/get_filter.py @@ -0,0 +1,242 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_filter_response_200 import GetFilterResponse200 +from ...models.get_filter_response_400 import GetFilterResponse400 +from ...models.get_filter_response_401 import GetFilterResponse401 +from ...models.get_filter_response_404 import GetFilterResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + subscription_id: str, + filter_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/subscriptions/{subscription_id}/filters/{filter_id}".format( + project_id=quote(str(project_id), safe=""), + subscription_id=quote(str(subscription_id), safe=""), + filter_id=quote(str(filter_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetFilterResponse200 + | GetFilterResponse400 + | GetFilterResponse401 + | GetFilterResponse404 + | None +): + if response.status_code == 200: + response_200 = GetFilterResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetFilterResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetFilterResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetFilterResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetFilterResponse200 + | GetFilterResponse400 + | GetFilterResponse401 + | GetFilterResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + subscription_id: str, + filter_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetFilterResponse200 + | GetFilterResponse400 + | GetFilterResponse401 + | GetFilterResponse404 +]: + """Get a filter + + This endpoint retrieves a single filter + + Args: + project_id (str): + subscription_id (str): + filter_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetFilterResponse200 | GetFilterResponse400 | GetFilterResponse401 | GetFilterResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + filter_id=filter_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + subscription_id: str, + filter_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetFilterResponse200 + | GetFilterResponse400 + | GetFilterResponse401 + | GetFilterResponse404 + | None +): + """Get a filter + + This endpoint retrieves a single filter + + Args: + project_id (str): + subscription_id (str): + filter_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetFilterResponse200 | GetFilterResponse400 | GetFilterResponse401 | GetFilterResponse404 + """ + + return sync_detailed( + project_id=project_id, + subscription_id=subscription_id, + filter_id=filter_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + subscription_id: str, + filter_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetFilterResponse200 + | GetFilterResponse400 + | GetFilterResponse401 + | GetFilterResponse404 +]: + """Get a filter + + This endpoint retrieves a single filter + + Args: + project_id (str): + subscription_id (str): + filter_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetFilterResponse200 | GetFilterResponse400 | GetFilterResponse401 | GetFilterResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + filter_id=filter_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + subscription_id: str, + filter_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetFilterResponse200 + | GetFilterResponse400 + | GetFilterResponse401 + | GetFilterResponse404 + | None +): + """Get a filter + + This endpoint retrieves a single filter + + Args: + project_id (str): + subscription_id (str): + filter_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetFilterResponse200 | GetFilterResponse400 | GetFilterResponse401 | GetFilterResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + subscription_id=subscription_id, + filter_id=filter_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/filters/get_filters.py b/src/convoy/api/filters/get_filters.py new file mode 100644 index 0000000..a4cacd1 --- /dev/null +++ b/src/convoy/api/filters/get_filters.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_filters_response_200 import GetFiltersResponse200 +from ...models.get_filters_response_400 import GetFiltersResponse400 +from ...models.get_filters_response_401 import GetFiltersResponse401 +from ...models.get_filters_response_404 import GetFiltersResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + subscription_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/subscriptions/{subscription_id}/filters".format( + project_id=quote(str(project_id), safe=""), + subscription_id=quote(str(subscription_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetFiltersResponse200 + | GetFiltersResponse400 + | GetFiltersResponse401 + | GetFiltersResponse404 + | None +): + if response.status_code == 200: + response_200 = GetFiltersResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetFiltersResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetFiltersResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetFiltersResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetFiltersResponse200 + | GetFiltersResponse400 + | GetFiltersResponse401 + | GetFiltersResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetFiltersResponse200 + | GetFiltersResponse400 + | GetFiltersResponse401 + | GetFiltersResponse404 +]: + """List all filters + + This endpoint fetches all filters for a subscription + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetFiltersResponse200 | GetFiltersResponse400 | GetFiltersResponse401 | GetFiltersResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetFiltersResponse200 + | GetFiltersResponse400 + | GetFiltersResponse401 + | GetFiltersResponse404 + | None +): + """List all filters + + This endpoint fetches all filters for a subscription + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetFiltersResponse200 | GetFiltersResponse400 | GetFiltersResponse401 | GetFiltersResponse404 + """ + + return sync_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetFiltersResponse200 + | GetFiltersResponse400 + | GetFiltersResponse401 + | GetFiltersResponse404 +]: + """List all filters + + This endpoint fetches all filters for a subscription + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetFiltersResponse200 | GetFiltersResponse400 | GetFiltersResponse401 | GetFiltersResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetFiltersResponse200 + | GetFiltersResponse400 + | GetFiltersResponse401 + | GetFiltersResponse404 + | None +): + """List all filters + + This endpoint fetches all filters for a subscription + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetFiltersResponse200 | GetFiltersResponse400 | GetFiltersResponse401 | GetFiltersResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/filters/test_filter.py b/src/convoy/api/filters/test_filter.py new file mode 100644 index 0000000..5eb7c0c --- /dev/null +++ b/src/convoy/api/filters/test_filter.py @@ -0,0 +1,263 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.models_test_filter_request import ModelsTestFilterRequest +from ...models.test_filter_response_200 import TestFilterResponse200 +from ...models.test_filter_response_400 import TestFilterResponse400 +from ...models.test_filter_response_401 import TestFilterResponse401 +from ...models.test_filter_response_404 import TestFilterResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + subscription_id: str, + event_type: str, + *, + body: ModelsTestFilterRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/subscriptions/{subscription_id}/filters/test/{event_type}".format( + project_id=quote(str(project_id), safe=""), + subscription_id=quote(str(subscription_id), safe=""), + event_type=quote(str(event_type), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + TestFilterResponse200 + | TestFilterResponse400 + | TestFilterResponse401 + | TestFilterResponse404 + | None +): + if response.status_code == 200: + response_200 = TestFilterResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = TestFilterResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = TestFilterResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = TestFilterResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + TestFilterResponse200 + | TestFilterResponse400 + | TestFilterResponse401 + | TestFilterResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + subscription_id: str, + event_type: str, + *, + client: AuthenticatedClient, + body: ModelsTestFilterRequest, +) -> Response[ + TestFilterResponse200 + | TestFilterResponse400 + | TestFilterResponse401 + | TestFilterResponse404 +]: + """Test a filter + + This endpoint tests a filter against a payload + + Args: + project_id (str): + subscription_id (str): + event_type (str): + body (ModelsTestFilterRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TestFilterResponse200 | TestFilterResponse400 | TestFilterResponse401 | TestFilterResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + event_type=event_type, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + subscription_id: str, + event_type: str, + *, + client: AuthenticatedClient, + body: ModelsTestFilterRequest, +) -> ( + TestFilterResponse200 + | TestFilterResponse400 + | TestFilterResponse401 + | TestFilterResponse404 + | None +): + """Test a filter + + This endpoint tests a filter against a payload + + Args: + project_id (str): + subscription_id (str): + event_type (str): + body (ModelsTestFilterRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TestFilterResponse200 | TestFilterResponse400 | TestFilterResponse401 | TestFilterResponse404 + """ + + return sync_detailed( + project_id=project_id, + subscription_id=subscription_id, + event_type=event_type, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + subscription_id: str, + event_type: str, + *, + client: AuthenticatedClient, + body: ModelsTestFilterRequest, +) -> Response[ + TestFilterResponse200 + | TestFilterResponse400 + | TestFilterResponse401 + | TestFilterResponse404 +]: + """Test a filter + + This endpoint tests a filter against a payload + + Args: + project_id (str): + subscription_id (str): + event_type (str): + body (ModelsTestFilterRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TestFilterResponse200 | TestFilterResponse400 | TestFilterResponse401 | TestFilterResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + event_type=event_type, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + subscription_id: str, + event_type: str, + *, + client: AuthenticatedClient, + body: ModelsTestFilterRequest, +) -> ( + TestFilterResponse200 + | TestFilterResponse400 + | TestFilterResponse401 + | TestFilterResponse404 + | None +): + """Test a filter + + This endpoint tests a filter against a payload + + Args: + project_id (str): + subscription_id (str): + event_type (str): + body (ModelsTestFilterRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TestFilterResponse200 | TestFilterResponse400 | TestFilterResponse401 | TestFilterResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + subscription_id=subscription_id, + event_type=event_type, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/filters/update_filter.py b/src/convoy/api/filters/update_filter.py new file mode 100644 index 0000000..42f7138 --- /dev/null +++ b/src/convoy/api/filters/update_filter.py @@ -0,0 +1,263 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.models_update_filter_request import ModelsUpdateFilterRequest +from ...models.update_filter_response_200 import UpdateFilterResponse200 +from ...models.update_filter_response_400 import UpdateFilterResponse400 +from ...models.update_filter_response_401 import UpdateFilterResponse401 +from ...models.update_filter_response_404 import UpdateFilterResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + subscription_id: str, + filter_id: str, + *, + body: ModelsUpdateFilterRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/subscriptions/{subscription_id}/filters/{filter_id}".format( + project_id=quote(str(project_id), safe=""), + subscription_id=quote(str(subscription_id), safe=""), + filter_id=quote(str(filter_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + UpdateFilterResponse200 + | UpdateFilterResponse400 + | UpdateFilterResponse401 + | UpdateFilterResponse404 + | None +): + if response.status_code == 200: + response_200 = UpdateFilterResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = UpdateFilterResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = UpdateFilterResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = UpdateFilterResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + UpdateFilterResponse200 + | UpdateFilterResponse400 + | UpdateFilterResponse401 + | UpdateFilterResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + subscription_id: str, + filter_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateFilterRequest, +) -> Response[ + UpdateFilterResponse200 + | UpdateFilterResponse400 + | UpdateFilterResponse401 + | UpdateFilterResponse404 +]: + """Update a filter + + This endpoint updates an existing filter + + Args: + project_id (str): + subscription_id (str): + filter_id (str): + body (ModelsUpdateFilterRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdateFilterResponse200 | UpdateFilterResponse400 | UpdateFilterResponse401 | UpdateFilterResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + filter_id=filter_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + subscription_id: str, + filter_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateFilterRequest, +) -> ( + UpdateFilterResponse200 + | UpdateFilterResponse400 + | UpdateFilterResponse401 + | UpdateFilterResponse404 + | None +): + """Update a filter + + This endpoint updates an existing filter + + Args: + project_id (str): + subscription_id (str): + filter_id (str): + body (ModelsUpdateFilterRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdateFilterResponse200 | UpdateFilterResponse400 | UpdateFilterResponse401 | UpdateFilterResponse404 + """ + + return sync_detailed( + project_id=project_id, + subscription_id=subscription_id, + filter_id=filter_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + subscription_id: str, + filter_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateFilterRequest, +) -> Response[ + UpdateFilterResponse200 + | UpdateFilterResponse400 + | UpdateFilterResponse401 + | UpdateFilterResponse404 +]: + """Update a filter + + This endpoint updates an existing filter + + Args: + project_id (str): + subscription_id (str): + filter_id (str): + body (ModelsUpdateFilterRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdateFilterResponse200 | UpdateFilterResponse400 | UpdateFilterResponse401 | UpdateFilterResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + filter_id=filter_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + subscription_id: str, + filter_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateFilterRequest, +) -> ( + UpdateFilterResponse200 + | UpdateFilterResponse400 + | UpdateFilterResponse401 + | UpdateFilterResponse404 + | None +): + """Update a filter + + This endpoint updates an existing filter + + Args: + project_id (str): + subscription_id (str): + filter_id (str): + body (ModelsUpdateFilterRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdateFilterResponse200 | UpdateFilterResponse400 | UpdateFilterResponse401 | UpdateFilterResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + subscription_id=subscription_id, + filter_id=filter_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/meta_events/__init__.py b/src/convoy/api/meta_events/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/convoy/api/meta_events/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/convoy/api/meta_events/get_meta_event.py b/src/convoy/api/meta_events/get_meta_event.py new file mode 100644 index 0000000..9718b6f --- /dev/null +++ b/src/convoy/api/meta_events/get_meta_event.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_meta_event_response_200 import GetMetaEventResponse200 +from ...models.get_meta_event_response_400 import GetMetaEventResponse400 +from ...models.get_meta_event_response_401 import GetMetaEventResponse401 +from ...models.get_meta_event_response_404 import GetMetaEventResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + meta_event_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/meta-events/{meta_event_id}".format( + project_id=quote(str(project_id), safe=""), + meta_event_id=quote(str(meta_event_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetMetaEventResponse200 + | GetMetaEventResponse400 + | GetMetaEventResponse401 + | GetMetaEventResponse404 + | None +): + if response.status_code == 200: + response_200 = GetMetaEventResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetMetaEventResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetMetaEventResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetMetaEventResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetMetaEventResponse200 + | GetMetaEventResponse400 + | GetMetaEventResponse401 + | GetMetaEventResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + meta_event_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetMetaEventResponse200 + | GetMetaEventResponse400 + | GetMetaEventResponse401 + | GetMetaEventResponse404 +]: + """Retrieve a meta event + + This endpoint retrieves a meta event + + Args: + project_id (str): + meta_event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetMetaEventResponse200 | GetMetaEventResponse400 | GetMetaEventResponse401 | GetMetaEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + meta_event_id=meta_event_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + meta_event_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetMetaEventResponse200 + | GetMetaEventResponse400 + | GetMetaEventResponse401 + | GetMetaEventResponse404 + | None +): + """Retrieve a meta event + + This endpoint retrieves a meta event + + Args: + project_id (str): + meta_event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetMetaEventResponse200 | GetMetaEventResponse400 | GetMetaEventResponse401 | GetMetaEventResponse404 + """ + + return sync_detailed( + project_id=project_id, + meta_event_id=meta_event_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + meta_event_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetMetaEventResponse200 + | GetMetaEventResponse400 + | GetMetaEventResponse401 + | GetMetaEventResponse404 +]: + """Retrieve a meta event + + This endpoint retrieves a meta event + + Args: + project_id (str): + meta_event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetMetaEventResponse200 | GetMetaEventResponse400 | GetMetaEventResponse401 | GetMetaEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + meta_event_id=meta_event_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + meta_event_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetMetaEventResponse200 + | GetMetaEventResponse400 + | GetMetaEventResponse401 + | GetMetaEventResponse404 + | None +): + """Retrieve a meta event + + This endpoint retrieves a meta event + + Args: + project_id (str): + meta_event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetMetaEventResponse200 | GetMetaEventResponse400 | GetMetaEventResponse401 | GetMetaEventResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + meta_event_id=meta_event_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/meta_events/get_meta_events_paged.py b/src/convoy/api/meta_events/get_meta_events_paged.py new file mode 100644 index 0000000..8ce4086 --- /dev/null +++ b/src/convoy/api/meta_events/get_meta_events_paged.py @@ -0,0 +1,330 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_meta_events_paged_direction import GetMetaEventsPagedDirection +from ...models.get_meta_events_paged_response_200 import GetMetaEventsPagedResponse200 +from ...models.get_meta_events_paged_response_400 import GetMetaEventsPagedResponse400 +from ...models.get_meta_events_paged_response_401 import GetMetaEventsPagedResponse401 +from ...models.get_meta_events_paged_response_404 import GetMetaEventsPagedResponse404 +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + project_id: str, + *, + direction: GetMetaEventsPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_direction: str | Unset = UNSET + if not isinstance(direction, Unset): + json_direction = direction.value + + params["direction"] = json_direction + + params["endDate"] = end_date + + params["next_page_cursor"] = next_page_cursor + + params["perPage"] = per_page + + params["prev_page_cursor"] = prev_page_cursor + + params["sort"] = sort + + params["startDate"] = start_date + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/meta-events".format( + project_id=quote(str(project_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetMetaEventsPagedResponse200 + | GetMetaEventsPagedResponse400 + | GetMetaEventsPagedResponse401 + | GetMetaEventsPagedResponse404 + | None +): + if response.status_code == 200: + response_200 = GetMetaEventsPagedResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetMetaEventsPagedResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetMetaEventsPagedResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetMetaEventsPagedResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetMetaEventsPagedResponse200 + | GetMetaEventsPagedResponse400 + | GetMetaEventsPagedResponse401 + | GetMetaEventsPagedResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetMetaEventsPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> Response[ + GetMetaEventsPagedResponse200 + | GetMetaEventsPagedResponse400 + | GetMetaEventsPagedResponse401 + | GetMetaEventsPagedResponse404 +]: + """List all meta events + + This endpoint fetches meta events with pagination + + Args: + project_id (str): + direction (GetMetaEventsPagedDirection | Unset): + end_date (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetMetaEventsPagedResponse200 | GetMetaEventsPagedResponse400 | GetMetaEventsPagedResponse401 | GetMetaEventsPagedResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + end_date=end_date, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + start_date=start_date, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetMetaEventsPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> ( + GetMetaEventsPagedResponse200 + | GetMetaEventsPagedResponse400 + | GetMetaEventsPagedResponse401 + | GetMetaEventsPagedResponse404 + | None +): + """List all meta events + + This endpoint fetches meta events with pagination + + Args: + project_id (str): + direction (GetMetaEventsPagedDirection | Unset): + end_date (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetMetaEventsPagedResponse200 | GetMetaEventsPagedResponse400 | GetMetaEventsPagedResponse401 | GetMetaEventsPagedResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + direction=direction, + end_date=end_date, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + start_date=start_date, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetMetaEventsPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> Response[ + GetMetaEventsPagedResponse200 + | GetMetaEventsPagedResponse400 + | GetMetaEventsPagedResponse401 + | GetMetaEventsPagedResponse404 +]: + """List all meta events + + This endpoint fetches meta events with pagination + + Args: + project_id (str): + direction (GetMetaEventsPagedDirection | Unset): + end_date (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetMetaEventsPagedResponse200 | GetMetaEventsPagedResponse400 | GetMetaEventsPagedResponse401 | GetMetaEventsPagedResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + end_date=end_date, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + start_date=start_date, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetMetaEventsPagedDirection | Unset = UNSET, + end_date: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, + start_date: str | Unset = UNSET, +) -> ( + GetMetaEventsPagedResponse200 + | GetMetaEventsPagedResponse400 + | GetMetaEventsPagedResponse401 + | GetMetaEventsPagedResponse404 + | None +): + """List all meta events + + This endpoint fetches meta events with pagination + + Args: + project_id (str): + direction (GetMetaEventsPagedDirection | Unset): + end_date (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + start_date (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetMetaEventsPagedResponse200 | GetMetaEventsPagedResponse400 | GetMetaEventsPagedResponse401 | GetMetaEventsPagedResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + direction=direction, + end_date=end_date, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + start_date=start_date, + ) + ).parsed diff --git a/src/convoy/api/meta_events/resend_meta_event.py b/src/convoy/api/meta_events/resend_meta_event.py new file mode 100644 index 0000000..00101bc --- /dev/null +++ b/src/convoy/api/meta_events/resend_meta_event.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.resend_meta_event_response_200 import ResendMetaEventResponse200 +from ...models.resend_meta_event_response_400 import ResendMetaEventResponse400 +from ...models.resend_meta_event_response_401 import ResendMetaEventResponse401 +from ...models.resend_meta_event_response_404 import ResendMetaEventResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + meta_event_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/meta-events/{meta_event_id}/resend".format( + project_id=quote(str(project_id), safe=""), + meta_event_id=quote(str(meta_event_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + ResendMetaEventResponse200 + | ResendMetaEventResponse400 + | ResendMetaEventResponse401 + | ResendMetaEventResponse404 + | None +): + if response.status_code == 200: + response_200 = ResendMetaEventResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ResendMetaEventResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ResendMetaEventResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = ResendMetaEventResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + ResendMetaEventResponse200 + | ResendMetaEventResponse400 + | ResendMetaEventResponse401 + | ResendMetaEventResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + meta_event_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + ResendMetaEventResponse200 + | ResendMetaEventResponse400 + | ResendMetaEventResponse401 + | ResendMetaEventResponse404 +]: + """Retry meta event + + This endpoint retries a meta event + + Args: + project_id (str): + meta_event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ResendMetaEventResponse200 | ResendMetaEventResponse400 | ResendMetaEventResponse401 | ResendMetaEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + meta_event_id=meta_event_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + meta_event_id: str, + *, + client: AuthenticatedClient, +) -> ( + ResendMetaEventResponse200 + | ResendMetaEventResponse400 + | ResendMetaEventResponse401 + | ResendMetaEventResponse404 + | None +): + """Retry meta event + + This endpoint retries a meta event + + Args: + project_id (str): + meta_event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ResendMetaEventResponse200 | ResendMetaEventResponse400 | ResendMetaEventResponse401 | ResendMetaEventResponse404 + """ + + return sync_detailed( + project_id=project_id, + meta_event_id=meta_event_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + meta_event_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + ResendMetaEventResponse200 + | ResendMetaEventResponse400 + | ResendMetaEventResponse401 + | ResendMetaEventResponse404 +]: + """Retry meta event + + This endpoint retries a meta event + + Args: + project_id (str): + meta_event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ResendMetaEventResponse200 | ResendMetaEventResponse400 | ResendMetaEventResponse401 | ResendMetaEventResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + meta_event_id=meta_event_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + meta_event_id: str, + *, + client: AuthenticatedClient, +) -> ( + ResendMetaEventResponse200 + | ResendMetaEventResponse400 + | ResendMetaEventResponse401 + | ResendMetaEventResponse404 + | None +): + """Retry meta event + + This endpoint retries a meta event + + Args: + project_id (str): + meta_event_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ResendMetaEventResponse200 | ResendMetaEventResponse400 | ResendMetaEventResponse401 | ResendMetaEventResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + meta_event_id=meta_event_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/onboard/__init__.py b/src/convoy/api/onboard/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/convoy/api/onboard/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/convoy/api/onboard/bulk_onboard.py b/src/convoy/api/onboard/bulk_onboard.py new file mode 100644 index 0000000..6d9651d --- /dev/null +++ b/src/convoy/api/onboard/bulk_onboard.py @@ -0,0 +1,266 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.bulk_onboard_response_200 import BulkOnboardResponse200 +from ...models.bulk_onboard_response_202 import BulkOnboardResponse202 +from ...models.bulk_onboard_response_400 import BulkOnboardResponse400 +from ...models.bulk_onboard_response_401 import BulkOnboardResponse401 +from ...models.bulk_onboard_response_404 import BulkOnboardResponse404 +from ...types import UNSET, File, Response, Unset + + +def _get_kwargs( + project_id: str, + *, + body: File | Unset = UNSET, + dry_run: bool | Unset = UNSET, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["dry_run"] = dry_run + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/onboard".format( + project_id=quote(str(project_id), safe=""), + ), + "params": params, + } + + if not isinstance(body, Unset): + _kwargs["content"] = body.payload + headers["Content-Type"] = "application/octet-stream" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + BulkOnboardResponse200 + | BulkOnboardResponse202 + | BulkOnboardResponse400 + | BulkOnboardResponse401 + | BulkOnboardResponse404 + | None +): + if response.status_code == 200: + response_200 = BulkOnboardResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 202: + response_202 = BulkOnboardResponse202.from_dict(response.json()) + + return response_202 + + if response.status_code == 400: + response_400 = BulkOnboardResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = BulkOnboardResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = BulkOnboardResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + BulkOnboardResponse200 + | BulkOnboardResponse202 + | BulkOnboardResponse400 + | BulkOnboardResponse401 + | BulkOnboardResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: File | Unset = UNSET, + dry_run: bool | Unset = UNSET, +) -> Response[ + BulkOnboardResponse200 + | BulkOnboardResponse202 + | BulkOnboardResponse400 + | BulkOnboardResponse401 + | BulkOnboardResponse404 +]: + """Bulk onboard endpoints with subscriptions + + This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions + + Args: + project_id (str): + dry_run (bool | Unset): + body (File | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BulkOnboardResponse200 | BulkOnboardResponse202 | BulkOnboardResponse400 | BulkOnboardResponse401 | BulkOnboardResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + dry_run=dry_run, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: File | Unset = UNSET, + dry_run: bool | Unset = UNSET, +) -> ( + BulkOnboardResponse200 + | BulkOnboardResponse202 + | BulkOnboardResponse400 + | BulkOnboardResponse401 + | BulkOnboardResponse404 + | None +): + """Bulk onboard endpoints with subscriptions + + This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions + + Args: + project_id (str): + dry_run (bool | Unset): + body (File | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BulkOnboardResponse200 | BulkOnboardResponse202 | BulkOnboardResponse400 | BulkOnboardResponse401 | BulkOnboardResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + dry_run=dry_run, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: File | Unset = UNSET, + dry_run: bool | Unset = UNSET, +) -> Response[ + BulkOnboardResponse200 + | BulkOnboardResponse202 + | BulkOnboardResponse400 + | BulkOnboardResponse401 + | BulkOnboardResponse404 +]: + """Bulk onboard endpoints with subscriptions + + This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions + + Args: + project_id (str): + dry_run (bool | Unset): + body (File | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[BulkOnboardResponse200 | BulkOnboardResponse202 | BulkOnboardResponse400 | BulkOnboardResponse401 | BulkOnboardResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + dry_run=dry_run, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: File | Unset = UNSET, + dry_run: bool | Unset = UNSET, +) -> ( + BulkOnboardResponse200 + | BulkOnboardResponse202 + | BulkOnboardResponse400 + | BulkOnboardResponse401 + | BulkOnboardResponse404 + | None +): + """Bulk onboard endpoints with subscriptions + + This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions + + Args: + project_id (str): + dry_run (bool | Unset): + body (File | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + BulkOnboardResponse200 | BulkOnboardResponse202 | BulkOnboardResponse400 | BulkOnboardResponse401 | BulkOnboardResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + dry_run=dry_run, + ) + ).parsed diff --git a/src/convoy/api/portal_links/__init__.py b/src/convoy/api/portal_links/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/convoy/api/portal_links/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/convoy/api/portal_links/create_portal_link.py b/src/convoy/api/portal_links/create_portal_link.py new file mode 100644 index 0000000..46586a5 --- /dev/null +++ b/src/convoy/api/portal_links/create_portal_link.py @@ -0,0 +1,237 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_portal_link_response_201 import CreatePortalLinkResponse201 +from ...models.create_portal_link_response_400 import CreatePortalLinkResponse400 +from ...models.create_portal_link_response_401 import CreatePortalLinkResponse401 +from ...models.create_portal_link_response_404 import CreatePortalLinkResponse404 +from ...models.datastore_create_portal_link_request import ( + DatastoreCreatePortalLinkRequest, +) +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: DatastoreCreatePortalLinkRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/portal-links".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + CreatePortalLinkResponse201 + | CreatePortalLinkResponse400 + | CreatePortalLinkResponse401 + | CreatePortalLinkResponse404 + | None +): + if response.status_code == 201: + response_201 = CreatePortalLinkResponse201.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = CreatePortalLinkResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = CreatePortalLinkResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = CreatePortalLinkResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + CreatePortalLinkResponse201 + | CreatePortalLinkResponse400 + | CreatePortalLinkResponse401 + | CreatePortalLinkResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: DatastoreCreatePortalLinkRequest, +) -> Response[ + CreatePortalLinkResponse201 + | CreatePortalLinkResponse400 + | CreatePortalLinkResponse401 + | CreatePortalLinkResponse404 +]: + """Create a portal link + + This endpoint creates a portal link + + Args: + project_id (str): + body (DatastoreCreatePortalLinkRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreatePortalLinkResponse201 | CreatePortalLinkResponse400 | CreatePortalLinkResponse401 | CreatePortalLinkResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: DatastoreCreatePortalLinkRequest, +) -> ( + CreatePortalLinkResponse201 + | CreatePortalLinkResponse400 + | CreatePortalLinkResponse401 + | CreatePortalLinkResponse404 + | None +): + """Create a portal link + + This endpoint creates a portal link + + Args: + project_id (str): + body (DatastoreCreatePortalLinkRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreatePortalLinkResponse201 | CreatePortalLinkResponse400 | CreatePortalLinkResponse401 | CreatePortalLinkResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: DatastoreCreatePortalLinkRequest, +) -> Response[ + CreatePortalLinkResponse201 + | CreatePortalLinkResponse400 + | CreatePortalLinkResponse401 + | CreatePortalLinkResponse404 +]: + """Create a portal link + + This endpoint creates a portal link + + Args: + project_id (str): + body (DatastoreCreatePortalLinkRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreatePortalLinkResponse201 | CreatePortalLinkResponse400 | CreatePortalLinkResponse401 | CreatePortalLinkResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: DatastoreCreatePortalLinkRequest, +) -> ( + CreatePortalLinkResponse201 + | CreatePortalLinkResponse400 + | CreatePortalLinkResponse401 + | CreatePortalLinkResponse404 + | None +): + """Create a portal link + + This endpoint creates a portal link + + Args: + project_id (str): + body (DatastoreCreatePortalLinkRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreatePortalLinkResponse201 | CreatePortalLinkResponse400 | CreatePortalLinkResponse401 | CreatePortalLinkResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/portal_links/get_portal_link.py b/src/convoy/api/portal_links/get_portal_link.py new file mode 100644 index 0000000..b641bb0 --- /dev/null +++ b/src/convoy/api/portal_links/get_portal_link.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_portal_link_response_200 import GetPortalLinkResponse200 +from ...models.get_portal_link_response_400 import GetPortalLinkResponse400 +from ...models.get_portal_link_response_401 import GetPortalLinkResponse401 +from ...models.get_portal_link_response_404 import GetPortalLinkResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + portal_link_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/portal-links/{portal_link_id}".format( + project_id=quote(str(project_id), safe=""), + portal_link_id=quote(str(portal_link_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetPortalLinkResponse200 + | GetPortalLinkResponse400 + | GetPortalLinkResponse401 + | GetPortalLinkResponse404 + | None +): + if response.status_code == 200: + response_200 = GetPortalLinkResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetPortalLinkResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetPortalLinkResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetPortalLinkResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetPortalLinkResponse200 + | GetPortalLinkResponse400 + | GetPortalLinkResponse401 + | GetPortalLinkResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetPortalLinkResponse200 + | GetPortalLinkResponse400 + | GetPortalLinkResponse401 + | GetPortalLinkResponse404 +]: + """Retrieve a portal link + + This endpoint retrieves a portal link by its id. + + Args: + project_id (str): + portal_link_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetPortalLinkResponse200 | GetPortalLinkResponse400 | GetPortalLinkResponse401 | GetPortalLinkResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + portal_link_id=portal_link_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetPortalLinkResponse200 + | GetPortalLinkResponse400 + | GetPortalLinkResponse401 + | GetPortalLinkResponse404 + | None +): + """Retrieve a portal link + + This endpoint retrieves a portal link by its id. + + Args: + project_id (str): + portal_link_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetPortalLinkResponse200 | GetPortalLinkResponse400 | GetPortalLinkResponse401 | GetPortalLinkResponse404 + """ + + return sync_detailed( + project_id=project_id, + portal_link_id=portal_link_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetPortalLinkResponse200 + | GetPortalLinkResponse400 + | GetPortalLinkResponse401 + | GetPortalLinkResponse404 +]: + """Retrieve a portal link + + This endpoint retrieves a portal link by its id. + + Args: + project_id (str): + portal_link_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetPortalLinkResponse200 | GetPortalLinkResponse400 | GetPortalLinkResponse401 | GetPortalLinkResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + portal_link_id=portal_link_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetPortalLinkResponse200 + | GetPortalLinkResponse400 + | GetPortalLinkResponse401 + | GetPortalLinkResponse404 + | None +): + """Retrieve a portal link + + This endpoint retrieves a portal link by its id. + + Args: + project_id (str): + portal_link_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetPortalLinkResponse200 | GetPortalLinkResponse400 | GetPortalLinkResponse401 | GetPortalLinkResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + portal_link_id=portal_link_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/portal_links/load_portal_links_paged.py b/src/convoy/api/portal_links/load_portal_links_paged.py new file mode 100644 index 0000000..0559e49 --- /dev/null +++ b/src/convoy/api/portal_links/load_portal_links_paged.py @@ -0,0 +1,338 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.load_portal_links_paged_direction import LoadPortalLinksPagedDirection +from ...models.load_portal_links_paged_response_200 import ( + LoadPortalLinksPagedResponse200, +) +from ...models.load_portal_links_paged_response_400 import ( + LoadPortalLinksPagedResponse400, +) +from ...models.load_portal_links_paged_response_401 import ( + LoadPortalLinksPagedResponse401, +) +from ...models.load_portal_links_paged_response_404 import ( + LoadPortalLinksPagedResponse404, +) +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + project_id: str, + *, + direction: LoadPortalLinksPagedDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + owner_id: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + q: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_direction: str | Unset = UNSET + if not isinstance(direction, Unset): + json_direction = direction.value + + params["direction"] = json_direction + + params["next_page_cursor"] = next_page_cursor + + params["ownerId"] = owner_id + + params["perPage"] = per_page + + params["prev_page_cursor"] = prev_page_cursor + + params["q"] = q + + params["sort"] = sort + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/portal-links".format( + project_id=quote(str(project_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + LoadPortalLinksPagedResponse200 + | LoadPortalLinksPagedResponse400 + | LoadPortalLinksPagedResponse401 + | LoadPortalLinksPagedResponse404 + | None +): + if response.status_code == 200: + response_200 = LoadPortalLinksPagedResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = LoadPortalLinksPagedResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = LoadPortalLinksPagedResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = LoadPortalLinksPagedResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + LoadPortalLinksPagedResponse200 + | LoadPortalLinksPagedResponse400 + | LoadPortalLinksPagedResponse401 + | LoadPortalLinksPagedResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: LoadPortalLinksPagedDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + owner_id: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + q: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> Response[ + LoadPortalLinksPagedResponse200 + | LoadPortalLinksPagedResponse400 + | LoadPortalLinksPagedResponse401 + | LoadPortalLinksPagedResponse404 +]: + """List all portal links + + This endpoint fetches multiple portal links + + Args: + project_id (str): + direction (LoadPortalLinksPagedDirection | Unset): + next_page_cursor (str | Unset): + owner_id (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + q (str | Unset): + sort (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoadPortalLinksPagedResponse200 | LoadPortalLinksPagedResponse400 | LoadPortalLinksPagedResponse401 | LoadPortalLinksPagedResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + next_page_cursor=next_page_cursor, + owner_id=owner_id, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + q=q, + sort=sort, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + direction: LoadPortalLinksPagedDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + owner_id: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + q: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> ( + LoadPortalLinksPagedResponse200 + | LoadPortalLinksPagedResponse400 + | LoadPortalLinksPagedResponse401 + | LoadPortalLinksPagedResponse404 + | None +): + """List all portal links + + This endpoint fetches multiple portal links + + Args: + project_id (str): + direction (LoadPortalLinksPagedDirection | Unset): + next_page_cursor (str | Unset): + owner_id (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + q (str | Unset): + sort (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoadPortalLinksPagedResponse200 | LoadPortalLinksPagedResponse400 | LoadPortalLinksPagedResponse401 | LoadPortalLinksPagedResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + direction=direction, + next_page_cursor=next_page_cursor, + owner_id=owner_id, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + q=q, + sort=sort, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: LoadPortalLinksPagedDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + owner_id: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + q: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> Response[ + LoadPortalLinksPagedResponse200 + | LoadPortalLinksPagedResponse400 + | LoadPortalLinksPagedResponse401 + | LoadPortalLinksPagedResponse404 +]: + """List all portal links + + This endpoint fetches multiple portal links + + Args: + project_id (str): + direction (LoadPortalLinksPagedDirection | Unset): + next_page_cursor (str | Unset): + owner_id (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + q (str | Unset): + sort (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoadPortalLinksPagedResponse200 | LoadPortalLinksPagedResponse400 | LoadPortalLinksPagedResponse401 | LoadPortalLinksPagedResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + next_page_cursor=next_page_cursor, + owner_id=owner_id, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + q=q, + sort=sort, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + direction: LoadPortalLinksPagedDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + owner_id: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + q: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> ( + LoadPortalLinksPagedResponse200 + | LoadPortalLinksPagedResponse400 + | LoadPortalLinksPagedResponse401 + | LoadPortalLinksPagedResponse404 + | None +): + """List all portal links + + This endpoint fetches multiple portal links + + Args: + project_id (str): + direction (LoadPortalLinksPagedDirection | Unset): + next_page_cursor (str | Unset): + owner_id (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + q (str | Unset): + sort (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoadPortalLinksPagedResponse200 | LoadPortalLinksPagedResponse400 | LoadPortalLinksPagedResponse401 | LoadPortalLinksPagedResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + direction=direction, + next_page_cursor=next_page_cursor, + owner_id=owner_id, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + q=q, + sort=sort, + ) + ).parsed diff --git a/src/convoy/api/portal_links/refresh_portal_link_auth_token.py b/src/convoy/api/portal_links/refresh_portal_link_auth_token.py new file mode 100644 index 0000000..115fe1f --- /dev/null +++ b/src/convoy/api/portal_links/refresh_portal_link_auth_token.py @@ -0,0 +1,236 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.refresh_portal_link_auth_token_response_200 import ( + RefreshPortalLinkAuthTokenResponse200, +) +from ...models.refresh_portal_link_auth_token_response_400 import ( + RefreshPortalLinkAuthTokenResponse400, +) +from ...models.refresh_portal_link_auth_token_response_401 import ( + RefreshPortalLinkAuthTokenResponse401, +) +from ...models.refresh_portal_link_auth_token_response_404 import ( + RefreshPortalLinkAuthTokenResponse404, +) +from ...types import Response + + +def _get_kwargs( + project_id: str, + portal_link_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/portal-links/{portal_link_id}/refresh_token".format( + project_id=quote(str(project_id), safe=""), + portal_link_id=quote(str(portal_link_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + RefreshPortalLinkAuthTokenResponse200 + | RefreshPortalLinkAuthTokenResponse400 + | RefreshPortalLinkAuthTokenResponse401 + | RefreshPortalLinkAuthTokenResponse404 + | None +): + if response.status_code == 200: + response_200 = RefreshPortalLinkAuthTokenResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = RefreshPortalLinkAuthTokenResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = RefreshPortalLinkAuthTokenResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = RefreshPortalLinkAuthTokenResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + RefreshPortalLinkAuthTokenResponse200 + | RefreshPortalLinkAuthTokenResponse400 + | RefreshPortalLinkAuthTokenResponse401 + | RefreshPortalLinkAuthTokenResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + RefreshPortalLinkAuthTokenResponse200 + | RefreshPortalLinkAuthTokenResponse400 + | RefreshPortalLinkAuthTokenResponse401 + | RefreshPortalLinkAuthTokenResponse404 +]: + """Get a portal link auth token + + This endpoint retrieves a portal link auth token + + Args: + project_id (str): + portal_link_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[RefreshPortalLinkAuthTokenResponse200 | RefreshPortalLinkAuthTokenResponse400 | RefreshPortalLinkAuthTokenResponse401 | RefreshPortalLinkAuthTokenResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + portal_link_id=portal_link_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, +) -> ( + RefreshPortalLinkAuthTokenResponse200 + | RefreshPortalLinkAuthTokenResponse400 + | RefreshPortalLinkAuthTokenResponse401 + | RefreshPortalLinkAuthTokenResponse404 + | None +): + """Get a portal link auth token + + This endpoint retrieves a portal link auth token + + Args: + project_id (str): + portal_link_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + RefreshPortalLinkAuthTokenResponse200 | RefreshPortalLinkAuthTokenResponse400 | RefreshPortalLinkAuthTokenResponse401 | RefreshPortalLinkAuthTokenResponse404 + """ + + return sync_detailed( + project_id=project_id, + portal_link_id=portal_link_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + RefreshPortalLinkAuthTokenResponse200 + | RefreshPortalLinkAuthTokenResponse400 + | RefreshPortalLinkAuthTokenResponse401 + | RefreshPortalLinkAuthTokenResponse404 +]: + """Get a portal link auth token + + This endpoint retrieves a portal link auth token + + Args: + project_id (str): + portal_link_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[RefreshPortalLinkAuthTokenResponse200 | RefreshPortalLinkAuthTokenResponse400 | RefreshPortalLinkAuthTokenResponse401 | RefreshPortalLinkAuthTokenResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + portal_link_id=portal_link_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, +) -> ( + RefreshPortalLinkAuthTokenResponse200 + | RefreshPortalLinkAuthTokenResponse400 + | RefreshPortalLinkAuthTokenResponse401 + | RefreshPortalLinkAuthTokenResponse404 + | None +): + """Get a portal link auth token + + This endpoint retrieves a portal link auth token + + Args: + project_id (str): + portal_link_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + RefreshPortalLinkAuthTokenResponse200 | RefreshPortalLinkAuthTokenResponse400 | RefreshPortalLinkAuthTokenResponse401 | RefreshPortalLinkAuthTokenResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + portal_link_id=portal_link_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/portal_links/revoke_portal_link.py b/src/convoy/api/portal_links/revoke_portal_link.py new file mode 100644 index 0000000..4f739e4 --- /dev/null +++ b/src/convoy/api/portal_links/revoke_portal_link.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.revoke_portal_link_response_200 import RevokePortalLinkResponse200 +from ...models.revoke_portal_link_response_400 import RevokePortalLinkResponse400 +from ...models.revoke_portal_link_response_401 import RevokePortalLinkResponse401 +from ...models.revoke_portal_link_response_404 import RevokePortalLinkResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + portal_link_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/portal-links/{portal_link_id}/revoke".format( + project_id=quote(str(project_id), safe=""), + portal_link_id=quote(str(portal_link_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + RevokePortalLinkResponse200 + | RevokePortalLinkResponse400 + | RevokePortalLinkResponse401 + | RevokePortalLinkResponse404 + | None +): + if response.status_code == 200: + response_200 = RevokePortalLinkResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = RevokePortalLinkResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = RevokePortalLinkResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = RevokePortalLinkResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + RevokePortalLinkResponse200 + | RevokePortalLinkResponse400 + | RevokePortalLinkResponse401 + | RevokePortalLinkResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + RevokePortalLinkResponse200 + | RevokePortalLinkResponse400 + | RevokePortalLinkResponse401 + | RevokePortalLinkResponse404 +]: + """Revoke a portal link + + This endpoint revokes a portal link + + Args: + project_id (str): + portal_link_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[RevokePortalLinkResponse200 | RevokePortalLinkResponse400 | RevokePortalLinkResponse401 | RevokePortalLinkResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + portal_link_id=portal_link_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, +) -> ( + RevokePortalLinkResponse200 + | RevokePortalLinkResponse400 + | RevokePortalLinkResponse401 + | RevokePortalLinkResponse404 + | None +): + """Revoke a portal link + + This endpoint revokes a portal link + + Args: + project_id (str): + portal_link_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + RevokePortalLinkResponse200 | RevokePortalLinkResponse400 | RevokePortalLinkResponse401 | RevokePortalLinkResponse404 + """ + + return sync_detailed( + project_id=project_id, + portal_link_id=portal_link_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + RevokePortalLinkResponse200 + | RevokePortalLinkResponse400 + | RevokePortalLinkResponse401 + | RevokePortalLinkResponse404 +]: + """Revoke a portal link + + This endpoint revokes a portal link + + Args: + project_id (str): + portal_link_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[RevokePortalLinkResponse200 | RevokePortalLinkResponse400 | RevokePortalLinkResponse401 | RevokePortalLinkResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + portal_link_id=portal_link_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, +) -> ( + RevokePortalLinkResponse200 + | RevokePortalLinkResponse400 + | RevokePortalLinkResponse401 + | RevokePortalLinkResponse404 + | None +): + """Revoke a portal link + + This endpoint revokes a portal link + + Args: + project_id (str): + portal_link_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + RevokePortalLinkResponse200 | RevokePortalLinkResponse400 | RevokePortalLinkResponse401 | RevokePortalLinkResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + portal_link_id=portal_link_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/portal_links/update_portal_link.py b/src/convoy/api/portal_links/update_portal_link.py new file mode 100644 index 0000000..35ba5b1 --- /dev/null +++ b/src/convoy/api/portal_links/update_portal_link.py @@ -0,0 +1,251 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.datastore_update_portal_link_request import ( + DatastoreUpdatePortalLinkRequest, +) +from ...models.update_portal_link_response_202 import UpdatePortalLinkResponse202 +from ...models.update_portal_link_response_400 import UpdatePortalLinkResponse400 +from ...models.update_portal_link_response_401 import UpdatePortalLinkResponse401 +from ...models.update_portal_link_response_404 import UpdatePortalLinkResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + portal_link_id: str, + *, + body: DatastoreUpdatePortalLinkRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/portal-links/{portal_link_id}".format( + project_id=quote(str(project_id), safe=""), + portal_link_id=quote(str(portal_link_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + UpdatePortalLinkResponse202 + | UpdatePortalLinkResponse400 + | UpdatePortalLinkResponse401 + | UpdatePortalLinkResponse404 + | None +): + if response.status_code == 202: + response_202 = UpdatePortalLinkResponse202.from_dict(response.json()) + + return response_202 + + if response.status_code == 400: + response_400 = UpdatePortalLinkResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = UpdatePortalLinkResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = UpdatePortalLinkResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + UpdatePortalLinkResponse202 + | UpdatePortalLinkResponse400 + | UpdatePortalLinkResponse401 + | UpdatePortalLinkResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, + body: DatastoreUpdatePortalLinkRequest, +) -> Response[ + UpdatePortalLinkResponse202 + | UpdatePortalLinkResponse400 + | UpdatePortalLinkResponse401 + | UpdatePortalLinkResponse404 +]: + """Update a portal link + + This endpoint updates a portal link + + Args: + project_id (str): + portal_link_id (str): + body (DatastoreUpdatePortalLinkRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdatePortalLinkResponse202 | UpdatePortalLinkResponse400 | UpdatePortalLinkResponse401 | UpdatePortalLinkResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + portal_link_id=portal_link_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, + body: DatastoreUpdatePortalLinkRequest, +) -> ( + UpdatePortalLinkResponse202 + | UpdatePortalLinkResponse400 + | UpdatePortalLinkResponse401 + | UpdatePortalLinkResponse404 + | None +): + """Update a portal link + + This endpoint updates a portal link + + Args: + project_id (str): + portal_link_id (str): + body (DatastoreUpdatePortalLinkRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdatePortalLinkResponse202 | UpdatePortalLinkResponse400 | UpdatePortalLinkResponse401 | UpdatePortalLinkResponse404 + """ + + return sync_detailed( + project_id=project_id, + portal_link_id=portal_link_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, + body: DatastoreUpdatePortalLinkRequest, +) -> Response[ + UpdatePortalLinkResponse202 + | UpdatePortalLinkResponse400 + | UpdatePortalLinkResponse401 + | UpdatePortalLinkResponse404 +]: + """Update a portal link + + This endpoint updates a portal link + + Args: + project_id (str): + portal_link_id (str): + body (DatastoreUpdatePortalLinkRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdatePortalLinkResponse202 | UpdatePortalLinkResponse400 | UpdatePortalLinkResponse401 | UpdatePortalLinkResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + portal_link_id=portal_link_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + portal_link_id: str, + *, + client: AuthenticatedClient, + body: DatastoreUpdatePortalLinkRequest, +) -> ( + UpdatePortalLinkResponse202 + | UpdatePortalLinkResponse400 + | UpdatePortalLinkResponse401 + | UpdatePortalLinkResponse404 + | None +): + """Update a portal link + + This endpoint updates a portal link + + Args: + project_id (str): + portal_link_id (str): + body (DatastoreUpdatePortalLinkRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdatePortalLinkResponse202 | UpdatePortalLinkResponse400 | UpdatePortalLinkResponse401 | UpdatePortalLinkResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + portal_link_id=portal_link_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/projects/__init__.py b/src/convoy/api/projects/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/convoy/api/projects/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/convoy/api/projects/create_project.py b/src/convoy/api/projects/create_project.py new file mode 100644 index 0000000..ba923fd --- /dev/null +++ b/src/convoy/api/projects/create_project.py @@ -0,0 +1,271 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_project_response_201 import CreateProjectResponse201 +from ...models.create_project_response_400 import CreateProjectResponse400 +from ...models.create_project_response_401 import CreateProjectResponse401 +from ...models.create_project_response_402 import CreateProjectResponse402 +from ...models.create_project_response_403 import CreateProjectResponse403 +from ...models.create_project_response_404 import CreateProjectResponse404 +from ...models.models_create_project import ModelsCreateProject +from ...types import UNSET, Response + + +def _get_kwargs( + *, + body: ModelsCreateProject, + org_id: str, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + params: dict[str, Any] = {} + + params["orgID"] = org_id + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects", + "params": params, + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + CreateProjectResponse201 + | CreateProjectResponse400 + | CreateProjectResponse401 + | CreateProjectResponse402 + | CreateProjectResponse403 + | CreateProjectResponse404 + | None +): + if response.status_code == 201: + response_201 = CreateProjectResponse201.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = CreateProjectResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = CreateProjectResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 402: + response_402 = CreateProjectResponse402.from_dict(response.json()) + + return response_402 + + if response.status_code == 403: + response_403 = CreateProjectResponse403.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = CreateProjectResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + CreateProjectResponse201 + | CreateProjectResponse400 + | CreateProjectResponse401 + | CreateProjectResponse402 + | CreateProjectResponse403 + | CreateProjectResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + body: ModelsCreateProject, + org_id: str, +) -> Response[ + CreateProjectResponse201 + | CreateProjectResponse400 + | CreateProjectResponse401 + | CreateProjectResponse402 + | CreateProjectResponse403 + | CreateProjectResponse404 +]: + """Create a project + + This endpoint creates a project. Authenticate with a personal API key or JWT and pass the + organisation id as the orgID query parameter. The response includes the project and a one-time + project API key. + + Args: + org_id (str): + body (ModelsCreateProject): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateProjectResponse201 | CreateProjectResponse400 | CreateProjectResponse401 | CreateProjectResponse402 | CreateProjectResponse403 | CreateProjectResponse404] + """ + + kwargs = _get_kwargs( + body=body, + org_id=org_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + body: ModelsCreateProject, + org_id: str, +) -> ( + CreateProjectResponse201 + | CreateProjectResponse400 + | CreateProjectResponse401 + | CreateProjectResponse402 + | CreateProjectResponse403 + | CreateProjectResponse404 + | None +): + """Create a project + + This endpoint creates a project. Authenticate with a personal API key or JWT and pass the + organisation id as the orgID query parameter. The response includes the project and a one-time + project API key. + + Args: + org_id (str): + body (ModelsCreateProject): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateProjectResponse201 | CreateProjectResponse400 | CreateProjectResponse401 | CreateProjectResponse402 | CreateProjectResponse403 | CreateProjectResponse404 + """ + + return sync_detailed( + client=client, + body=body, + org_id=org_id, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: ModelsCreateProject, + org_id: str, +) -> Response[ + CreateProjectResponse201 + | CreateProjectResponse400 + | CreateProjectResponse401 + | CreateProjectResponse402 + | CreateProjectResponse403 + | CreateProjectResponse404 +]: + """Create a project + + This endpoint creates a project. Authenticate with a personal API key or JWT and pass the + organisation id as the orgID query parameter. The response includes the project and a one-time + project API key. + + Args: + org_id (str): + body (ModelsCreateProject): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateProjectResponse201 | CreateProjectResponse400 | CreateProjectResponse401 | CreateProjectResponse402 | CreateProjectResponse403 | CreateProjectResponse404] + """ + + kwargs = _get_kwargs( + body=body, + org_id=org_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + body: ModelsCreateProject, + org_id: str, +) -> ( + CreateProjectResponse201 + | CreateProjectResponse400 + | CreateProjectResponse401 + | CreateProjectResponse402 + | CreateProjectResponse403 + | CreateProjectResponse404 + | None +): + """Create a project + + This endpoint creates a project. Authenticate with a personal API key or JWT and pass the + organisation id as the orgID query parameter. The response includes the project and a one-time + project API key. + + Args: + org_id (str): + body (ModelsCreateProject): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateProjectResponse201 | CreateProjectResponse400 | CreateProjectResponse401 | CreateProjectResponse402 | CreateProjectResponse403 | CreateProjectResponse404 + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + org_id=org_id, + ) + ).parsed diff --git a/src/convoy/api/projects/delete_project.py b/src/convoy/api/projects/delete_project.py new file mode 100644 index 0000000..e24ac8a --- /dev/null +++ b/src/convoy/api/projects/delete_project.py @@ -0,0 +1,226 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.delete_project_response_200 import DeleteProjectResponse200 +from ...models.delete_project_response_400 import DeleteProjectResponse400 +from ...models.delete_project_response_401 import DeleteProjectResponse401 +from ...models.delete_project_response_403 import DeleteProjectResponse403 +from ...models.delete_project_response_404 import DeleteProjectResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v1/projects/{project_id}".format( + project_id=quote(str(project_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + DeleteProjectResponse200 + | DeleteProjectResponse400 + | DeleteProjectResponse401 + | DeleteProjectResponse403 + | DeleteProjectResponse404 + | None +): + if response.status_code == 200: + response_200 = DeleteProjectResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = DeleteProjectResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = DeleteProjectResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = DeleteProjectResponse403.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = DeleteProjectResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + DeleteProjectResponse200 + | DeleteProjectResponse400 + | DeleteProjectResponse401 + | DeleteProjectResponse403 + | DeleteProjectResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + DeleteProjectResponse200 + | DeleteProjectResponse400 + | DeleteProjectResponse401 + | DeleteProjectResponse403 + | DeleteProjectResponse404 +]: + """Delete a project + + This endpoint deletes a project + + Args: + project_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteProjectResponse200 | DeleteProjectResponse400 | DeleteProjectResponse401 | DeleteProjectResponse403 | DeleteProjectResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, +) -> ( + DeleteProjectResponse200 + | DeleteProjectResponse400 + | DeleteProjectResponse401 + | DeleteProjectResponse403 + | DeleteProjectResponse404 + | None +): + """Delete a project + + This endpoint deletes a project + + Args: + project_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteProjectResponse200 | DeleteProjectResponse400 | DeleteProjectResponse401 | DeleteProjectResponse403 | DeleteProjectResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + DeleteProjectResponse200 + | DeleteProjectResponse400 + | DeleteProjectResponse401 + | DeleteProjectResponse403 + | DeleteProjectResponse404 +]: + """Delete a project + + This endpoint deletes a project + + Args: + project_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteProjectResponse200 | DeleteProjectResponse400 | DeleteProjectResponse401 | DeleteProjectResponse403 | DeleteProjectResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, +) -> ( + DeleteProjectResponse200 + | DeleteProjectResponse400 + | DeleteProjectResponse401 + | DeleteProjectResponse403 + | DeleteProjectResponse404 + | None +): + """Delete a project + + This endpoint deletes a project + + Args: + project_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteProjectResponse200 | DeleteProjectResponse400 | DeleteProjectResponse401 | DeleteProjectResponse403 | DeleteProjectResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/projects/get_project.py b/src/convoy/api/projects/get_project.py new file mode 100644 index 0000000..124acf7 --- /dev/null +++ b/src/convoy/api/projects/get_project.py @@ -0,0 +1,214 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_project_response_200 import GetProjectResponse200 +from ...models.get_project_response_400 import GetProjectResponse400 +from ...models.get_project_response_401 import GetProjectResponse401 +from ...models.get_project_response_404 import GetProjectResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}".format( + project_id=quote(str(project_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetProjectResponse200 + | GetProjectResponse400 + | GetProjectResponse401 + | GetProjectResponse404 + | None +): + if response.status_code == 200: + response_200 = GetProjectResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetProjectResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetProjectResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetProjectResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetProjectResponse200 + | GetProjectResponse400 + | GetProjectResponse401 + | GetProjectResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetProjectResponse200 + | GetProjectResponse400 + | GetProjectResponse401 + | GetProjectResponse404 +]: + """Retrieve a project + + This endpoint fetches a project by its id + + Args: + project_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetProjectResponse200 | GetProjectResponse400 | GetProjectResponse401 | GetProjectResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetProjectResponse200 + | GetProjectResponse400 + | GetProjectResponse401 + | GetProjectResponse404 + | None +): + """Retrieve a project + + This endpoint fetches a project by its id + + Args: + project_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetProjectResponse200 | GetProjectResponse400 | GetProjectResponse401 | GetProjectResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetProjectResponse200 + | GetProjectResponse400 + | GetProjectResponse401 + | GetProjectResponse404 +]: + """Retrieve a project + + This endpoint fetches a project by its id + + Args: + project_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetProjectResponse200 | GetProjectResponse400 | GetProjectResponse401 | GetProjectResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetProjectResponse200 + | GetProjectResponse400 + | GetProjectResponse401 + | GetProjectResponse404 + | None +): + """Retrieve a project + + This endpoint fetches a project by its id + + Args: + project_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetProjectResponse200 | GetProjectResponse400 | GetProjectResponse401 | GetProjectResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/projects/get_projects.py b/src/convoy/api/projects/get_projects.py new file mode 100644 index 0000000..8aa5d4f --- /dev/null +++ b/src/convoy/api/projects/get_projects.py @@ -0,0 +1,223 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_projects_response_200 import GetProjectsResponse200 +from ...models.get_projects_response_400 import GetProjectsResponse400 +from ...models.get_projects_response_401 import GetProjectsResponse401 +from ...models.get_projects_response_404 import GetProjectsResponse404 +from ...types import UNSET, Response + + +def _get_kwargs( + *, + org_id: str, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["orgID"] = org_id + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetProjectsResponse200 + | GetProjectsResponse400 + | GetProjectsResponse401 + | GetProjectsResponse404 + | None +): + if response.status_code == 200: + response_200 = GetProjectsResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetProjectsResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetProjectsResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetProjectsResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetProjectsResponse200 + | GetProjectsResponse400 + | GetProjectsResponse401 + | GetProjectsResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + org_id: str, +) -> Response[ + GetProjectsResponse200 + | GetProjectsResponse400 + | GetProjectsResponse401 + | GetProjectsResponse404 +]: + """List all projects + + This endpoint fetches projects for an organisation. Authenticate with a personal API key or JWT and + pass the organisation id as the orgID query parameter. + + Args: + org_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetProjectsResponse200 | GetProjectsResponse400 | GetProjectsResponse401 | GetProjectsResponse404] + """ + + kwargs = _get_kwargs( + org_id=org_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + org_id: str, +) -> ( + GetProjectsResponse200 + | GetProjectsResponse400 + | GetProjectsResponse401 + | GetProjectsResponse404 + | None +): + """List all projects + + This endpoint fetches projects for an organisation. Authenticate with a personal API key or JWT and + pass the organisation id as the orgID query parameter. + + Args: + org_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetProjectsResponse200 | GetProjectsResponse400 | GetProjectsResponse401 | GetProjectsResponse404 + """ + + return sync_detailed( + client=client, + org_id=org_id, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + org_id: str, +) -> Response[ + GetProjectsResponse200 + | GetProjectsResponse400 + | GetProjectsResponse401 + | GetProjectsResponse404 +]: + """List all projects + + This endpoint fetches projects for an organisation. Authenticate with a personal API key or JWT and + pass the organisation id as the orgID query parameter. + + Args: + org_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetProjectsResponse200 | GetProjectsResponse400 | GetProjectsResponse401 | GetProjectsResponse404] + """ + + kwargs = _get_kwargs( + org_id=org_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + org_id: str, +) -> ( + GetProjectsResponse200 + | GetProjectsResponse400 + | GetProjectsResponse401 + | GetProjectsResponse404 + | None +): + """List all projects + + This endpoint fetches projects for an organisation. Authenticate with a personal API key or JWT and + pass the organisation id as the orgID query parameter. + + Args: + org_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetProjectsResponse200 | GetProjectsResponse400 | GetProjectsResponse401 | GetProjectsResponse404 + """ + + return ( + await asyncio_detailed( + client=client, + org_id=org_id, + ) + ).parsed diff --git a/src/convoy/api/projects/update_project.py b/src/convoy/api/projects/update_project.py new file mode 100644 index 0000000..c86207a --- /dev/null +++ b/src/convoy/api/projects/update_project.py @@ -0,0 +1,247 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.models_update_project import ModelsUpdateProject +from ...models.update_project_response_202 import UpdateProjectResponse202 +from ...models.update_project_response_400 import UpdateProjectResponse400 +from ...models.update_project_response_401 import UpdateProjectResponse401 +from ...models.update_project_response_403 import UpdateProjectResponse403 +from ...models.update_project_response_404 import UpdateProjectResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsUpdateProject, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + UpdateProjectResponse202 + | UpdateProjectResponse400 + | UpdateProjectResponse401 + | UpdateProjectResponse403 + | UpdateProjectResponse404 + | None +): + if response.status_code == 202: + response_202 = UpdateProjectResponse202.from_dict(response.json()) + + return response_202 + + if response.status_code == 400: + response_400 = UpdateProjectResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = UpdateProjectResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = UpdateProjectResponse403.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = UpdateProjectResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + UpdateProjectResponse202 + | UpdateProjectResponse400 + | UpdateProjectResponse401 + | UpdateProjectResponse403 + | UpdateProjectResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateProject, +) -> Response[ + UpdateProjectResponse202 + | UpdateProjectResponse400 + | UpdateProjectResponse401 + | UpdateProjectResponse403 + | UpdateProjectResponse404 +]: + """Update a project + + This endpoint updates a project's name, logo, and config + + Args: + project_id (str): + body (ModelsUpdateProject): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdateProjectResponse202 | UpdateProjectResponse400 | UpdateProjectResponse401 | UpdateProjectResponse403 | UpdateProjectResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateProject, +) -> ( + UpdateProjectResponse202 + | UpdateProjectResponse400 + | UpdateProjectResponse401 + | UpdateProjectResponse403 + | UpdateProjectResponse404 + | None +): + """Update a project + + This endpoint updates a project's name, logo, and config + + Args: + project_id (str): + body (ModelsUpdateProject): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdateProjectResponse202 | UpdateProjectResponse400 | UpdateProjectResponse401 | UpdateProjectResponse403 | UpdateProjectResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateProject, +) -> Response[ + UpdateProjectResponse202 + | UpdateProjectResponse400 + | UpdateProjectResponse401 + | UpdateProjectResponse403 + | UpdateProjectResponse404 +]: + """Update a project + + This endpoint updates a project's name, logo, and config + + Args: + project_id (str): + body (ModelsUpdateProject): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdateProjectResponse202 | UpdateProjectResponse400 | UpdateProjectResponse401 | UpdateProjectResponse403 | UpdateProjectResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateProject, +) -> ( + UpdateProjectResponse202 + | UpdateProjectResponse400 + | UpdateProjectResponse401 + | UpdateProjectResponse403 + | UpdateProjectResponse404 + | None +): + """Update a project + + This endpoint updates a project's name, logo, and config + + Args: + project_id (str): + body (ModelsUpdateProject): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdateProjectResponse202 | UpdateProjectResponse400 | UpdateProjectResponse401 | UpdateProjectResponse403 | UpdateProjectResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/sources/__init__.py b/src/convoy/api/sources/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/convoy/api/sources/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/convoy/api/sources/create_source.py b/src/convoy/api/sources/create_source.py new file mode 100644 index 0000000..8848118 --- /dev/null +++ b/src/convoy/api/sources/create_source.py @@ -0,0 +1,235 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_source_response_201 import CreateSourceResponse201 +from ...models.create_source_response_400 import CreateSourceResponse400 +from ...models.create_source_response_401 import CreateSourceResponse401 +from ...models.create_source_response_404 import CreateSourceResponse404 +from ...models.models_create_source import ModelsCreateSource +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsCreateSource, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/sources".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + CreateSourceResponse201 + | CreateSourceResponse400 + | CreateSourceResponse401 + | CreateSourceResponse404 + | None +): + if response.status_code == 201: + response_201 = CreateSourceResponse201.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = CreateSourceResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = CreateSourceResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = CreateSourceResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + CreateSourceResponse201 + | CreateSourceResponse400 + | CreateSourceResponse401 + | CreateSourceResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateSource, +) -> Response[ + CreateSourceResponse201 + | CreateSourceResponse400 + | CreateSourceResponse401 + | CreateSourceResponse404 +]: + """Create a source + + This endpoint creates a source + + Args: + project_id (str): + body (ModelsCreateSource): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateSourceResponse201 | CreateSourceResponse400 | CreateSourceResponse401 | CreateSourceResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateSource, +) -> ( + CreateSourceResponse201 + | CreateSourceResponse400 + | CreateSourceResponse401 + | CreateSourceResponse404 + | None +): + """Create a source + + This endpoint creates a source + + Args: + project_id (str): + body (ModelsCreateSource): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateSourceResponse201 | CreateSourceResponse400 | CreateSourceResponse401 | CreateSourceResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateSource, +) -> Response[ + CreateSourceResponse201 + | CreateSourceResponse400 + | CreateSourceResponse401 + | CreateSourceResponse404 +]: + """Create a source + + This endpoint creates a source + + Args: + project_id (str): + body (ModelsCreateSource): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateSourceResponse201 | CreateSourceResponse400 | CreateSourceResponse401 | CreateSourceResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateSource, +) -> ( + CreateSourceResponse201 + | CreateSourceResponse400 + | CreateSourceResponse401 + | CreateSourceResponse404 + | None +): + """Create a source + + This endpoint creates a source + + Args: + project_id (str): + body (ModelsCreateSource): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateSourceResponse201 | CreateSourceResponse400 | CreateSourceResponse401 | CreateSourceResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/sources/delete_source.py b/src/convoy/api/sources/delete_source.py new file mode 100644 index 0000000..3e236b1 --- /dev/null +++ b/src/convoy/api/sources/delete_source.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.delete_source_response_200 import DeleteSourceResponse200 +from ...models.delete_source_response_400 import DeleteSourceResponse400 +from ...models.delete_source_response_401 import DeleteSourceResponse401 +from ...models.delete_source_response_404 import DeleteSourceResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + source_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v1/projects/{project_id}/sources/{source_id}".format( + project_id=quote(str(project_id), safe=""), + source_id=quote(str(source_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + DeleteSourceResponse200 + | DeleteSourceResponse400 + | DeleteSourceResponse401 + | DeleteSourceResponse404 + | None +): + if response.status_code == 200: + response_200 = DeleteSourceResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = DeleteSourceResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = DeleteSourceResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = DeleteSourceResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + DeleteSourceResponse200 + | DeleteSourceResponse400 + | DeleteSourceResponse401 + | DeleteSourceResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + source_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + DeleteSourceResponse200 + | DeleteSourceResponse400 + | DeleteSourceResponse401 + | DeleteSourceResponse404 +]: + """Delete a source + + This endpoint deletes a source + + Args: + project_id (str): + source_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteSourceResponse200 | DeleteSourceResponse400 | DeleteSourceResponse401 | DeleteSourceResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + source_id=source_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + source_id: str, + *, + client: AuthenticatedClient, +) -> ( + DeleteSourceResponse200 + | DeleteSourceResponse400 + | DeleteSourceResponse401 + | DeleteSourceResponse404 + | None +): + """Delete a source + + This endpoint deletes a source + + Args: + project_id (str): + source_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteSourceResponse200 | DeleteSourceResponse400 | DeleteSourceResponse401 | DeleteSourceResponse404 + """ + + return sync_detailed( + project_id=project_id, + source_id=source_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + source_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + DeleteSourceResponse200 + | DeleteSourceResponse400 + | DeleteSourceResponse401 + | DeleteSourceResponse404 +]: + """Delete a source + + This endpoint deletes a source + + Args: + project_id (str): + source_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteSourceResponse200 | DeleteSourceResponse400 | DeleteSourceResponse401 | DeleteSourceResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + source_id=source_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + source_id: str, + *, + client: AuthenticatedClient, +) -> ( + DeleteSourceResponse200 + | DeleteSourceResponse400 + | DeleteSourceResponse401 + | DeleteSourceResponse404 + | None +): + """Delete a source + + This endpoint deletes a source + + Args: + project_id (str): + source_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteSourceResponse200 | DeleteSourceResponse400 | DeleteSourceResponse401 | DeleteSourceResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + source_id=source_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/sources/get_source.py b/src/convoy/api/sources/get_source.py new file mode 100644 index 0000000..6c4ab88 --- /dev/null +++ b/src/convoy/api/sources/get_source.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_source_response_200 import GetSourceResponse200 +from ...models.get_source_response_400 import GetSourceResponse400 +from ...models.get_source_response_401 import GetSourceResponse401 +from ...models.get_source_response_404 import GetSourceResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + source_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/sources/{source_id}".format( + project_id=quote(str(project_id), safe=""), + source_id=quote(str(source_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetSourceResponse200 + | GetSourceResponse400 + | GetSourceResponse401 + | GetSourceResponse404 + | None +): + if response.status_code == 200: + response_200 = GetSourceResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetSourceResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetSourceResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetSourceResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetSourceResponse200 + | GetSourceResponse400 + | GetSourceResponse401 + | GetSourceResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + source_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetSourceResponse200 + | GetSourceResponse400 + | GetSourceResponse401 + | GetSourceResponse404 +]: + """Retrieve a source + + This endpoint retrieves a source by its id + + Args: + project_id (str): + source_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetSourceResponse200 | GetSourceResponse400 | GetSourceResponse401 | GetSourceResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + source_id=source_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + source_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetSourceResponse200 + | GetSourceResponse400 + | GetSourceResponse401 + | GetSourceResponse404 + | None +): + """Retrieve a source + + This endpoint retrieves a source by its id + + Args: + project_id (str): + source_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetSourceResponse200 | GetSourceResponse400 | GetSourceResponse401 | GetSourceResponse404 + """ + + return sync_detailed( + project_id=project_id, + source_id=source_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + source_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetSourceResponse200 + | GetSourceResponse400 + | GetSourceResponse401 + | GetSourceResponse404 +]: + """Retrieve a source + + This endpoint retrieves a source by its id + + Args: + project_id (str): + source_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetSourceResponse200 | GetSourceResponse400 | GetSourceResponse401 | GetSourceResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + source_id=source_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + source_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetSourceResponse200 + | GetSourceResponse400 + | GetSourceResponse401 + | GetSourceResponse404 + | None +): + """Retrieve a source + + This endpoint retrieves a source by its id + + Args: + project_id (str): + source_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetSourceResponse200 | GetSourceResponse400 | GetSourceResponse401 | GetSourceResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + source_id=source_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/sources/load_sources_paged.py b/src/convoy/api/sources/load_sources_paged.py new file mode 100644 index 0000000..91bd21c --- /dev/null +++ b/src/convoy/api/sources/load_sources_paged.py @@ -0,0 +1,330 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.load_sources_paged_direction import LoadSourcesPagedDirection +from ...models.load_sources_paged_response_200 import LoadSourcesPagedResponse200 +from ...models.load_sources_paged_response_400 import LoadSourcesPagedResponse400 +from ...models.load_sources_paged_response_401 import LoadSourcesPagedResponse401 +from ...models.load_sources_paged_response_404 import LoadSourcesPagedResponse404 +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + project_id: str, + *, + direction: LoadSourcesPagedDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + provider: str | Unset = UNSET, + sort: str | Unset = UNSET, + type_: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_direction: str | Unset = UNSET + if not isinstance(direction, Unset): + json_direction = direction.value + + params["direction"] = json_direction + + params["next_page_cursor"] = next_page_cursor + + params["perPage"] = per_page + + params["prev_page_cursor"] = prev_page_cursor + + params["provider"] = provider + + params["sort"] = sort + + params["type"] = type_ + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/sources".format( + project_id=quote(str(project_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + LoadSourcesPagedResponse200 + | LoadSourcesPagedResponse400 + | LoadSourcesPagedResponse401 + | LoadSourcesPagedResponse404 + | None +): + if response.status_code == 200: + response_200 = LoadSourcesPagedResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = LoadSourcesPagedResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = LoadSourcesPagedResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = LoadSourcesPagedResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + LoadSourcesPagedResponse200 + | LoadSourcesPagedResponse400 + | LoadSourcesPagedResponse401 + | LoadSourcesPagedResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: LoadSourcesPagedDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + provider: str | Unset = UNSET, + sort: str | Unset = UNSET, + type_: str | Unset = UNSET, +) -> Response[ + LoadSourcesPagedResponse200 + | LoadSourcesPagedResponse400 + | LoadSourcesPagedResponse401 + | LoadSourcesPagedResponse404 +]: + """List all sources + + This endpoint fetches multiple sources + + Args: + project_id (str): + direction (LoadSourcesPagedDirection | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + provider (str | Unset): + sort (str | Unset): + type_ (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoadSourcesPagedResponse200 | LoadSourcesPagedResponse400 | LoadSourcesPagedResponse401 | LoadSourcesPagedResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + provider=provider, + sort=sort, + type_=type_, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + direction: LoadSourcesPagedDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + provider: str | Unset = UNSET, + sort: str | Unset = UNSET, + type_: str | Unset = UNSET, +) -> ( + LoadSourcesPagedResponse200 + | LoadSourcesPagedResponse400 + | LoadSourcesPagedResponse401 + | LoadSourcesPagedResponse404 + | None +): + """List all sources + + This endpoint fetches multiple sources + + Args: + project_id (str): + direction (LoadSourcesPagedDirection | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + provider (str | Unset): + sort (str | Unset): + type_ (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoadSourcesPagedResponse200 | LoadSourcesPagedResponse400 | LoadSourcesPagedResponse401 | LoadSourcesPagedResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + direction=direction, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + provider=provider, + sort=sort, + type_=type_, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: LoadSourcesPagedDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + provider: str | Unset = UNSET, + sort: str | Unset = UNSET, + type_: str | Unset = UNSET, +) -> Response[ + LoadSourcesPagedResponse200 + | LoadSourcesPagedResponse400 + | LoadSourcesPagedResponse401 + | LoadSourcesPagedResponse404 +]: + """List all sources + + This endpoint fetches multiple sources + + Args: + project_id (str): + direction (LoadSourcesPagedDirection | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + provider (str | Unset): + sort (str | Unset): + type_ (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[LoadSourcesPagedResponse200 | LoadSourcesPagedResponse400 | LoadSourcesPagedResponse401 | LoadSourcesPagedResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + provider=provider, + sort=sort, + type_=type_, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + direction: LoadSourcesPagedDirection | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + provider: str | Unset = UNSET, + sort: str | Unset = UNSET, + type_: str | Unset = UNSET, +) -> ( + LoadSourcesPagedResponse200 + | LoadSourcesPagedResponse400 + | LoadSourcesPagedResponse401 + | LoadSourcesPagedResponse404 + | None +): + """List all sources + + This endpoint fetches multiple sources + + Args: + project_id (str): + direction (LoadSourcesPagedDirection | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + provider (str | Unset): + sort (str | Unset): + type_ (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + LoadSourcesPagedResponse200 | LoadSourcesPagedResponse400 | LoadSourcesPagedResponse401 | LoadSourcesPagedResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + direction=direction, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + provider=provider, + sort=sort, + type_=type_, + ) + ).parsed diff --git a/src/convoy/api/sources/update_source.py b/src/convoy/api/sources/update_source.py new file mode 100644 index 0000000..ad23be1 --- /dev/null +++ b/src/convoy/api/sources/update_source.py @@ -0,0 +1,249 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.models_update_source import ModelsUpdateSource +from ...models.update_source_response_202 import UpdateSourceResponse202 +from ...models.update_source_response_400 import UpdateSourceResponse400 +from ...models.update_source_response_401 import UpdateSourceResponse401 +from ...models.update_source_response_404 import UpdateSourceResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + source_id: str, + *, + body: ModelsUpdateSource, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/sources/{source_id}".format( + project_id=quote(str(project_id), safe=""), + source_id=quote(str(source_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + UpdateSourceResponse202 + | UpdateSourceResponse400 + | UpdateSourceResponse401 + | UpdateSourceResponse404 + | None +): + if response.status_code == 202: + response_202 = UpdateSourceResponse202.from_dict(response.json()) + + return response_202 + + if response.status_code == 400: + response_400 = UpdateSourceResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = UpdateSourceResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = UpdateSourceResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + UpdateSourceResponse202 + | UpdateSourceResponse400 + | UpdateSourceResponse401 + | UpdateSourceResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + source_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateSource, +) -> Response[ + UpdateSourceResponse202 + | UpdateSourceResponse400 + | UpdateSourceResponse401 + | UpdateSourceResponse404 +]: + """Update a source + + This endpoint updates a source + + Args: + project_id (str): + source_id (str): + body (ModelsUpdateSource): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdateSourceResponse202 | UpdateSourceResponse400 | UpdateSourceResponse401 | UpdateSourceResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + source_id=source_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + source_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateSource, +) -> ( + UpdateSourceResponse202 + | UpdateSourceResponse400 + | UpdateSourceResponse401 + | UpdateSourceResponse404 + | None +): + """Update a source + + This endpoint updates a source + + Args: + project_id (str): + source_id (str): + body (ModelsUpdateSource): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdateSourceResponse202 | UpdateSourceResponse400 | UpdateSourceResponse401 | UpdateSourceResponse404 + """ + + return sync_detailed( + project_id=project_id, + source_id=source_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + source_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateSource, +) -> Response[ + UpdateSourceResponse202 + | UpdateSourceResponse400 + | UpdateSourceResponse401 + | UpdateSourceResponse404 +]: + """Update a source + + This endpoint updates a source + + Args: + project_id (str): + source_id (str): + body (ModelsUpdateSource): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdateSourceResponse202 | UpdateSourceResponse400 | UpdateSourceResponse401 | UpdateSourceResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + source_id=source_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + source_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateSource, +) -> ( + UpdateSourceResponse202 + | UpdateSourceResponse400 + | UpdateSourceResponse401 + | UpdateSourceResponse404 + | None +): + """Update a source + + This endpoint updates a source + + Args: + project_id (str): + source_id (str): + body (ModelsUpdateSource): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdateSourceResponse202 | UpdateSourceResponse400 | UpdateSourceResponse401 | UpdateSourceResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + source_id=source_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/subscriptions/__init__.py b/src/convoy/api/subscriptions/__init__.py new file mode 100644 index 0000000..2d7c0b2 --- /dev/null +++ b/src/convoy/api/subscriptions/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/src/convoy/api/subscriptions/create_subscription.py b/src/convoy/api/subscriptions/create_subscription.py new file mode 100644 index 0000000..faa30b8 --- /dev/null +++ b/src/convoy/api/subscriptions/create_subscription.py @@ -0,0 +1,235 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_subscription_response_201 import CreateSubscriptionResponse201 +from ...models.create_subscription_response_400 import CreateSubscriptionResponse400 +from ...models.create_subscription_response_401 import CreateSubscriptionResponse401 +from ...models.create_subscription_response_404 import CreateSubscriptionResponse404 +from ...models.models_create_subscription import ModelsCreateSubscription +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsCreateSubscription, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/subscriptions".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + CreateSubscriptionResponse201 + | CreateSubscriptionResponse400 + | CreateSubscriptionResponse401 + | CreateSubscriptionResponse404 + | None +): + if response.status_code == 201: + response_201 = CreateSubscriptionResponse201.from_dict(response.json()) + + return response_201 + + if response.status_code == 400: + response_400 = CreateSubscriptionResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = CreateSubscriptionResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = CreateSubscriptionResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + CreateSubscriptionResponse201 + | CreateSubscriptionResponse400 + | CreateSubscriptionResponse401 + | CreateSubscriptionResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateSubscription, +) -> Response[ + CreateSubscriptionResponse201 + | CreateSubscriptionResponse400 + | CreateSubscriptionResponse401 + | CreateSubscriptionResponse404 +]: + """Create a subscription + + This endpoint creates a subscriptions + + Args: + project_id (str): + body (ModelsCreateSubscription): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateSubscriptionResponse201 | CreateSubscriptionResponse400 | CreateSubscriptionResponse401 | CreateSubscriptionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateSubscription, +) -> ( + CreateSubscriptionResponse201 + | CreateSubscriptionResponse400 + | CreateSubscriptionResponse401 + | CreateSubscriptionResponse404 + | None +): + """Create a subscription + + This endpoint creates a subscriptions + + Args: + project_id (str): + body (ModelsCreateSubscription): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateSubscriptionResponse201 | CreateSubscriptionResponse400 | CreateSubscriptionResponse401 | CreateSubscriptionResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateSubscription, +) -> Response[ + CreateSubscriptionResponse201 + | CreateSubscriptionResponse400 + | CreateSubscriptionResponse401 + | CreateSubscriptionResponse404 +]: + """Create a subscription + + This endpoint creates a subscriptions + + Args: + project_id (str): + body (ModelsCreateSubscription): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[CreateSubscriptionResponse201 | CreateSubscriptionResponse400 | CreateSubscriptionResponse401 | CreateSubscriptionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsCreateSubscription, +) -> ( + CreateSubscriptionResponse201 + | CreateSubscriptionResponse400 + | CreateSubscriptionResponse401 + | CreateSubscriptionResponse404 + | None +): + """Create a subscription + + This endpoint creates a subscriptions + + Args: + project_id (str): + body (ModelsCreateSubscription): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + CreateSubscriptionResponse201 | CreateSubscriptionResponse400 | CreateSubscriptionResponse401 | CreateSubscriptionResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/subscriptions/delete_subscription.py b/src/convoy/api/subscriptions/delete_subscription.py new file mode 100644 index 0000000..fadabc3 --- /dev/null +++ b/src/convoy/api/subscriptions/delete_subscription.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.delete_subscription_response_200 import DeleteSubscriptionResponse200 +from ...models.delete_subscription_response_400 import DeleteSubscriptionResponse400 +from ...models.delete_subscription_response_401 import DeleteSubscriptionResponse401 +from ...models.delete_subscription_response_404 import DeleteSubscriptionResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + subscription_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v1/projects/{project_id}/subscriptions/{subscription_id}".format( + project_id=quote(str(project_id), safe=""), + subscription_id=quote(str(subscription_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + DeleteSubscriptionResponse200 + | DeleteSubscriptionResponse400 + | DeleteSubscriptionResponse401 + | DeleteSubscriptionResponse404 + | None +): + if response.status_code == 200: + response_200 = DeleteSubscriptionResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = DeleteSubscriptionResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = DeleteSubscriptionResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = DeleteSubscriptionResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + DeleteSubscriptionResponse200 + | DeleteSubscriptionResponse400 + | DeleteSubscriptionResponse401 + | DeleteSubscriptionResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + DeleteSubscriptionResponse200 + | DeleteSubscriptionResponse400 + | DeleteSubscriptionResponse401 + | DeleteSubscriptionResponse404 +]: + """Delete subscription + + This endpoint deletes a subscription + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteSubscriptionResponse200 | DeleteSubscriptionResponse400 | DeleteSubscriptionResponse401 | DeleteSubscriptionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> ( + DeleteSubscriptionResponse200 + | DeleteSubscriptionResponse400 + | DeleteSubscriptionResponse401 + | DeleteSubscriptionResponse404 + | None +): + """Delete subscription + + This endpoint deletes a subscription + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteSubscriptionResponse200 | DeleteSubscriptionResponse400 | DeleteSubscriptionResponse401 | DeleteSubscriptionResponse404 + """ + + return sync_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + DeleteSubscriptionResponse200 + | DeleteSubscriptionResponse400 + | DeleteSubscriptionResponse401 + | DeleteSubscriptionResponse404 +]: + """Delete subscription + + This endpoint deletes a subscription + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[DeleteSubscriptionResponse200 | DeleteSubscriptionResponse400 | DeleteSubscriptionResponse401 | DeleteSubscriptionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> ( + DeleteSubscriptionResponse200 + | DeleteSubscriptionResponse400 + | DeleteSubscriptionResponse401 + | DeleteSubscriptionResponse404 + | None +): + """Delete subscription + + This endpoint deletes a subscription + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + DeleteSubscriptionResponse200 | DeleteSubscriptionResponse400 | DeleteSubscriptionResponse401 | DeleteSubscriptionResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/subscriptions/get_subscription.py b/src/convoy/api/subscriptions/get_subscription.py new file mode 100644 index 0000000..5d7c747 --- /dev/null +++ b/src/convoy/api/subscriptions/get_subscription.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_subscription_response_200 import GetSubscriptionResponse200 +from ...models.get_subscription_response_400 import GetSubscriptionResponse400 +from ...models.get_subscription_response_401 import GetSubscriptionResponse401 +from ...models.get_subscription_response_404 import GetSubscriptionResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + subscription_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/subscriptions/{subscription_id}".format( + project_id=quote(str(project_id), safe=""), + subscription_id=quote(str(subscription_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetSubscriptionResponse200 + | GetSubscriptionResponse400 + | GetSubscriptionResponse401 + | GetSubscriptionResponse404 + | None +): + if response.status_code == 200: + response_200 = GetSubscriptionResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetSubscriptionResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetSubscriptionResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetSubscriptionResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetSubscriptionResponse200 + | GetSubscriptionResponse400 + | GetSubscriptionResponse401 + | GetSubscriptionResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetSubscriptionResponse200 + | GetSubscriptionResponse400 + | GetSubscriptionResponse401 + | GetSubscriptionResponse404 +]: + """Retrieve a subscription + + This endpoint retrieves a single subscription + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetSubscriptionResponse200 | GetSubscriptionResponse400 | GetSubscriptionResponse401 | GetSubscriptionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetSubscriptionResponse200 + | GetSubscriptionResponse400 + | GetSubscriptionResponse401 + | GetSubscriptionResponse404 + | None +): + """Retrieve a subscription + + This endpoint retrieves a single subscription + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetSubscriptionResponse200 | GetSubscriptionResponse400 | GetSubscriptionResponse401 | GetSubscriptionResponse404 + """ + + return sync_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + GetSubscriptionResponse200 + | GetSubscriptionResponse400 + | GetSubscriptionResponse401 + | GetSubscriptionResponse404 +]: + """Retrieve a subscription + + This endpoint retrieves a single subscription + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetSubscriptionResponse200 | GetSubscriptionResponse400 | GetSubscriptionResponse401 | GetSubscriptionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> ( + GetSubscriptionResponse200 + | GetSubscriptionResponse400 + | GetSubscriptionResponse401 + | GetSubscriptionResponse404 + | None +): + """Retrieve a subscription + + This endpoint retrieves a single subscription + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetSubscriptionResponse200 | GetSubscriptionResponse400 | GetSubscriptionResponse401 | GetSubscriptionResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/subscriptions/get_subscriptions.py b/src/convoy/api/subscriptions/get_subscriptions.py new file mode 100644 index 0000000..a54ed6a --- /dev/null +++ b/src/convoy/api/subscriptions/get_subscriptions.py @@ -0,0 +1,334 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.get_subscriptions_direction import GetSubscriptionsDirection +from ...models.get_subscriptions_response_200 import GetSubscriptionsResponse200 +from ...models.get_subscriptions_response_400 import GetSubscriptionsResponse400 +from ...models.get_subscriptions_response_401 import GetSubscriptionsResponse401 +from ...models.get_subscriptions_response_404 import GetSubscriptionsResponse404 +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + project_id: str, + *, + direction: GetSubscriptionsDirection | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + name: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + json_direction: str | Unset = UNSET + if not isinstance(direction, Unset): + json_direction = direction.value + + params["direction"] = json_direction + + json_endpoint_id: list[str] | Unset = UNSET + if not isinstance(endpoint_id, Unset): + json_endpoint_id = endpoint_id + + params["endpointId"] = json_endpoint_id + + params["name"] = name + + params["next_page_cursor"] = next_page_cursor + + params["perPage"] = per_page + + params["prev_page_cursor"] = prev_page_cursor + + params["sort"] = sort + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/projects/{project_id}/subscriptions".format( + project_id=quote(str(project_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + GetSubscriptionsResponse200 + | GetSubscriptionsResponse400 + | GetSubscriptionsResponse401 + | GetSubscriptionsResponse404 + | None +): + if response.status_code == 200: + response_200 = GetSubscriptionsResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = GetSubscriptionsResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = GetSubscriptionsResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = GetSubscriptionsResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + GetSubscriptionsResponse200 + | GetSubscriptionsResponse400 + | GetSubscriptionsResponse401 + | GetSubscriptionsResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetSubscriptionsDirection | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + name: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> Response[ + GetSubscriptionsResponse200 + | GetSubscriptionsResponse400 + | GetSubscriptionsResponse401 + | GetSubscriptionsResponse404 +]: + """List all subscriptions + + This endpoint fetches all the subscriptions + + Args: + project_id (str): + direction (GetSubscriptionsDirection | Unset): + endpoint_id (list[str] | Unset): + name (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetSubscriptionsResponse200 | GetSubscriptionsResponse400 | GetSubscriptionsResponse401 | GetSubscriptionsResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + endpoint_id=endpoint_id, + name=name, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetSubscriptionsDirection | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + name: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> ( + GetSubscriptionsResponse200 + | GetSubscriptionsResponse400 + | GetSubscriptionsResponse401 + | GetSubscriptionsResponse404 + | None +): + """List all subscriptions + + This endpoint fetches all the subscriptions + + Args: + project_id (str): + direction (GetSubscriptionsDirection | Unset): + endpoint_id (list[str] | Unset): + name (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetSubscriptionsResponse200 | GetSubscriptionsResponse400 | GetSubscriptionsResponse401 | GetSubscriptionsResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + direction=direction, + endpoint_id=endpoint_id, + name=name, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetSubscriptionsDirection | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + name: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> Response[ + GetSubscriptionsResponse200 + | GetSubscriptionsResponse400 + | GetSubscriptionsResponse401 + | GetSubscriptionsResponse404 +]: + """List all subscriptions + + This endpoint fetches all the subscriptions + + Args: + project_id (str): + direction (GetSubscriptionsDirection | Unset): + endpoint_id (list[str] | Unset): + name (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[GetSubscriptionsResponse200 | GetSubscriptionsResponse400 | GetSubscriptionsResponse401 | GetSubscriptionsResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + direction=direction, + endpoint_id=endpoint_id, + name=name, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + direction: GetSubscriptionsDirection | Unset = UNSET, + endpoint_id: list[str] | Unset = UNSET, + name: str | Unset = UNSET, + next_page_cursor: str | Unset = UNSET, + per_page: int | Unset = UNSET, + prev_page_cursor: str | Unset = UNSET, + sort: str | Unset = UNSET, +) -> ( + GetSubscriptionsResponse200 + | GetSubscriptionsResponse400 + | GetSubscriptionsResponse401 + | GetSubscriptionsResponse404 + | None +): + """List all subscriptions + + This endpoint fetches all the subscriptions + + Args: + project_id (str): + direction (GetSubscriptionsDirection | Unset): + endpoint_id (list[str] | Unset): + name (str | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + sort (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + GetSubscriptionsResponse200 | GetSubscriptionsResponse400 | GetSubscriptionsResponse401 | GetSubscriptionsResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + direction=direction, + endpoint_id=endpoint_id, + name=name, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + sort=sort, + ) + ).parsed diff --git a/src/convoy/api/subscriptions/post_v_1_projects_project_id_sources_test_function.py b/src/convoy/api/subscriptions/post_v_1_projects_project_id_sources_test_function.py new file mode 100644 index 0000000..024f9d1 --- /dev/null +++ b/src/convoy/api/subscriptions/post_v_1_projects_project_id_sources_test_function.py @@ -0,0 +1,251 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.models_function_request import ModelsFunctionRequest +from ...models.post_v1_projects_project_id_sources_test_function_response_200 import ( + PostV1ProjectsProjectIDSourcesTestFunctionResponse200, +) +from ...models.post_v1_projects_project_id_sources_test_function_response_400 import ( + PostV1ProjectsProjectIDSourcesTestFunctionResponse400, +) +from ...models.post_v1_projects_project_id_sources_test_function_response_401 import ( + PostV1ProjectsProjectIDSourcesTestFunctionResponse401, +) +from ...models.post_v1_projects_project_id_sources_test_function_response_404 import ( + PostV1ProjectsProjectIDSourcesTestFunctionResponse404, +) +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsFunctionRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/sources/test_function".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + PostV1ProjectsProjectIDSourcesTestFunctionResponse200 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse400 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse401 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse404 + | None +): + if response.status_code == 200: + response_200 = PostV1ProjectsProjectIDSourcesTestFunctionResponse200.from_dict( + response.json() + ) + + return response_200 + + if response.status_code == 400: + response_400 = PostV1ProjectsProjectIDSourcesTestFunctionResponse400.from_dict( + response.json() + ) + + return response_400 + + if response.status_code == 401: + response_401 = PostV1ProjectsProjectIDSourcesTestFunctionResponse401.from_dict( + response.json() + ) + + return response_401 + + if response.status_code == 404: + response_404 = PostV1ProjectsProjectIDSourcesTestFunctionResponse404.from_dict( + response.json() + ) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + PostV1ProjectsProjectIDSourcesTestFunctionResponse200 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse400 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse401 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsFunctionRequest, +) -> Response[ + PostV1ProjectsProjectIDSourcesTestFunctionResponse200 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse400 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse401 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse404 +]: + """Validate source function + + This endpoint validates that a filter will match a certain payload structure. + + Args: + project_id (str): + body (ModelsFunctionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PostV1ProjectsProjectIDSourcesTestFunctionResponse200 | PostV1ProjectsProjectIDSourcesTestFunctionResponse400 | PostV1ProjectsProjectIDSourcesTestFunctionResponse401 | PostV1ProjectsProjectIDSourcesTestFunctionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsFunctionRequest, +) -> ( + PostV1ProjectsProjectIDSourcesTestFunctionResponse200 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse400 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse401 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse404 + | None +): + """Validate source function + + This endpoint validates that a filter will match a certain payload structure. + + Args: + project_id (str): + body (ModelsFunctionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PostV1ProjectsProjectIDSourcesTestFunctionResponse200 | PostV1ProjectsProjectIDSourcesTestFunctionResponse400 | PostV1ProjectsProjectIDSourcesTestFunctionResponse401 | PostV1ProjectsProjectIDSourcesTestFunctionResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsFunctionRequest, +) -> Response[ + PostV1ProjectsProjectIDSourcesTestFunctionResponse200 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse400 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse401 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse404 +]: + """Validate source function + + This endpoint validates that a filter will match a certain payload structure. + + Args: + project_id (str): + body (ModelsFunctionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PostV1ProjectsProjectIDSourcesTestFunctionResponse200 | PostV1ProjectsProjectIDSourcesTestFunctionResponse400 | PostV1ProjectsProjectIDSourcesTestFunctionResponse401 | PostV1ProjectsProjectIDSourcesTestFunctionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsFunctionRequest, +) -> ( + PostV1ProjectsProjectIDSourcesTestFunctionResponse200 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse400 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse401 + | PostV1ProjectsProjectIDSourcesTestFunctionResponse404 + | None +): + """Validate source function + + This endpoint validates that a filter will match a certain payload structure. + + Args: + project_id (str): + body (ModelsFunctionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PostV1ProjectsProjectIDSourcesTestFunctionResponse200 | PostV1ProjectsProjectIDSourcesTestFunctionResponse400 | PostV1ProjectsProjectIDSourcesTestFunctionResponse401 | PostV1ProjectsProjectIDSourcesTestFunctionResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/subscriptions/test_subscription_filter.py b/src/convoy/api/subscriptions/test_subscription_filter.py new file mode 100644 index 0000000..4f3d57e --- /dev/null +++ b/src/convoy/api/subscriptions/test_subscription_filter.py @@ -0,0 +1,243 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.models_test_filter import ModelsTestFilter +from ...models.test_subscription_filter_response_200 import ( + TestSubscriptionFilterResponse200, +) +from ...models.test_subscription_filter_response_400 import ( + TestSubscriptionFilterResponse400, +) +from ...models.test_subscription_filter_response_401 import ( + TestSubscriptionFilterResponse401, +) +from ...models.test_subscription_filter_response_404 import ( + TestSubscriptionFilterResponse404, +) +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsTestFilter, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/subscriptions/test_filter".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + TestSubscriptionFilterResponse200 + | TestSubscriptionFilterResponse400 + | TestSubscriptionFilterResponse401 + | TestSubscriptionFilterResponse404 + | None +): + if response.status_code == 200: + response_200 = TestSubscriptionFilterResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = TestSubscriptionFilterResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = TestSubscriptionFilterResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = TestSubscriptionFilterResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + TestSubscriptionFilterResponse200 + | TestSubscriptionFilterResponse400 + | TestSubscriptionFilterResponse401 + | TestSubscriptionFilterResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsTestFilter, +) -> Response[ + TestSubscriptionFilterResponse200 + | TestSubscriptionFilterResponse400 + | TestSubscriptionFilterResponse401 + | TestSubscriptionFilterResponse404 +]: + """Validate subscription filter + + This endpoint validates that a filter will match a certain payload structure. + + Args: + project_id (str): + body (ModelsTestFilter): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TestSubscriptionFilterResponse200 | TestSubscriptionFilterResponse400 | TestSubscriptionFilterResponse401 | TestSubscriptionFilterResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsTestFilter, +) -> ( + TestSubscriptionFilterResponse200 + | TestSubscriptionFilterResponse400 + | TestSubscriptionFilterResponse401 + | TestSubscriptionFilterResponse404 + | None +): + """Validate subscription filter + + This endpoint validates that a filter will match a certain payload structure. + + Args: + project_id (str): + body (ModelsTestFilter): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TestSubscriptionFilterResponse200 | TestSubscriptionFilterResponse400 | TestSubscriptionFilterResponse401 | TestSubscriptionFilterResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsTestFilter, +) -> Response[ + TestSubscriptionFilterResponse200 + | TestSubscriptionFilterResponse400 + | TestSubscriptionFilterResponse401 + | TestSubscriptionFilterResponse404 +]: + """Validate subscription filter + + This endpoint validates that a filter will match a certain payload structure. + + Args: + project_id (str): + body (ModelsTestFilter): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TestSubscriptionFilterResponse200 | TestSubscriptionFilterResponse400 | TestSubscriptionFilterResponse401 | TestSubscriptionFilterResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsTestFilter, +) -> ( + TestSubscriptionFilterResponse200 + | TestSubscriptionFilterResponse400 + | TestSubscriptionFilterResponse401 + | TestSubscriptionFilterResponse404 + | None +): + """Validate subscription filter + + This endpoint validates that a filter will match a certain payload structure. + + Args: + project_id (str): + body (ModelsTestFilter): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TestSubscriptionFilterResponse200 | TestSubscriptionFilterResponse400 | TestSubscriptionFilterResponse401 | TestSubscriptionFilterResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/subscriptions/test_subscription_function.py b/src/convoy/api/subscriptions/test_subscription_function.py new file mode 100644 index 0000000..d532bff --- /dev/null +++ b/src/convoy/api/subscriptions/test_subscription_function.py @@ -0,0 +1,243 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.models_function_request import ModelsFunctionRequest +from ...models.test_subscription_function_response_200 import ( + TestSubscriptionFunctionResponse200, +) +from ...models.test_subscription_function_response_400 import ( + TestSubscriptionFunctionResponse400, +) +from ...models.test_subscription_function_response_401 import ( + TestSubscriptionFunctionResponse401, +) +from ...models.test_subscription_function_response_404 import ( + TestSubscriptionFunctionResponse404, +) +from ...types import Response + + +def _get_kwargs( + project_id: str, + *, + body: ModelsFunctionRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/projects/{project_id}/subscriptions/test_function".format( + project_id=quote(str(project_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + TestSubscriptionFunctionResponse200 + | TestSubscriptionFunctionResponse400 + | TestSubscriptionFunctionResponse401 + | TestSubscriptionFunctionResponse404 + | None +): + if response.status_code == 200: + response_200 = TestSubscriptionFunctionResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = TestSubscriptionFunctionResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = TestSubscriptionFunctionResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = TestSubscriptionFunctionResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + TestSubscriptionFunctionResponse200 + | TestSubscriptionFunctionResponse400 + | TestSubscriptionFunctionResponse401 + | TestSubscriptionFunctionResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsFunctionRequest, +) -> Response[ + TestSubscriptionFunctionResponse200 + | TestSubscriptionFunctionResponse400 + | TestSubscriptionFunctionResponse401 + | TestSubscriptionFunctionResponse404 +]: + """Test a subscription function + + This endpoint test runs a transform function against a payload. + + Args: + project_id (str): + body (ModelsFunctionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TestSubscriptionFunctionResponse200 | TestSubscriptionFunctionResponse400 | TestSubscriptionFunctionResponse401 | TestSubscriptionFunctionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsFunctionRequest, +) -> ( + TestSubscriptionFunctionResponse200 + | TestSubscriptionFunctionResponse400 + | TestSubscriptionFunctionResponse401 + | TestSubscriptionFunctionResponse404 + | None +): + """Test a subscription function + + This endpoint test runs a transform function against a payload. + + Args: + project_id (str): + body (ModelsFunctionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TestSubscriptionFunctionResponse200 | TestSubscriptionFunctionResponse400 | TestSubscriptionFunctionResponse401 | TestSubscriptionFunctionResponse404 + """ + + return sync_detailed( + project_id=project_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsFunctionRequest, +) -> Response[ + TestSubscriptionFunctionResponse200 + | TestSubscriptionFunctionResponse400 + | TestSubscriptionFunctionResponse401 + | TestSubscriptionFunctionResponse404 +]: + """Test a subscription function + + This endpoint test runs a transform function against a payload. + + Args: + project_id (str): + body (ModelsFunctionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[TestSubscriptionFunctionResponse200 | TestSubscriptionFunctionResponse400 | TestSubscriptionFunctionResponse401 | TestSubscriptionFunctionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + *, + client: AuthenticatedClient, + body: ModelsFunctionRequest, +) -> ( + TestSubscriptionFunctionResponse200 + | TestSubscriptionFunctionResponse400 + | TestSubscriptionFunctionResponse401 + | TestSubscriptionFunctionResponse404 + | None +): + """Test a subscription function + + This endpoint test runs a transform function against a payload. + + Args: + project_id (str): + body (ModelsFunctionRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + TestSubscriptionFunctionResponse200 | TestSubscriptionFunctionResponse400 | TestSubscriptionFunctionResponse401 | TestSubscriptionFunctionResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/api/subscriptions/toggle_subscription_status.py b/src/convoy/api/subscriptions/toggle_subscription_status.py new file mode 100644 index 0000000..4e0e918 --- /dev/null +++ b/src/convoy/api/subscriptions/toggle_subscription_status.py @@ -0,0 +1,236 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.toggle_subscription_status_response_202 import ( + ToggleSubscriptionStatusResponse202, +) +from ...models.toggle_subscription_status_response_400 import ( + ToggleSubscriptionStatusResponse400, +) +from ...models.toggle_subscription_status_response_401 import ( + ToggleSubscriptionStatusResponse401, +) +from ...models.toggle_subscription_status_response_404 import ( + ToggleSubscriptionStatusResponse404, +) +from ...types import Response + + +def _get_kwargs( + project_id: str, + subscription_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/subscriptions/{subscription_id}/toggle_status".format( + project_id=quote(str(project_id), safe=""), + subscription_id=quote(str(subscription_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + ToggleSubscriptionStatusResponse202 + | ToggleSubscriptionStatusResponse400 + | ToggleSubscriptionStatusResponse401 + | ToggleSubscriptionStatusResponse404 + | None +): + if response.status_code == 202: + response_202 = ToggleSubscriptionStatusResponse202.from_dict(response.json()) + + return response_202 + + if response.status_code == 400: + response_400 = ToggleSubscriptionStatusResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = ToggleSubscriptionStatusResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = ToggleSubscriptionStatusResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + ToggleSubscriptionStatusResponse202 + | ToggleSubscriptionStatusResponse400 + | ToggleSubscriptionStatusResponse401 + | ToggleSubscriptionStatusResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + ToggleSubscriptionStatusResponse202 + | ToggleSubscriptionStatusResponse400 + | ToggleSubscriptionStatusResponse401 + | ToggleSubscriptionStatusResponse404 +]: + """Toggle subscription status + + This endpoint toggles a subscription status. Retained for backward compatibility. + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ToggleSubscriptionStatusResponse202 | ToggleSubscriptionStatusResponse400 | ToggleSubscriptionStatusResponse401 | ToggleSubscriptionStatusResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> ( + ToggleSubscriptionStatusResponse202 + | ToggleSubscriptionStatusResponse400 + | ToggleSubscriptionStatusResponse401 + | ToggleSubscriptionStatusResponse404 + | None +): + """Toggle subscription status + + This endpoint toggles a subscription status. Retained for backward compatibility. + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ToggleSubscriptionStatusResponse202 | ToggleSubscriptionStatusResponse400 | ToggleSubscriptionStatusResponse401 | ToggleSubscriptionStatusResponse404 + """ + + return sync_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + ).parsed + + +async def asyncio_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> Response[ + ToggleSubscriptionStatusResponse202 + | ToggleSubscriptionStatusResponse400 + | ToggleSubscriptionStatusResponse401 + | ToggleSubscriptionStatusResponse404 +]: + """Toggle subscription status + + This endpoint toggles a subscription status. Retained for backward compatibility. + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ToggleSubscriptionStatusResponse202 | ToggleSubscriptionStatusResponse400 | ToggleSubscriptionStatusResponse401 | ToggleSubscriptionStatusResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, +) -> ( + ToggleSubscriptionStatusResponse202 + | ToggleSubscriptionStatusResponse400 + | ToggleSubscriptionStatusResponse401 + | ToggleSubscriptionStatusResponse404 + | None +): + """Toggle subscription status + + This endpoint toggles a subscription status. Retained for backward compatibility. + + Args: + project_id (str): + subscription_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ToggleSubscriptionStatusResponse202 | ToggleSubscriptionStatusResponse400 | ToggleSubscriptionStatusResponse401 | ToggleSubscriptionStatusResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + ) + ).parsed diff --git a/src/convoy/api/subscriptions/update_subscription.py b/src/convoy/api/subscriptions/update_subscription.py new file mode 100644 index 0000000..69d0fe6 --- /dev/null +++ b/src/convoy/api/subscriptions/update_subscription.py @@ -0,0 +1,249 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.models_update_subscription import ModelsUpdateSubscription +from ...models.update_subscription_response_202 import UpdateSubscriptionResponse202 +from ...models.update_subscription_response_400 import UpdateSubscriptionResponse400 +from ...models.update_subscription_response_401 import UpdateSubscriptionResponse401 +from ...models.update_subscription_response_404 import UpdateSubscriptionResponse404 +from ...types import Response + + +def _get_kwargs( + project_id: str, + subscription_id: str, + *, + body: ModelsUpdateSubscription, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/projects/{project_id}/subscriptions/{subscription_id}".format( + project_id=quote(str(project_id), safe=""), + subscription_id=quote(str(subscription_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ( + UpdateSubscriptionResponse202 + | UpdateSubscriptionResponse400 + | UpdateSubscriptionResponse401 + | UpdateSubscriptionResponse404 + | None +): + if response.status_code == 202: + response_202 = UpdateSubscriptionResponse202.from_dict(response.json()) + + return response_202 + + if response.status_code == 400: + response_400 = UpdateSubscriptionResponse400.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = UpdateSubscriptionResponse401.from_dict(response.json()) + + return response_401 + + if response.status_code == 404: + response_404 = UpdateSubscriptionResponse404.from_dict(response.json()) + + return response_404 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ + UpdateSubscriptionResponse202 + | UpdateSubscriptionResponse400 + | UpdateSubscriptionResponse401 + | UpdateSubscriptionResponse404 +]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateSubscription, +) -> Response[ + UpdateSubscriptionResponse202 + | UpdateSubscriptionResponse400 + | UpdateSubscriptionResponse401 + | UpdateSubscriptionResponse404 +]: + """Update a subscription + + This endpoint updates a subscription + + Args: + project_id (str): + subscription_id (str): + body (ModelsUpdateSubscription): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdateSubscriptionResponse202 | UpdateSubscriptionResponse400 | UpdateSubscriptionResponse401 | UpdateSubscriptionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateSubscription, +) -> ( + UpdateSubscriptionResponse202 + | UpdateSubscriptionResponse400 + | UpdateSubscriptionResponse401 + | UpdateSubscriptionResponse404 + | None +): + """Update a subscription + + This endpoint updates a subscription + + Args: + project_id (str): + subscription_id (str): + body (ModelsUpdateSubscription): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdateSubscriptionResponse202 | UpdateSubscriptionResponse400 | UpdateSubscriptionResponse401 | UpdateSubscriptionResponse404 + """ + + return sync_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateSubscription, +) -> Response[ + UpdateSubscriptionResponse202 + | UpdateSubscriptionResponse400 + | UpdateSubscriptionResponse401 + | UpdateSubscriptionResponse404 +]: + """Update a subscription + + This endpoint updates a subscription + + Args: + project_id (str): + subscription_id (str): + body (ModelsUpdateSubscription): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[UpdateSubscriptionResponse202 | UpdateSubscriptionResponse400 | UpdateSubscriptionResponse401 | UpdateSubscriptionResponse404] + """ + + kwargs = _get_kwargs( + project_id=project_id, + subscription_id=subscription_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + project_id: str, + subscription_id: str, + *, + client: AuthenticatedClient, + body: ModelsUpdateSubscription, +) -> ( + UpdateSubscriptionResponse202 + | UpdateSubscriptionResponse400 + | UpdateSubscriptionResponse401 + | UpdateSubscriptionResponse404 + | None +): + """Update a subscription + + This endpoint updates a subscription + + Args: + project_id (str): + subscription_id (str): + body (ModelsUpdateSubscription): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + UpdateSubscriptionResponse202 | UpdateSubscriptionResponse400 | UpdateSubscriptionResponse401 | UpdateSubscriptionResponse404 + """ + + return ( + await asyncio_detailed( + project_id=project_id, + subscription_id=subscription_id, + client=client, + body=body, + ) + ).parsed diff --git a/src/convoy/client.py b/src/convoy/client.py new file mode 100644 index 0000000..0ab1589 --- /dev/null +++ b/src/convoy/client.py @@ -0,0 +1,282 @@ +import ssl +from typing import Any + +import httpx +from attrs import define, evolve, field + + +@define +class Client: + """A class for keeping track of data related to the API + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + def with_headers(self, headers: dict[str, str]) -> "Client": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "Client": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "Client": + """Get a new client matching this one with a new timeout configuration""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "Client": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "Client": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": + """Manually set the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "Client": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) + + +@define +class AuthenticatedClient: + """A Client which has been authenticated for use on secured endpoints + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + token: The token to use for authentication + prefix: The prefix to use for the Authorization header + auth_header_name: The name of the Authorization header + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str = field(alias="base_url") + _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") + _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") + _timeout: httpx.Timeout | None = field(default=None, kw_only=True, alias="timeout") + _verify_ssl: str | bool | ssl.SSLContext = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) + _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") + _client: httpx.Client | None = field(default=None, init=False) + _async_client: httpx.AsyncClient | None = field(default=None, init=False) + + token: str + prefix: str = "Bearer" + auth_header_name: str = "Authorization" + + def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": + """Get a new client matching this one with a new timeout configuration""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": + """Manually set the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "AuthenticatedClient": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client( + self, async_client: httpx.AsyncClient + ) -> "AuthenticatedClient": + """Manually set the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "AuthenticatedClient": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/src/convoy/errors.py b/src/convoy/errors.py new file mode 100644 index 0000000..5f92e76 --- /dev/null +++ b/src/convoy/errors.py @@ -0,0 +1,16 @@ +"""Contains shared errors types that can be raised from API functions""" + + +class UnexpectedStatus(Exception): + """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" + + def __init__(self, status_code: int, content: bytes): + self.status_code = status_code + self.content = content + + super().__init__( + f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" + ) + + +__all__ = ["UnexpectedStatus"] diff --git a/src/convoy/models/__init__.py b/src/convoy/models/__init__.py new file mode 100644 index 0000000..71550e4 --- /dev/null +++ b/src/convoy/models/__init__.py @@ -0,0 +1,955 @@ +"""Contains all the data models used in inputs/outputs""" + +from .activate_endpoint_response_202 import ActivateEndpointResponse202 +from .activate_endpoint_response_400 import ActivateEndpointResponse400 +from .activate_endpoint_response_401 import ActivateEndpointResponse401 +from .activate_endpoint_response_404 import ActivateEndpointResponse404 +from .auth_role_type import AuthRoleType +from .batch_replay_events_direction import BatchReplayEventsDirection +from .batch_replay_events_response_200 import BatchReplayEventsResponse200 +from .batch_replay_events_response_400 import BatchReplayEventsResponse400 +from .batch_replay_events_response_401 import BatchReplayEventsResponse401 +from .batch_replay_events_response_404 import BatchReplayEventsResponse404 +from .batch_retry_event_delivery_direction import BatchRetryEventDeliveryDirection +from .batch_retry_event_delivery_response_200 import BatchRetryEventDeliveryResponse200 +from .batch_retry_event_delivery_response_400 import BatchRetryEventDeliveryResponse400 +from .batch_retry_event_delivery_response_401 import BatchRetryEventDeliveryResponse401 +from .batch_retry_event_delivery_response_404 import BatchRetryEventDeliveryResponse404 +from .bulk_create_filters_response_201 import BulkCreateFiltersResponse201 +from .bulk_create_filters_response_400 import BulkCreateFiltersResponse400 +from .bulk_create_filters_response_401 import BulkCreateFiltersResponse401 +from .bulk_create_filters_response_404 import BulkCreateFiltersResponse404 +from .bulk_onboard_response_200 import BulkOnboardResponse200 +from .bulk_onboard_response_202 import BulkOnboardResponse202 +from .bulk_onboard_response_400 import BulkOnboardResponse400 +from .bulk_onboard_response_401 import BulkOnboardResponse401 +from .bulk_onboard_response_404 import BulkOnboardResponse404 +from .bulk_update_filters_response_200 import BulkUpdateFiltersResponse200 +from .bulk_update_filters_response_400 import BulkUpdateFiltersResponse400 +from .bulk_update_filters_response_401 import BulkUpdateFiltersResponse401 +from .bulk_update_filters_response_404 import BulkUpdateFiltersResponse404 +from .config_request_id_header_provider import ConfigRequestIDHeaderProvider +from .config_signature_header_provider import ConfigSignatureHeaderProvider +from .count_affected_events_direction import CountAffectedEventsDirection +from .count_affected_events_response_200 import CountAffectedEventsResponse200 +from .count_affected_events_response_400 import CountAffectedEventsResponse400 +from .count_affected_events_response_401 import CountAffectedEventsResponse401 +from .count_affected_events_response_404 import CountAffectedEventsResponse404 +from .create_broadcast_event_response_201 import CreateBroadcastEventResponse201 +from .create_broadcast_event_response_400 import CreateBroadcastEventResponse400 +from .create_broadcast_event_response_401 import CreateBroadcastEventResponse401 +from .create_broadcast_event_response_404 import CreateBroadcastEventResponse404 +from .create_dynamic_event_response_400 import CreateDynamicEventResponse400 +from .create_dynamic_event_response_401 import CreateDynamicEventResponse401 +from .create_dynamic_event_response_404 import CreateDynamicEventResponse404 +from .create_endpoint_event_response_201 import CreateEndpointEventResponse201 +from .create_endpoint_event_response_400 import CreateEndpointEventResponse400 +from .create_endpoint_event_response_401 import CreateEndpointEventResponse401 +from .create_endpoint_event_response_404 import CreateEndpointEventResponse404 +from .create_endpoint_fanout_event_response_201 import ( + CreateEndpointFanoutEventResponse201, +) +from .create_endpoint_fanout_event_response_400 import ( + CreateEndpointFanoutEventResponse400, +) +from .create_endpoint_fanout_event_response_401 import ( + CreateEndpointFanoutEventResponse401, +) +from .create_endpoint_fanout_event_response_404 import ( + CreateEndpointFanoutEventResponse404, +) +from .create_endpoint_response_201 import CreateEndpointResponse201 +from .create_endpoint_response_400 import CreateEndpointResponse400 +from .create_endpoint_response_401 import CreateEndpointResponse401 +from .create_endpoint_response_404 import CreateEndpointResponse404 +from .create_event_type_response_201 import CreateEventTypeResponse201 +from .create_event_type_response_400 import CreateEventTypeResponse400 +from .create_event_type_response_401 import CreateEventTypeResponse401 +from .create_event_type_response_404 import CreateEventTypeResponse404 +from .create_filter_response_201 import CreateFilterResponse201 +from .create_filter_response_400 import CreateFilterResponse400 +from .create_filter_response_401 import CreateFilterResponse401 +from .create_filter_response_404 import CreateFilterResponse404 +from .create_portal_link_response_201 import CreatePortalLinkResponse201 +from .create_portal_link_response_400 import CreatePortalLinkResponse400 +from .create_portal_link_response_401 import CreatePortalLinkResponse401 +from .create_portal_link_response_404 import CreatePortalLinkResponse404 +from .create_project_response_201 import CreateProjectResponse201 +from .create_project_response_400 import CreateProjectResponse400 +from .create_project_response_401 import CreateProjectResponse401 +from .create_project_response_402 import CreateProjectResponse402 +from .create_project_response_403 import CreateProjectResponse403 +from .create_project_response_404 import CreateProjectResponse404 +from .create_source_response_201 import CreateSourceResponse201 +from .create_source_response_400 import CreateSourceResponse400 +from .create_source_response_401 import CreateSourceResponse401 +from .create_source_response_404 import CreateSourceResponse404 +from .create_subscription_response_201 import CreateSubscriptionResponse201 +from .create_subscription_response_400 import CreateSubscriptionResponse400 +from .create_subscription_response_401 import CreateSubscriptionResponse401 +from .create_subscription_response_404 import CreateSubscriptionResponse404 +from .datastore_alert_configuration import DatastoreAlertConfiguration +from .datastore_amqp_credentials import DatastoreAmqpCredentials +from .datastore_amqp_pub_sub_config import DatastoreAmqpPubSubConfig +from .datastore_api_key import DatastoreApiKey +from .datastore_api_key_response import DatastoreAPIKeyResponse +from .datastore_basic_auth import DatastoreBasicAuth +from .datastore_circuit_breaker_configuration import ( + DatastoreCircuitBreakerConfiguration, +) +from .datastore_cli_metadata import DatastoreCLIMetadata +from .datastore_create_portal_link_request import DatastoreCreatePortalLinkRequest +from .datastore_custom_response import DatastoreCustomResponse +from .datastore_delivery_attempt import DatastoreDeliveryAttempt +from .datastore_delivery_mode import DatastoreDeliveryMode +from .datastore_device import DatastoreDevice +from .datastore_device_status import DatastoreDeviceStatus +from .datastore_encoding_type import DatastoreEncodingType +from .datastore_endpoint import DatastoreEndpoint +from .datastore_endpoint_authentication import DatastoreEndpointAuthentication +from .datastore_endpoint_authentication_type import DatastoreEndpointAuthenticationType +from .datastore_endpoint_status import DatastoreEndpointStatus +from .datastore_event import DatastoreEvent +from .datastore_event_delivery_status import DatastoreEventDeliveryStatus +from .datastore_event_status import DatastoreEventStatus +from .datastore_filter_configuration import DatastoreFilterConfiguration +from .datastore_filter_schema import DatastoreFilterSchema +from .datastore_google_pub_sub_config import DatastoreGooglePubSubConfig +from .datastore_h_mac import DatastoreHMac +from .datastore_http_header import DatastoreHttpHeader +from .datastore_kafka_auth import DatastoreKafkaAuth +from .datastore_kafka_pub_sub_config import DatastoreKafkaPubSubConfig +from .datastore_m import DatastoreM +from .datastore_meta_event_attempt import DatastoreMetaEventAttempt +from .datastore_meta_event_configuration import DatastoreMetaEventConfiguration +from .datastore_meta_event_type import DatastoreMetaEventType +from .datastore_metadata import DatastoreMetadata +from .datastore_mtls_client_cert import DatastoreMtlsClientCert +from .datastore_o_auth_2 import DatastoreOAuth2 +from .datastore_o_auth_2_authentication_type import DatastoreOAuth2AuthenticationType +from .datastore_o_auth_2_expiry_time_unit import DatastoreOAuth2ExpiryTimeUnit +from .datastore_o_auth_2_field_mapping import DatastoreOAuth2FieldMapping +from .datastore_o_auth_2_signing_key import DatastoreOAuth2SigningKey +from .datastore_page_direction import DatastorePageDirection +from .datastore_pagination_data import DatastorePaginationData +from .datastore_portal_auth_type import DatastorePortalAuthType +from .datastore_portal_link_response import DatastorePortalLinkResponse +from .datastore_project_config import DatastoreProjectConfig +from .datastore_project_statistics import DatastoreProjectStatistics +from .datastore_project_type import DatastoreProjectType +from .datastore_provider_config import DatastoreProviderConfig +from .datastore_pub_sub_config import DatastorePubSubConfig +from .datastore_pub_sub_type import DatastorePubSubType +from .datastore_rate_limit_configuration import DatastoreRateLimitConfiguration +from .datastore_retry_configuration import DatastoreRetryConfiguration +from .datastore_role import DatastoreRole +from .datastore_secret import DatastoreSecret +from .datastore_signature_configuration import DatastoreSignatureConfiguration +from .datastore_signature_version import DatastoreSignatureVersion +from .datastore_source import DatastoreSource +from .datastore_source_provider import DatastoreSourceProvider +from .datastore_source_type import DatastoreSourceType +from .datastore_sqs_pub_sub_config import DatastoreSQSPubSubConfig +from .datastore_ssl_configuration import DatastoreSSLConfiguration +from .datastore_strategy_configuration import DatastoreStrategyConfiguration +from .datastore_strategy_provider import DatastoreStrategyProvider +from .datastore_subscription_type import DatastoreSubscriptionType +from .datastore_twitter_provider_config import DatastoreTwitterProviderConfig +from .datastore_update_portal_link_request import DatastoreUpdatePortalLinkRequest +from .datastore_verifier_config import DatastoreVerifierConfig +from .datastore_verifier_type import DatastoreVerifierType +from .delete_endpoint_response_200 import DeleteEndpointResponse200 +from .delete_endpoint_response_400 import DeleteEndpointResponse400 +from .delete_endpoint_response_401 import DeleteEndpointResponse401 +from .delete_endpoint_response_404 import DeleteEndpointResponse404 +from .delete_filter_response_200 import DeleteFilterResponse200 +from .delete_filter_response_400 import DeleteFilterResponse400 +from .delete_filter_response_401 import DeleteFilterResponse401 +from .delete_filter_response_404 import DeleteFilterResponse404 +from .delete_project_response_200 import DeleteProjectResponse200 +from .delete_project_response_400 import DeleteProjectResponse400 +from .delete_project_response_401 import DeleteProjectResponse401 +from .delete_project_response_403 import DeleteProjectResponse403 +from .delete_project_response_404 import DeleteProjectResponse404 +from .delete_source_response_200 import DeleteSourceResponse200 +from .delete_source_response_400 import DeleteSourceResponse400 +from .delete_source_response_401 import DeleteSourceResponse401 +from .delete_source_response_404 import DeleteSourceResponse404 +from .delete_subscription_response_200 import DeleteSubscriptionResponse200 +from .delete_subscription_response_400 import DeleteSubscriptionResponse400 +from .delete_subscription_response_401 import DeleteSubscriptionResponse401 +from .delete_subscription_response_404 import DeleteSubscriptionResponse404 +from .deprecate_event_type_response_201 import DeprecateEventTypeResponse201 +from .deprecate_event_type_response_400 import DeprecateEventTypeResponse400 +from .deprecate_event_type_response_401 import DeprecateEventTypeResponse401 +from .deprecate_event_type_response_404 import DeprecateEventTypeResponse404 +from .expire_secret_response_200 import ExpireSecretResponse200 +from .expire_secret_response_400 import ExpireSecretResponse400 +from .expire_secret_response_401 import ExpireSecretResponse401 +from .expire_secret_response_404 import ExpireSecretResponse404 +from .force_resend_event_deliveries_response_200 import ( + ForceResendEventDeliveriesResponse200, +) +from .force_resend_event_deliveries_response_400 import ( + ForceResendEventDeliveriesResponse400, +) +from .force_resend_event_deliveries_response_401 import ( + ForceResendEventDeliveriesResponse401, +) +from .force_resend_event_deliveries_response_404 import ( + ForceResendEventDeliveriesResponse404, +) +from .get_delivery_attempt_response_200 import GetDeliveryAttemptResponse200 +from .get_delivery_attempt_response_400 import GetDeliveryAttemptResponse400 +from .get_delivery_attempt_response_401 import GetDeliveryAttemptResponse401 +from .get_delivery_attempt_response_404 import GetDeliveryAttemptResponse404 +from .get_delivery_attempts_response_200 import GetDeliveryAttemptsResponse200 +from .get_delivery_attempts_response_400 import GetDeliveryAttemptsResponse400 +from .get_delivery_attempts_response_401 import GetDeliveryAttemptsResponse401 +from .get_delivery_attempts_response_404 import GetDeliveryAttemptsResponse404 +from .get_endpoint_event_response_200 import GetEndpointEventResponse200 +from .get_endpoint_event_response_400 import GetEndpointEventResponse400 +from .get_endpoint_event_response_401 import GetEndpointEventResponse401 +from .get_endpoint_event_response_404 import GetEndpointEventResponse404 +from .get_endpoint_response_200 import GetEndpointResponse200 +from .get_endpoint_response_400 import GetEndpointResponse400 +from .get_endpoint_response_401 import GetEndpointResponse401 +from .get_endpoint_response_404 import GetEndpointResponse404 +from .get_endpoints_direction import GetEndpointsDirection +from .get_endpoints_response_200 import GetEndpointsResponse200 +from .get_endpoints_response_200_data import GetEndpointsResponse200Data +from .get_endpoints_response_400 import GetEndpointsResponse400 +from .get_endpoints_response_401 import GetEndpointsResponse401 +from .get_endpoints_response_404 import GetEndpointsResponse404 +from .get_event_deliveries_paged_direction import GetEventDeliveriesPagedDirection +from .get_event_deliveries_paged_response_200 import GetEventDeliveriesPagedResponse200 +from .get_event_deliveries_paged_response_200_data import ( + GetEventDeliveriesPagedResponse200Data, +) +from .get_event_deliveries_paged_response_400 import GetEventDeliveriesPagedResponse400 +from .get_event_deliveries_paged_response_401 import GetEventDeliveriesPagedResponse401 +from .get_event_deliveries_paged_response_404 import GetEventDeliveriesPagedResponse404 +from .get_event_delivery_response_200 import GetEventDeliveryResponse200 +from .get_event_delivery_response_400 import GetEventDeliveryResponse400 +from .get_event_delivery_response_401 import GetEventDeliveryResponse401 +from .get_event_delivery_response_404 import GetEventDeliveryResponse404 +from .get_event_types_response_200 import GetEventTypesResponse200 +from .get_event_types_response_400 import GetEventTypesResponse400 +from .get_event_types_response_401 import GetEventTypesResponse401 +from .get_event_types_response_404 import GetEventTypesResponse404 +from .get_events_paged_direction import GetEventsPagedDirection +from .get_events_paged_response_200 import GetEventsPagedResponse200 +from .get_events_paged_response_200_data import GetEventsPagedResponse200Data +from .get_events_paged_response_400 import GetEventsPagedResponse400 +from .get_events_paged_response_401 import GetEventsPagedResponse401 +from .get_events_paged_response_404 import GetEventsPagedResponse404 +from .get_filter_response_200 import GetFilterResponse200 +from .get_filter_response_400 import GetFilterResponse400 +from .get_filter_response_401 import GetFilterResponse401 +from .get_filter_response_404 import GetFilterResponse404 +from .get_filters_response_200 import GetFiltersResponse200 +from .get_filters_response_400 import GetFiltersResponse400 +from .get_filters_response_401 import GetFiltersResponse401 +from .get_filters_response_404 import GetFiltersResponse404 +from .get_meta_event_response_200 import GetMetaEventResponse200 +from .get_meta_event_response_400 import GetMetaEventResponse400 +from .get_meta_event_response_401 import GetMetaEventResponse401 +from .get_meta_event_response_404 import GetMetaEventResponse404 +from .get_meta_events_paged_direction import GetMetaEventsPagedDirection +from .get_meta_events_paged_response_200 import GetMetaEventsPagedResponse200 +from .get_meta_events_paged_response_200_data import GetMetaEventsPagedResponse200Data +from .get_meta_events_paged_response_400 import GetMetaEventsPagedResponse400 +from .get_meta_events_paged_response_401 import GetMetaEventsPagedResponse401 +from .get_meta_events_paged_response_404 import GetMetaEventsPagedResponse404 +from .get_portal_link_response_200 import GetPortalLinkResponse200 +from .get_portal_link_response_400 import GetPortalLinkResponse400 +from .get_portal_link_response_401 import GetPortalLinkResponse401 +from .get_portal_link_response_404 import GetPortalLinkResponse404 +from .get_project_response_200 import GetProjectResponse200 +from .get_project_response_400 import GetProjectResponse400 +from .get_project_response_401 import GetProjectResponse401 +from .get_project_response_404 import GetProjectResponse404 +from .get_projects_response_200 import GetProjectsResponse200 +from .get_projects_response_400 import GetProjectsResponse400 +from .get_projects_response_401 import GetProjectsResponse401 +from .get_projects_response_404 import GetProjectsResponse404 +from .get_source_response_200 import GetSourceResponse200 +from .get_source_response_400 import GetSourceResponse400 +from .get_source_response_401 import GetSourceResponse401 +from .get_source_response_404 import GetSourceResponse404 +from .get_subscription_response_200 import GetSubscriptionResponse200 +from .get_subscription_response_400 import GetSubscriptionResponse400 +from .get_subscription_response_401 import GetSubscriptionResponse401 +from .get_subscription_response_404 import GetSubscriptionResponse404 +from .get_subscriptions_direction import GetSubscriptionsDirection +from .get_subscriptions_response_200 import GetSubscriptionsResponse200 +from .get_subscriptions_response_200_data import GetSubscriptionsResponse200Data +from .get_subscriptions_response_400 import GetSubscriptionsResponse400 +from .get_subscriptions_response_401 import GetSubscriptionsResponse401 +from .get_subscriptions_response_404 import GetSubscriptionsResponse404 +from .handlers_stub import HandlersStub +from .httpheader_http_header import HttpheaderHTTPHeader +from .import_open_api_spec_response_200 import ImportOpenApiSpecResponse200 +from .import_open_api_spec_response_400 import ImportOpenApiSpecResponse400 +from .import_open_api_spec_response_401 import ImportOpenApiSpecResponse401 +from .import_open_api_spec_response_404 import ImportOpenApiSpecResponse404 +from .load_portal_links_paged_direction import LoadPortalLinksPagedDirection +from .load_portal_links_paged_response_200 import LoadPortalLinksPagedResponse200 +from .load_portal_links_paged_response_200_data import ( + LoadPortalLinksPagedResponse200Data, +) +from .load_portal_links_paged_response_400 import LoadPortalLinksPagedResponse400 +from .load_portal_links_paged_response_401 import LoadPortalLinksPagedResponse401 +from .load_portal_links_paged_response_404 import LoadPortalLinksPagedResponse404 +from .load_sources_paged_direction import LoadSourcesPagedDirection +from .load_sources_paged_response_200 import LoadSourcesPagedResponse200 +from .load_sources_paged_response_200_data import LoadSourcesPagedResponse200Data +from .load_sources_paged_response_400 import LoadSourcesPagedResponse400 +from .load_sources_paged_response_401 import LoadSourcesPagedResponse401 +from .load_sources_paged_response_404 import LoadSourcesPagedResponse404 +from .models_alert_configuration import ModelsAlertConfiguration +from .models_amqp_auth import ModelsAmqpAuth +from .models_amqp_exchange import ModelsAmqpExchange +from .models_amqp_pub_subconfig import ModelsAmqpPubSubconfig +from .models_api_key import ModelsApiKey +from .models_basic_auth import ModelsBasicAuth +from .models_broadcast_event import ModelsBroadcastEvent +from .models_broadcast_event_custom_headers import ModelsBroadcastEventCustomHeaders +from .models_broadcast_event_data import ModelsBroadcastEventData +from .models_bulk_onboard_accepted_response import ModelsBulkOnboardAcceptedResponse +from .models_bulk_onboard_dry_run_response import ModelsBulkOnboardDryRunResponse +from .models_bulk_onboard_request import ModelsBulkOnboardRequest +from .models_bulk_update_filter_request import ModelsBulkUpdateFilterRequest +from .models_bulk_update_filter_request_body import ModelsBulkUpdateFilterRequestBody +from .models_bulk_update_filter_request_headers import ( + ModelsBulkUpdateFilterRequestHeaders, +) +from .models_bulk_update_filter_request_path import ModelsBulkUpdateFilterRequestPath +from .models_bulk_update_filter_request_query import ModelsBulkUpdateFilterRequestQuery +from .models_count_response import ModelsCountResponse +from .models_create_endpoint import ModelsCreateEndpoint +from .models_create_event import ModelsCreateEvent +from .models_create_event_custom_headers import ModelsCreateEventCustomHeaders +from .models_create_event_data import ModelsCreateEventData +from .models_create_event_type import ModelsCreateEventType +from .models_create_event_type_json_schema import ModelsCreateEventTypeJsonSchema +from .models_create_filter_request import ModelsCreateFilterRequest +from .models_create_project import ModelsCreateProject +from .models_create_project_response import ModelsCreateProjectResponse +from .models_create_source import ModelsCreateSource +from .models_create_subscription import ModelsCreateSubscription +from .models_custom_response import ModelsCustomResponse +from .models_dynamic_event import ModelsDynamicEvent +from .models_dynamic_event_custom_headers import ModelsDynamicEventCustomHeaders +from .models_dynamic_event_data import ModelsDynamicEventData +from .models_endpoint_authentication import ModelsEndpointAuthentication +from .models_endpoint_response import ModelsEndpointResponse +from .models_event_delivery_response import ModelsEventDeliveryResponse +from .models_event_response import ModelsEventResponse +from .models_event_type_response import ModelsEventTypeResponse +from .models_expire_secret import ModelsExpireSecret +from .models_fanout_event import ModelsFanoutEvent +from .models_fanout_event_custom_headers import ModelsFanoutEventCustomHeaders +from .models_fanout_event_data import ModelsFanoutEventData +from .models_filter_configuration import ModelsFilterConfiguration +from .models_filter_response import ModelsFilterResponse +from .models_filter_schema import ModelsFilterSchema +from .models_fs import ModelsFS +from .models_function_request import ModelsFunctionRequest +from .models_function_request_payload import ModelsFunctionRequestPayload +from .models_function_response import ModelsFunctionResponse +from .models_google_pub_sub_config import ModelsGooglePubSubConfig +from .models_h_mac import ModelsHMac +from .models_i_ds import ModelsIDs +from .models_import_open_api_spec import ModelsImportOpenAPISpec +from .models_kafka_auth import ModelsKafkaAuth +from .models_kafka_pub_sub_config import ModelsKafkaPubSubConfig +from .models_meta_event_configuration import ModelsMetaEventConfiguration +from .models_meta_event_response import ModelsMetaEventResponse +from .models_mtls_client_cert import ModelsMtlsClientCert +from .models_o_auth_2 import ModelsOAuth2 +from .models_o_auth_2_field_mapping import ModelsOAuth2FieldMapping +from .models_o_auth_2_signing_key import ModelsOAuth2SigningKey +from .models_onboard_item import ModelsOnboardItem +from .models_onboard_validation_error import ModelsOnboardValidationError +from .models_optional_time import ModelsOptionalTime +from .models_paged_response import ModelsPagedResponse +from .models_project_config import ModelsProjectConfig +from .models_project_response import ModelsProjectResponse +from .models_pub_sub_config import ModelsPubSubConfig +from .models_rate_limit_configuration import ModelsRateLimitConfiguration +from .models_retry_configuration import ModelsRetryConfiguration +from .models_signature_configuration import ModelsSignatureConfiguration +from .models_signature_version import ModelsSignatureVersion +from .models_source_response import ModelsSourceResponse +from .models_sqs_pub_sub_config import ModelsSQSPubSubConfig +from .models_ssl_configuration import ModelsSSLConfiguration +from .models_strategy_configuration import ModelsStrategyConfiguration +from .models_subscription_response import ModelsSubscriptionResponse +from .models_test_filter import ModelsTestFilter +from .models_test_filter_request import ModelsTestFilterRequest +from .models_test_filter_request_scopes import ModelsTestFilterRequestScopes +from .models_test_filter_response import ModelsTestFilterResponse +from .models_test_o_auth_2_request import ModelsTestOAuth2Request +from .models_test_o_auth_2_response import ModelsTestOAuth2Response +from .models_update_custom_response import ModelsUpdateCustomResponse +from .models_update_endpoint import ModelsUpdateEndpoint +from .models_update_event_type import ModelsUpdateEventType +from .models_update_event_type_json_schema import ModelsUpdateEventTypeJsonSchema +from .models_update_filter_request import ModelsUpdateFilterRequest +from .models_update_project import ModelsUpdateProject +from .models_update_source import ModelsUpdateSource +from .models_update_subscription import ModelsUpdateSubscription +from .models_verifier_config import ModelsVerifierConfig +from .pause_endpoint_response_202 import PauseEndpointResponse202 +from .pause_endpoint_response_400 import PauseEndpointResponse400 +from .pause_endpoint_response_401 import PauseEndpointResponse401 +from .pause_endpoint_response_404 import PauseEndpointResponse404 +from .post_v1_projects_project_id_sources_test_function_response_200 import ( + PostV1ProjectsProjectIDSourcesTestFunctionResponse200, +) +from .post_v1_projects_project_id_sources_test_function_response_400 import ( + PostV1ProjectsProjectIDSourcesTestFunctionResponse400, +) +from .post_v1_projects_project_id_sources_test_function_response_401 import ( + PostV1ProjectsProjectIDSourcesTestFunctionResponse401, +) +from .post_v1_projects_project_id_sources_test_function_response_404 import ( + PostV1ProjectsProjectIDSourcesTestFunctionResponse404, +) +from .refresh_portal_link_auth_token_response_200 import ( + RefreshPortalLinkAuthTokenResponse200, +) +from .refresh_portal_link_auth_token_response_400 import ( + RefreshPortalLinkAuthTokenResponse400, +) +from .refresh_portal_link_auth_token_response_401 import ( + RefreshPortalLinkAuthTokenResponse401, +) +from .refresh_portal_link_auth_token_response_404 import ( + RefreshPortalLinkAuthTokenResponse404, +) +from .replay_endpoint_event_response_200 import ReplayEndpointEventResponse200 +from .replay_endpoint_event_response_400 import ReplayEndpointEventResponse400 +from .replay_endpoint_event_response_401 import ReplayEndpointEventResponse401 +from .replay_endpoint_event_response_404 import ReplayEndpointEventResponse404 +from .resend_event_delivery_response_200 import ResendEventDeliveryResponse200 +from .resend_event_delivery_response_400 import ResendEventDeliveryResponse400 +from .resend_event_delivery_response_401 import ResendEventDeliveryResponse401 +from .resend_event_delivery_response_404 import ResendEventDeliveryResponse404 +from .resend_meta_event_response_200 import ResendMetaEventResponse200 +from .resend_meta_event_response_400 import ResendMetaEventResponse400 +from .resend_meta_event_response_401 import ResendMetaEventResponse401 +from .resend_meta_event_response_404 import ResendMetaEventResponse404 +from .revoke_portal_link_response_200 import RevokePortalLinkResponse200 +from .revoke_portal_link_response_400 import RevokePortalLinkResponse400 +from .revoke_portal_link_response_401 import RevokePortalLinkResponse401 +from .revoke_portal_link_response_404 import RevokePortalLinkResponse404 +from .test_filter_response_200 import TestFilterResponse200 +from .test_filter_response_400 import TestFilterResponse400 +from .test_filter_response_401 import TestFilterResponse401 +from .test_filter_response_404 import TestFilterResponse404 +from .test_o_auth_2_connection_response_200 import TestOAuth2ConnectionResponse200 +from .test_o_auth_2_connection_response_400 import TestOAuth2ConnectionResponse400 +from .test_o_auth_2_connection_response_401 import TestOAuth2ConnectionResponse401 +from .test_o_auth_2_connection_response_404 import TestOAuth2ConnectionResponse404 +from .test_subscription_filter_response_200 import TestSubscriptionFilterResponse200 +from .test_subscription_filter_response_400 import TestSubscriptionFilterResponse400 +from .test_subscription_filter_response_401 import TestSubscriptionFilterResponse401 +from .test_subscription_filter_response_404 import TestSubscriptionFilterResponse404 +from .test_subscription_function_response_200 import TestSubscriptionFunctionResponse200 +from .test_subscription_function_response_400 import TestSubscriptionFunctionResponse400 +from .test_subscription_function_response_401 import TestSubscriptionFunctionResponse401 +from .test_subscription_function_response_404 import TestSubscriptionFunctionResponse404 +from .toggle_subscription_status_response_202 import ToggleSubscriptionStatusResponse202 +from .toggle_subscription_status_response_400 import ToggleSubscriptionStatusResponse400 +from .toggle_subscription_status_response_401 import ToggleSubscriptionStatusResponse401 +from .toggle_subscription_status_response_404 import ToggleSubscriptionStatusResponse404 +from .update_endpoint_response_202 import UpdateEndpointResponse202 +from .update_endpoint_response_400 import UpdateEndpointResponse400 +from .update_endpoint_response_401 import UpdateEndpointResponse401 +from .update_endpoint_response_404 import UpdateEndpointResponse404 +from .update_event_type_response_201 import UpdateEventTypeResponse201 +from .update_event_type_response_400 import UpdateEventTypeResponse400 +from .update_event_type_response_401 import UpdateEventTypeResponse401 +from .update_event_type_response_404 import UpdateEventTypeResponse404 +from .update_filter_response_200 import UpdateFilterResponse200 +from .update_filter_response_400 import UpdateFilterResponse400 +from .update_filter_response_401 import UpdateFilterResponse401 +from .update_filter_response_404 import UpdateFilterResponse404 +from .update_portal_link_response_202 import UpdatePortalLinkResponse202 +from .update_portal_link_response_400 import UpdatePortalLinkResponse400 +from .update_portal_link_response_401 import UpdatePortalLinkResponse401 +from .update_portal_link_response_404 import UpdatePortalLinkResponse404 +from .update_project_response_202 import UpdateProjectResponse202 +from .update_project_response_400 import UpdateProjectResponse400 +from .update_project_response_401 import UpdateProjectResponse401 +from .update_project_response_403 import UpdateProjectResponse403 +from .update_project_response_404 import UpdateProjectResponse404 +from .update_source_response_202 import UpdateSourceResponse202 +from .update_source_response_400 import UpdateSourceResponse400 +from .update_source_response_401 import UpdateSourceResponse401 +from .update_source_response_404 import UpdateSourceResponse404 +from .update_subscription_response_202 import UpdateSubscriptionResponse202 +from .update_subscription_response_400 import UpdateSubscriptionResponse400 +from .update_subscription_response_401 import UpdateSubscriptionResponse401 +from .update_subscription_response_404 import UpdateSubscriptionResponse404 +from .util_server_response import UtilServerResponse + +__all__ = ( + "ActivateEndpointResponse202", + "ActivateEndpointResponse400", + "ActivateEndpointResponse401", + "ActivateEndpointResponse404", + "AuthRoleType", + "BatchReplayEventsDirection", + "BatchReplayEventsResponse200", + "BatchReplayEventsResponse400", + "BatchReplayEventsResponse401", + "BatchReplayEventsResponse404", + "BatchRetryEventDeliveryDirection", + "BatchRetryEventDeliveryResponse200", + "BatchRetryEventDeliveryResponse400", + "BatchRetryEventDeliveryResponse401", + "BatchRetryEventDeliveryResponse404", + "BulkCreateFiltersResponse201", + "BulkCreateFiltersResponse400", + "BulkCreateFiltersResponse401", + "BulkCreateFiltersResponse404", + "BulkOnboardResponse200", + "BulkOnboardResponse202", + "BulkOnboardResponse400", + "BulkOnboardResponse401", + "BulkOnboardResponse404", + "BulkUpdateFiltersResponse200", + "BulkUpdateFiltersResponse400", + "BulkUpdateFiltersResponse401", + "BulkUpdateFiltersResponse404", + "ConfigRequestIDHeaderProvider", + "ConfigSignatureHeaderProvider", + "CountAffectedEventsDirection", + "CountAffectedEventsResponse200", + "CountAffectedEventsResponse400", + "CountAffectedEventsResponse401", + "CountAffectedEventsResponse404", + "CreateBroadcastEventResponse201", + "CreateBroadcastEventResponse400", + "CreateBroadcastEventResponse401", + "CreateBroadcastEventResponse404", + "CreateDynamicEventResponse400", + "CreateDynamicEventResponse401", + "CreateDynamicEventResponse404", + "CreateEndpointEventResponse201", + "CreateEndpointEventResponse400", + "CreateEndpointEventResponse401", + "CreateEndpointEventResponse404", + "CreateEndpointFanoutEventResponse201", + "CreateEndpointFanoutEventResponse400", + "CreateEndpointFanoutEventResponse401", + "CreateEndpointFanoutEventResponse404", + "CreateEndpointResponse201", + "CreateEndpointResponse400", + "CreateEndpointResponse401", + "CreateEndpointResponse404", + "CreateEventTypeResponse201", + "CreateEventTypeResponse400", + "CreateEventTypeResponse401", + "CreateEventTypeResponse404", + "CreateFilterResponse201", + "CreateFilterResponse400", + "CreateFilterResponse401", + "CreateFilterResponse404", + "CreatePortalLinkResponse201", + "CreatePortalLinkResponse400", + "CreatePortalLinkResponse401", + "CreatePortalLinkResponse404", + "CreateProjectResponse201", + "CreateProjectResponse400", + "CreateProjectResponse401", + "CreateProjectResponse402", + "CreateProjectResponse403", + "CreateProjectResponse404", + "CreateSourceResponse201", + "CreateSourceResponse400", + "CreateSourceResponse401", + "CreateSourceResponse404", + "CreateSubscriptionResponse201", + "CreateSubscriptionResponse400", + "CreateSubscriptionResponse401", + "CreateSubscriptionResponse404", + "DatastoreAlertConfiguration", + "DatastoreAmqpCredentials", + "DatastoreAmqpPubSubConfig", + "DatastoreApiKey", + "DatastoreAPIKeyResponse", + "DatastoreBasicAuth", + "DatastoreCircuitBreakerConfiguration", + "DatastoreCLIMetadata", + "DatastoreCreatePortalLinkRequest", + "DatastoreCustomResponse", + "DatastoreDeliveryAttempt", + "DatastoreDeliveryMode", + "DatastoreDevice", + "DatastoreDeviceStatus", + "DatastoreEncodingType", + "DatastoreEndpoint", + "DatastoreEndpointAuthentication", + "DatastoreEndpointAuthenticationType", + "DatastoreEndpointStatus", + "DatastoreEvent", + "DatastoreEventDeliveryStatus", + "DatastoreEventStatus", + "DatastoreFilterConfiguration", + "DatastoreFilterSchema", + "DatastoreGooglePubSubConfig", + "DatastoreHMac", + "DatastoreHttpHeader", + "DatastoreKafkaAuth", + "DatastoreKafkaPubSubConfig", + "DatastoreM", + "DatastoreMetadata", + "DatastoreMetaEventAttempt", + "DatastoreMetaEventConfiguration", + "DatastoreMetaEventType", + "DatastoreMtlsClientCert", + "DatastoreOAuth2", + "DatastoreOAuth2AuthenticationType", + "DatastoreOAuth2ExpiryTimeUnit", + "DatastoreOAuth2FieldMapping", + "DatastoreOAuth2SigningKey", + "DatastorePageDirection", + "DatastorePaginationData", + "DatastorePortalAuthType", + "DatastorePortalLinkResponse", + "DatastoreProjectConfig", + "DatastoreProjectStatistics", + "DatastoreProjectType", + "DatastoreProviderConfig", + "DatastorePubSubConfig", + "DatastorePubSubType", + "DatastoreRateLimitConfiguration", + "DatastoreRetryConfiguration", + "DatastoreRole", + "DatastoreSecret", + "DatastoreSignatureConfiguration", + "DatastoreSignatureVersion", + "DatastoreSource", + "DatastoreSourceProvider", + "DatastoreSourceType", + "DatastoreSQSPubSubConfig", + "DatastoreSSLConfiguration", + "DatastoreStrategyConfiguration", + "DatastoreStrategyProvider", + "DatastoreSubscriptionType", + "DatastoreTwitterProviderConfig", + "DatastoreUpdatePortalLinkRequest", + "DatastoreVerifierConfig", + "DatastoreVerifierType", + "DeleteEndpointResponse200", + "DeleteEndpointResponse400", + "DeleteEndpointResponse401", + "DeleteEndpointResponse404", + "DeleteFilterResponse200", + "DeleteFilterResponse400", + "DeleteFilterResponse401", + "DeleteFilterResponse404", + "DeleteProjectResponse200", + "DeleteProjectResponse400", + "DeleteProjectResponse401", + "DeleteProjectResponse403", + "DeleteProjectResponse404", + "DeleteSourceResponse200", + "DeleteSourceResponse400", + "DeleteSourceResponse401", + "DeleteSourceResponse404", + "DeleteSubscriptionResponse200", + "DeleteSubscriptionResponse400", + "DeleteSubscriptionResponse401", + "DeleteSubscriptionResponse404", + "DeprecateEventTypeResponse201", + "DeprecateEventTypeResponse400", + "DeprecateEventTypeResponse401", + "DeprecateEventTypeResponse404", + "ExpireSecretResponse200", + "ExpireSecretResponse400", + "ExpireSecretResponse401", + "ExpireSecretResponse404", + "ForceResendEventDeliveriesResponse200", + "ForceResendEventDeliveriesResponse400", + "ForceResendEventDeliveriesResponse401", + "ForceResendEventDeliveriesResponse404", + "GetDeliveryAttemptResponse200", + "GetDeliveryAttemptResponse400", + "GetDeliveryAttemptResponse401", + "GetDeliveryAttemptResponse404", + "GetDeliveryAttemptsResponse200", + "GetDeliveryAttemptsResponse400", + "GetDeliveryAttemptsResponse401", + "GetDeliveryAttemptsResponse404", + "GetEndpointEventResponse200", + "GetEndpointEventResponse400", + "GetEndpointEventResponse401", + "GetEndpointEventResponse404", + "GetEndpointResponse200", + "GetEndpointResponse400", + "GetEndpointResponse401", + "GetEndpointResponse404", + "GetEndpointsDirection", + "GetEndpointsResponse200", + "GetEndpointsResponse200Data", + "GetEndpointsResponse400", + "GetEndpointsResponse401", + "GetEndpointsResponse404", + "GetEventDeliveriesPagedDirection", + "GetEventDeliveriesPagedResponse200", + "GetEventDeliveriesPagedResponse200Data", + "GetEventDeliveriesPagedResponse400", + "GetEventDeliveriesPagedResponse401", + "GetEventDeliveriesPagedResponse404", + "GetEventDeliveryResponse200", + "GetEventDeliveryResponse400", + "GetEventDeliveryResponse401", + "GetEventDeliveryResponse404", + "GetEventsPagedDirection", + "GetEventsPagedResponse200", + "GetEventsPagedResponse200Data", + "GetEventsPagedResponse400", + "GetEventsPagedResponse401", + "GetEventsPagedResponse404", + "GetEventTypesResponse200", + "GetEventTypesResponse400", + "GetEventTypesResponse401", + "GetEventTypesResponse404", + "GetFilterResponse200", + "GetFilterResponse400", + "GetFilterResponse401", + "GetFilterResponse404", + "GetFiltersResponse200", + "GetFiltersResponse400", + "GetFiltersResponse401", + "GetFiltersResponse404", + "GetMetaEventResponse200", + "GetMetaEventResponse400", + "GetMetaEventResponse401", + "GetMetaEventResponse404", + "GetMetaEventsPagedDirection", + "GetMetaEventsPagedResponse200", + "GetMetaEventsPagedResponse200Data", + "GetMetaEventsPagedResponse400", + "GetMetaEventsPagedResponse401", + "GetMetaEventsPagedResponse404", + "GetPortalLinkResponse200", + "GetPortalLinkResponse400", + "GetPortalLinkResponse401", + "GetPortalLinkResponse404", + "GetProjectResponse200", + "GetProjectResponse400", + "GetProjectResponse401", + "GetProjectResponse404", + "GetProjectsResponse200", + "GetProjectsResponse400", + "GetProjectsResponse401", + "GetProjectsResponse404", + "GetSourceResponse200", + "GetSourceResponse400", + "GetSourceResponse401", + "GetSourceResponse404", + "GetSubscriptionResponse200", + "GetSubscriptionResponse400", + "GetSubscriptionResponse401", + "GetSubscriptionResponse404", + "GetSubscriptionsDirection", + "GetSubscriptionsResponse200", + "GetSubscriptionsResponse200Data", + "GetSubscriptionsResponse400", + "GetSubscriptionsResponse401", + "GetSubscriptionsResponse404", + "HandlersStub", + "HttpheaderHTTPHeader", + "ImportOpenApiSpecResponse200", + "ImportOpenApiSpecResponse400", + "ImportOpenApiSpecResponse401", + "ImportOpenApiSpecResponse404", + "LoadPortalLinksPagedDirection", + "LoadPortalLinksPagedResponse200", + "LoadPortalLinksPagedResponse200Data", + "LoadPortalLinksPagedResponse400", + "LoadPortalLinksPagedResponse401", + "LoadPortalLinksPagedResponse404", + "LoadSourcesPagedDirection", + "LoadSourcesPagedResponse200", + "LoadSourcesPagedResponse200Data", + "LoadSourcesPagedResponse400", + "LoadSourcesPagedResponse401", + "LoadSourcesPagedResponse404", + "ModelsAlertConfiguration", + "ModelsAmqpAuth", + "ModelsAmqpExchange", + "ModelsAmqpPubSubconfig", + "ModelsApiKey", + "ModelsBasicAuth", + "ModelsBroadcastEvent", + "ModelsBroadcastEventCustomHeaders", + "ModelsBroadcastEventData", + "ModelsBulkOnboardAcceptedResponse", + "ModelsBulkOnboardDryRunResponse", + "ModelsBulkOnboardRequest", + "ModelsBulkUpdateFilterRequest", + "ModelsBulkUpdateFilterRequestBody", + "ModelsBulkUpdateFilterRequestHeaders", + "ModelsBulkUpdateFilterRequestPath", + "ModelsBulkUpdateFilterRequestQuery", + "ModelsCountResponse", + "ModelsCreateEndpoint", + "ModelsCreateEvent", + "ModelsCreateEventCustomHeaders", + "ModelsCreateEventData", + "ModelsCreateEventType", + "ModelsCreateEventTypeJsonSchema", + "ModelsCreateFilterRequest", + "ModelsCreateProject", + "ModelsCreateProjectResponse", + "ModelsCreateSource", + "ModelsCreateSubscription", + "ModelsCustomResponse", + "ModelsDynamicEvent", + "ModelsDynamicEventCustomHeaders", + "ModelsDynamicEventData", + "ModelsEndpointAuthentication", + "ModelsEndpointResponse", + "ModelsEventDeliveryResponse", + "ModelsEventResponse", + "ModelsEventTypeResponse", + "ModelsExpireSecret", + "ModelsFanoutEvent", + "ModelsFanoutEventCustomHeaders", + "ModelsFanoutEventData", + "ModelsFilterConfiguration", + "ModelsFilterResponse", + "ModelsFilterSchema", + "ModelsFS", + "ModelsFunctionRequest", + "ModelsFunctionRequestPayload", + "ModelsFunctionResponse", + "ModelsGooglePubSubConfig", + "ModelsHMac", + "ModelsIDs", + "ModelsImportOpenAPISpec", + "ModelsKafkaAuth", + "ModelsKafkaPubSubConfig", + "ModelsMetaEventConfiguration", + "ModelsMetaEventResponse", + "ModelsMtlsClientCert", + "ModelsOAuth2", + "ModelsOAuth2FieldMapping", + "ModelsOAuth2SigningKey", + "ModelsOnboardItem", + "ModelsOnboardValidationError", + "ModelsOptionalTime", + "ModelsPagedResponse", + "ModelsProjectConfig", + "ModelsProjectResponse", + "ModelsPubSubConfig", + "ModelsRateLimitConfiguration", + "ModelsRetryConfiguration", + "ModelsSignatureConfiguration", + "ModelsSignatureVersion", + "ModelsSourceResponse", + "ModelsSQSPubSubConfig", + "ModelsSSLConfiguration", + "ModelsStrategyConfiguration", + "ModelsSubscriptionResponse", + "ModelsTestFilter", + "ModelsTestFilterRequest", + "ModelsTestFilterRequestScopes", + "ModelsTestFilterResponse", + "ModelsTestOAuth2Request", + "ModelsTestOAuth2Response", + "ModelsUpdateCustomResponse", + "ModelsUpdateEndpoint", + "ModelsUpdateEventType", + "ModelsUpdateEventTypeJsonSchema", + "ModelsUpdateFilterRequest", + "ModelsUpdateProject", + "ModelsUpdateSource", + "ModelsUpdateSubscription", + "ModelsVerifierConfig", + "PauseEndpointResponse202", + "PauseEndpointResponse400", + "PauseEndpointResponse401", + "PauseEndpointResponse404", + "PostV1ProjectsProjectIDSourcesTestFunctionResponse200", + "PostV1ProjectsProjectIDSourcesTestFunctionResponse400", + "PostV1ProjectsProjectIDSourcesTestFunctionResponse401", + "PostV1ProjectsProjectIDSourcesTestFunctionResponse404", + "RefreshPortalLinkAuthTokenResponse200", + "RefreshPortalLinkAuthTokenResponse400", + "RefreshPortalLinkAuthTokenResponse401", + "RefreshPortalLinkAuthTokenResponse404", + "ReplayEndpointEventResponse200", + "ReplayEndpointEventResponse400", + "ReplayEndpointEventResponse401", + "ReplayEndpointEventResponse404", + "ResendEventDeliveryResponse200", + "ResendEventDeliveryResponse400", + "ResendEventDeliveryResponse401", + "ResendEventDeliveryResponse404", + "ResendMetaEventResponse200", + "ResendMetaEventResponse400", + "ResendMetaEventResponse401", + "ResendMetaEventResponse404", + "RevokePortalLinkResponse200", + "RevokePortalLinkResponse400", + "RevokePortalLinkResponse401", + "RevokePortalLinkResponse404", + "TestFilterResponse200", + "TestFilterResponse400", + "TestFilterResponse401", + "TestFilterResponse404", + "TestOAuth2ConnectionResponse200", + "TestOAuth2ConnectionResponse400", + "TestOAuth2ConnectionResponse401", + "TestOAuth2ConnectionResponse404", + "TestSubscriptionFilterResponse200", + "TestSubscriptionFilterResponse400", + "TestSubscriptionFilterResponse401", + "TestSubscriptionFilterResponse404", + "TestSubscriptionFunctionResponse200", + "TestSubscriptionFunctionResponse400", + "TestSubscriptionFunctionResponse401", + "TestSubscriptionFunctionResponse404", + "ToggleSubscriptionStatusResponse202", + "ToggleSubscriptionStatusResponse400", + "ToggleSubscriptionStatusResponse401", + "ToggleSubscriptionStatusResponse404", + "UpdateEndpointResponse202", + "UpdateEndpointResponse400", + "UpdateEndpointResponse401", + "UpdateEndpointResponse404", + "UpdateEventTypeResponse201", + "UpdateEventTypeResponse400", + "UpdateEventTypeResponse401", + "UpdateEventTypeResponse404", + "UpdateFilterResponse200", + "UpdateFilterResponse400", + "UpdateFilterResponse401", + "UpdateFilterResponse404", + "UpdatePortalLinkResponse202", + "UpdatePortalLinkResponse400", + "UpdatePortalLinkResponse401", + "UpdatePortalLinkResponse404", + "UpdateProjectResponse202", + "UpdateProjectResponse400", + "UpdateProjectResponse401", + "UpdateProjectResponse403", + "UpdateProjectResponse404", + "UpdateSourceResponse202", + "UpdateSourceResponse400", + "UpdateSourceResponse401", + "UpdateSourceResponse404", + "UpdateSubscriptionResponse202", + "UpdateSubscriptionResponse400", + "UpdateSubscriptionResponse401", + "UpdateSubscriptionResponse404", + "UtilServerResponse", +) diff --git a/src/convoy/models/activate_endpoint_response_202.py b/src/convoy/models/activate_endpoint_response_202.py new file mode 100644 index 0000000..34403a1 --- /dev/null +++ b/src/convoy/models/activate_endpoint_response_202.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_endpoint_response import ModelsEndpointResponse + + +T = TypeVar("T", bound="ActivateEndpointResponse202") + + +@_attrs_define +class ActivateEndpointResponse202: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEndpointResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEndpointResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_endpoint_response import ModelsEndpointResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEndpointResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEndpointResponse.from_dict(_data) + + activate_endpoint_response_202 = cls( + message=message, + status=status, + data=data, + ) + + activate_endpoint_response_202.additional_properties = d + return activate_endpoint_response_202 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/activate_endpoint_response_400.py b/src/convoy/models/activate_endpoint_response_400.py new file mode 100644 index 0000000..071caef --- /dev/null +++ b/src/convoy/models/activate_endpoint_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ActivateEndpointResponse400") + + +@_attrs_define +class ActivateEndpointResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + activate_endpoint_response_400 = cls( + message=message, + status=status, + data=data, + ) + + activate_endpoint_response_400.additional_properties = d + return activate_endpoint_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/activate_endpoint_response_401.py b/src/convoy/models/activate_endpoint_response_401.py new file mode 100644 index 0000000..4d7480e --- /dev/null +++ b/src/convoy/models/activate_endpoint_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ActivateEndpointResponse401") + + +@_attrs_define +class ActivateEndpointResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + activate_endpoint_response_401 = cls( + message=message, + status=status, + data=data, + ) + + activate_endpoint_response_401.additional_properties = d + return activate_endpoint_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/activate_endpoint_response_404.py b/src/convoy/models/activate_endpoint_response_404.py new file mode 100644 index 0000000..a59dde5 --- /dev/null +++ b/src/convoy/models/activate_endpoint_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ActivateEndpointResponse404") + + +@_attrs_define +class ActivateEndpointResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + activate_endpoint_response_404 = cls( + message=message, + status=status, + data=data, + ) + + activate_endpoint_response_404.additional_properties = d + return activate_endpoint_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/auth_role_type.py b/src/convoy/models/auth_role_type.py new file mode 100644 index 0000000..79a3440 --- /dev/null +++ b/src/convoy/models/auth_role_type.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class AuthRoleType(str, Enum): + ROLE_API = "api" + ROLE_BILLING_ADMIN = "billing_admin" + ROLE_INSTANCE_ADMIN = "instance_admin" + ROLE_ORGANISATION_ADMIN = "organisation_admin" + ROLE_PROJECT_ADMIN = "project_admin" + ROLE_PROJECT_VIEWER = "project_viewer" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/batch_replay_events_direction.py b/src/convoy/models/batch_replay_events_direction.py new file mode 100644 index 0000000..270c803 --- /dev/null +++ b/src/convoy/models/batch_replay_events_direction.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class BatchReplayEventsDirection(str, Enum): + NEXT = "next" + PREV = "prev" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/batch_replay_events_response_200.py b/src/convoy/models/batch_replay_events_response_200.py new file mode 100644 index 0000000..d06bbe8 --- /dev/null +++ b/src/convoy/models/batch_replay_events_response_200.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="BatchReplayEventsResponse200") + + +@_attrs_define +class BatchReplayEventsResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (str | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data = self.data + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + data = d.pop("data", UNSET) + + batch_replay_events_response_200 = cls( + message=message, + status=status, + data=data, + ) + + batch_replay_events_response_200.additional_properties = d + return batch_replay_events_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/batch_replay_events_response_400.py b/src/convoy/models/batch_replay_events_response_400.py new file mode 100644 index 0000000..4639aff --- /dev/null +++ b/src/convoy/models/batch_replay_events_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BatchReplayEventsResponse400") + + +@_attrs_define +class BatchReplayEventsResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + batch_replay_events_response_400 = cls( + message=message, + status=status, + data=data, + ) + + batch_replay_events_response_400.additional_properties = d + return batch_replay_events_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/batch_replay_events_response_401.py b/src/convoy/models/batch_replay_events_response_401.py new file mode 100644 index 0000000..b22245e --- /dev/null +++ b/src/convoy/models/batch_replay_events_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BatchReplayEventsResponse401") + + +@_attrs_define +class BatchReplayEventsResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + batch_replay_events_response_401 = cls( + message=message, + status=status, + data=data, + ) + + batch_replay_events_response_401.additional_properties = d + return batch_replay_events_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/batch_replay_events_response_404.py b/src/convoy/models/batch_replay_events_response_404.py new file mode 100644 index 0000000..a10cd70 --- /dev/null +++ b/src/convoy/models/batch_replay_events_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BatchReplayEventsResponse404") + + +@_attrs_define +class BatchReplayEventsResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + batch_replay_events_response_404 = cls( + message=message, + status=status, + data=data, + ) + + batch_replay_events_response_404.additional_properties = d + return batch_replay_events_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/batch_retry_event_delivery_direction.py b/src/convoy/models/batch_retry_event_delivery_direction.py new file mode 100644 index 0000000..fa3229e --- /dev/null +++ b/src/convoy/models/batch_retry_event_delivery_direction.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class BatchRetryEventDeliveryDirection(str, Enum): + NEXT = "next" + PREV = "prev" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/batch_retry_event_delivery_response_200.py b/src/convoy/models/batch_retry_event_delivery_response_200.py new file mode 100644 index 0000000..24fda94 --- /dev/null +++ b/src/convoy/models/batch_retry_event_delivery_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BatchRetryEventDeliveryResponse200") + + +@_attrs_define +class BatchRetryEventDeliveryResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + batch_retry_event_delivery_response_200 = cls( + message=message, + status=status, + data=data, + ) + + batch_retry_event_delivery_response_200.additional_properties = d + return batch_retry_event_delivery_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/batch_retry_event_delivery_response_400.py b/src/convoy/models/batch_retry_event_delivery_response_400.py new file mode 100644 index 0000000..0569a67 --- /dev/null +++ b/src/convoy/models/batch_retry_event_delivery_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BatchRetryEventDeliveryResponse400") + + +@_attrs_define +class BatchRetryEventDeliveryResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + batch_retry_event_delivery_response_400 = cls( + message=message, + status=status, + data=data, + ) + + batch_retry_event_delivery_response_400.additional_properties = d + return batch_retry_event_delivery_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/batch_retry_event_delivery_response_401.py b/src/convoy/models/batch_retry_event_delivery_response_401.py new file mode 100644 index 0000000..b2d361b --- /dev/null +++ b/src/convoy/models/batch_retry_event_delivery_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BatchRetryEventDeliveryResponse401") + + +@_attrs_define +class BatchRetryEventDeliveryResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + batch_retry_event_delivery_response_401 = cls( + message=message, + status=status, + data=data, + ) + + batch_retry_event_delivery_response_401.additional_properties = d + return batch_retry_event_delivery_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/batch_retry_event_delivery_response_404.py b/src/convoy/models/batch_retry_event_delivery_response_404.py new file mode 100644 index 0000000..00001ae --- /dev/null +++ b/src/convoy/models/batch_retry_event_delivery_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BatchRetryEventDeliveryResponse404") + + +@_attrs_define +class BatchRetryEventDeliveryResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + batch_retry_event_delivery_response_404 = cls( + message=message, + status=status, + data=data, + ) + + batch_retry_event_delivery_response_404.additional_properties = d + return batch_retry_event_delivery_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/bulk_create_filters_response_201.py b/src/convoy/models/bulk_create_filters_response_201.py new file mode 100644 index 0000000..b1159b6 --- /dev/null +++ b/src/convoy/models/bulk_create_filters_response_201.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_filter_response import ModelsFilterResponse + + +T = TypeVar("T", bound="BulkCreateFiltersResponse201") + + +@_attrs_define +class BulkCreateFiltersResponse201: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (list[ModelsFilterResponse] | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: list[ModelsFilterResponse] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.data, Unset): + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_filter_response import ModelsFilterResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: list[ModelsFilterResponse] | Unset = UNSET + if _data is not UNSET: + data = [] + for data_item_data in _data: + data_item = ModelsFilterResponse.from_dict(data_item_data) + + data.append(data_item) + + bulk_create_filters_response_201 = cls( + message=message, + status=status, + data=data, + ) + + bulk_create_filters_response_201.additional_properties = d + return bulk_create_filters_response_201 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/bulk_create_filters_response_400.py b/src/convoy/models/bulk_create_filters_response_400.py new file mode 100644 index 0000000..dd234a1 --- /dev/null +++ b/src/convoy/models/bulk_create_filters_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BulkCreateFiltersResponse400") + + +@_attrs_define +class BulkCreateFiltersResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + bulk_create_filters_response_400 = cls( + message=message, + status=status, + data=data, + ) + + bulk_create_filters_response_400.additional_properties = d + return bulk_create_filters_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/bulk_create_filters_response_401.py b/src/convoy/models/bulk_create_filters_response_401.py new file mode 100644 index 0000000..e3bd596 --- /dev/null +++ b/src/convoy/models/bulk_create_filters_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BulkCreateFiltersResponse401") + + +@_attrs_define +class BulkCreateFiltersResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + bulk_create_filters_response_401 = cls( + message=message, + status=status, + data=data, + ) + + bulk_create_filters_response_401.additional_properties = d + return bulk_create_filters_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/bulk_create_filters_response_404.py b/src/convoy/models/bulk_create_filters_response_404.py new file mode 100644 index 0000000..b2bafcb --- /dev/null +++ b/src/convoy/models/bulk_create_filters_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BulkCreateFiltersResponse404") + + +@_attrs_define +class BulkCreateFiltersResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + bulk_create_filters_response_404 = cls( + message=message, + status=status, + data=data, + ) + + bulk_create_filters_response_404.additional_properties = d + return bulk_create_filters_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/bulk_onboard_response_200.py b/src/convoy/models/bulk_onboard_response_200.py new file mode 100644 index 0000000..76cd547 --- /dev/null +++ b/src/convoy/models/bulk_onboard_response_200.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_bulk_onboard_dry_run_response import ( + ModelsBulkOnboardDryRunResponse, + ) + + +T = TypeVar("T", bound="BulkOnboardResponse200") + + +@_attrs_define +class BulkOnboardResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsBulkOnboardDryRunResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsBulkOnboardDryRunResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_bulk_onboard_dry_run_response import ( + ModelsBulkOnboardDryRunResponse, + ) + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsBulkOnboardDryRunResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsBulkOnboardDryRunResponse.from_dict(_data) + + bulk_onboard_response_200 = cls( + message=message, + status=status, + data=data, + ) + + bulk_onboard_response_200.additional_properties = d + return bulk_onboard_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/bulk_onboard_response_202.py b/src/convoy/models/bulk_onboard_response_202.py new file mode 100644 index 0000000..40e223a --- /dev/null +++ b/src/convoy/models/bulk_onboard_response_202.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_bulk_onboard_accepted_response import ( + ModelsBulkOnboardAcceptedResponse, + ) + + +T = TypeVar("T", bound="BulkOnboardResponse202") + + +@_attrs_define +class BulkOnboardResponse202: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsBulkOnboardAcceptedResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsBulkOnboardAcceptedResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_bulk_onboard_accepted_response import ( + ModelsBulkOnboardAcceptedResponse, + ) + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsBulkOnboardAcceptedResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsBulkOnboardAcceptedResponse.from_dict(_data) + + bulk_onboard_response_202 = cls( + message=message, + status=status, + data=data, + ) + + bulk_onboard_response_202.additional_properties = d + return bulk_onboard_response_202 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/bulk_onboard_response_400.py b/src/convoy/models/bulk_onboard_response_400.py new file mode 100644 index 0000000..6effc9f --- /dev/null +++ b/src/convoy/models/bulk_onboard_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BulkOnboardResponse400") + + +@_attrs_define +class BulkOnboardResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + bulk_onboard_response_400 = cls( + message=message, + status=status, + data=data, + ) + + bulk_onboard_response_400.additional_properties = d + return bulk_onboard_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/bulk_onboard_response_401.py b/src/convoy/models/bulk_onboard_response_401.py new file mode 100644 index 0000000..83205dc --- /dev/null +++ b/src/convoy/models/bulk_onboard_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BulkOnboardResponse401") + + +@_attrs_define +class BulkOnboardResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + bulk_onboard_response_401 = cls( + message=message, + status=status, + data=data, + ) + + bulk_onboard_response_401.additional_properties = d + return bulk_onboard_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/bulk_onboard_response_404.py b/src/convoy/models/bulk_onboard_response_404.py new file mode 100644 index 0000000..9224529 --- /dev/null +++ b/src/convoy/models/bulk_onboard_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BulkOnboardResponse404") + + +@_attrs_define +class BulkOnboardResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + bulk_onboard_response_404 = cls( + message=message, + status=status, + data=data, + ) + + bulk_onboard_response_404.additional_properties = d + return bulk_onboard_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/bulk_update_filters_response_200.py b/src/convoy/models/bulk_update_filters_response_200.py new file mode 100644 index 0000000..2299b75 --- /dev/null +++ b/src/convoy/models/bulk_update_filters_response_200.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_filter_response import ModelsFilterResponse + + +T = TypeVar("T", bound="BulkUpdateFiltersResponse200") + + +@_attrs_define +class BulkUpdateFiltersResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (list[ModelsFilterResponse] | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: list[ModelsFilterResponse] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.data, Unset): + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_filter_response import ModelsFilterResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: list[ModelsFilterResponse] | Unset = UNSET + if _data is not UNSET: + data = [] + for data_item_data in _data: + data_item = ModelsFilterResponse.from_dict(data_item_data) + + data.append(data_item) + + bulk_update_filters_response_200 = cls( + message=message, + status=status, + data=data, + ) + + bulk_update_filters_response_200.additional_properties = d + return bulk_update_filters_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/bulk_update_filters_response_400.py b/src/convoy/models/bulk_update_filters_response_400.py new file mode 100644 index 0000000..72cf708 --- /dev/null +++ b/src/convoy/models/bulk_update_filters_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BulkUpdateFiltersResponse400") + + +@_attrs_define +class BulkUpdateFiltersResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + bulk_update_filters_response_400 = cls( + message=message, + status=status, + data=data, + ) + + bulk_update_filters_response_400.additional_properties = d + return bulk_update_filters_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/bulk_update_filters_response_401.py b/src/convoy/models/bulk_update_filters_response_401.py new file mode 100644 index 0000000..b4831f9 --- /dev/null +++ b/src/convoy/models/bulk_update_filters_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BulkUpdateFiltersResponse401") + + +@_attrs_define +class BulkUpdateFiltersResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + bulk_update_filters_response_401 = cls( + message=message, + status=status, + data=data, + ) + + bulk_update_filters_response_401.additional_properties = d + return bulk_update_filters_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/bulk_update_filters_response_404.py b/src/convoy/models/bulk_update_filters_response_404.py new file mode 100644 index 0000000..3ee6389 --- /dev/null +++ b/src/convoy/models/bulk_update_filters_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="BulkUpdateFiltersResponse404") + + +@_attrs_define +class BulkUpdateFiltersResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + bulk_update_filters_response_404 = cls( + message=message, + status=status, + data=data, + ) + + bulk_update_filters_response_404.additional_properties = d + return bulk_update_filters_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/config_request_id_header_provider.py b/src/convoy/models/config_request_id_header_provider.py new file mode 100644 index 0000000..51de3e3 --- /dev/null +++ b/src/convoy/models/config_request_id_header_provider.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class ConfigRequestIDHeaderProvider(str, Enum): + DEFAULT_REQUEST_ID_HEADER = "X-Convoy-Idempotency-Key" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/config_signature_header_provider.py b/src/convoy/models/config_signature_header_provider.py new file mode 100644 index 0000000..63cb1d9 --- /dev/null +++ b/src/convoy/models/config_signature_header_provider.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class ConfigSignatureHeaderProvider(str, Enum): + DEFAULT_SIGNATURE_HEADER = "X-Convoy-Signature" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/count_affected_events_direction.py b/src/convoy/models/count_affected_events_direction.py new file mode 100644 index 0000000..0391ef0 --- /dev/null +++ b/src/convoy/models/count_affected_events_direction.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class CountAffectedEventsDirection(str, Enum): + NEXT = "next" + PREV = "prev" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/count_affected_events_response_200.py b/src/convoy/models/count_affected_events_response_200.py new file mode 100644 index 0000000..13f11c1 --- /dev/null +++ b/src/convoy/models/count_affected_events_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_count_response import ModelsCountResponse + + +T = TypeVar("T", bound="CountAffectedEventsResponse200") + + +@_attrs_define +class CountAffectedEventsResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsCountResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsCountResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_count_response import ModelsCountResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsCountResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsCountResponse.from_dict(_data) + + count_affected_events_response_200 = cls( + message=message, + status=status, + data=data, + ) + + count_affected_events_response_200.additional_properties = d + return count_affected_events_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/count_affected_events_response_400.py b/src/convoy/models/count_affected_events_response_400.py new file mode 100644 index 0000000..78dad98 --- /dev/null +++ b/src/convoy/models/count_affected_events_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CountAffectedEventsResponse400") + + +@_attrs_define +class CountAffectedEventsResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + count_affected_events_response_400 = cls( + message=message, + status=status, + data=data, + ) + + count_affected_events_response_400.additional_properties = d + return count_affected_events_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/count_affected_events_response_401.py b/src/convoy/models/count_affected_events_response_401.py new file mode 100644 index 0000000..b3481ca --- /dev/null +++ b/src/convoy/models/count_affected_events_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CountAffectedEventsResponse401") + + +@_attrs_define +class CountAffectedEventsResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + count_affected_events_response_401 = cls( + message=message, + status=status, + data=data, + ) + + count_affected_events_response_401.additional_properties = d + return count_affected_events_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/count_affected_events_response_404.py b/src/convoy/models/count_affected_events_response_404.py new file mode 100644 index 0000000..aca3715 --- /dev/null +++ b/src/convoy/models/count_affected_events_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CountAffectedEventsResponse404") + + +@_attrs_define +class CountAffectedEventsResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + count_affected_events_response_404 = cls( + message=message, + status=status, + data=data, + ) + + count_affected_events_response_404.additional_properties = d + return count_affected_events_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_broadcast_event_response_201.py b/src/convoy/models/create_broadcast_event_response_201.py new file mode 100644 index 0000000..1b1ca3c --- /dev/null +++ b/src/convoy/models/create_broadcast_event_response_201.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_event_response import ModelsEventResponse + + +T = TypeVar("T", bound="CreateBroadcastEventResponse201") + + +@_attrs_define +class CreateBroadcastEventResponse201: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEventResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEventResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_event_response import ModelsEventResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEventResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEventResponse.from_dict(_data) + + create_broadcast_event_response_201 = cls( + message=message, + status=status, + data=data, + ) + + create_broadcast_event_response_201.additional_properties = d + return create_broadcast_event_response_201 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_broadcast_event_response_400.py b/src/convoy/models/create_broadcast_event_response_400.py new file mode 100644 index 0000000..a2d19c7 --- /dev/null +++ b/src/convoy/models/create_broadcast_event_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateBroadcastEventResponse400") + + +@_attrs_define +class CreateBroadcastEventResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_broadcast_event_response_400 = cls( + message=message, + status=status, + data=data, + ) + + create_broadcast_event_response_400.additional_properties = d + return create_broadcast_event_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_broadcast_event_response_401.py b/src/convoy/models/create_broadcast_event_response_401.py new file mode 100644 index 0000000..2825e95 --- /dev/null +++ b/src/convoy/models/create_broadcast_event_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateBroadcastEventResponse401") + + +@_attrs_define +class CreateBroadcastEventResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_broadcast_event_response_401 = cls( + message=message, + status=status, + data=data, + ) + + create_broadcast_event_response_401.additional_properties = d + return create_broadcast_event_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_broadcast_event_response_404.py b/src/convoy/models/create_broadcast_event_response_404.py new file mode 100644 index 0000000..8cb1583 --- /dev/null +++ b/src/convoy/models/create_broadcast_event_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateBroadcastEventResponse404") + + +@_attrs_define +class CreateBroadcastEventResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_broadcast_event_response_404 = cls( + message=message, + status=status, + data=data, + ) + + create_broadcast_event_response_404.additional_properties = d + return create_broadcast_event_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_dynamic_event_response_400.py b/src/convoy/models/create_dynamic_event_response_400.py new file mode 100644 index 0000000..76e120e --- /dev/null +++ b/src/convoy/models/create_dynamic_event_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateDynamicEventResponse400") + + +@_attrs_define +class CreateDynamicEventResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_dynamic_event_response_400 = cls( + message=message, + status=status, + data=data, + ) + + create_dynamic_event_response_400.additional_properties = d + return create_dynamic_event_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_dynamic_event_response_401.py b/src/convoy/models/create_dynamic_event_response_401.py new file mode 100644 index 0000000..5c97fca --- /dev/null +++ b/src/convoy/models/create_dynamic_event_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateDynamicEventResponse401") + + +@_attrs_define +class CreateDynamicEventResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_dynamic_event_response_401 = cls( + message=message, + status=status, + data=data, + ) + + create_dynamic_event_response_401.additional_properties = d + return create_dynamic_event_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_dynamic_event_response_404.py b/src/convoy/models/create_dynamic_event_response_404.py new file mode 100644 index 0000000..e865d5b --- /dev/null +++ b/src/convoy/models/create_dynamic_event_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateDynamicEventResponse404") + + +@_attrs_define +class CreateDynamicEventResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_dynamic_event_response_404 = cls( + message=message, + status=status, + data=data, + ) + + create_dynamic_event_response_404.additional_properties = d + return create_dynamic_event_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_endpoint_event_response_201.py b/src/convoy/models/create_endpoint_event_response_201.py new file mode 100644 index 0000000..ef908b0 --- /dev/null +++ b/src/convoy/models/create_endpoint_event_response_201.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEndpointEventResponse201") + + +@_attrs_define +class CreateEndpointEventResponse201: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_endpoint_event_response_201 = cls( + message=message, + status=status, + data=data, + ) + + create_endpoint_event_response_201.additional_properties = d + return create_endpoint_event_response_201 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_endpoint_event_response_400.py b/src/convoy/models/create_endpoint_event_response_400.py new file mode 100644 index 0000000..f0122fa --- /dev/null +++ b/src/convoy/models/create_endpoint_event_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEndpointEventResponse400") + + +@_attrs_define +class CreateEndpointEventResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_endpoint_event_response_400 = cls( + message=message, + status=status, + data=data, + ) + + create_endpoint_event_response_400.additional_properties = d + return create_endpoint_event_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_endpoint_event_response_401.py b/src/convoy/models/create_endpoint_event_response_401.py new file mode 100644 index 0000000..77b4298 --- /dev/null +++ b/src/convoy/models/create_endpoint_event_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEndpointEventResponse401") + + +@_attrs_define +class CreateEndpointEventResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_endpoint_event_response_401 = cls( + message=message, + status=status, + data=data, + ) + + create_endpoint_event_response_401.additional_properties = d + return create_endpoint_event_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_endpoint_event_response_404.py b/src/convoy/models/create_endpoint_event_response_404.py new file mode 100644 index 0000000..732cac2 --- /dev/null +++ b/src/convoy/models/create_endpoint_event_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEndpointEventResponse404") + + +@_attrs_define +class CreateEndpointEventResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_endpoint_event_response_404 = cls( + message=message, + status=status, + data=data, + ) + + create_endpoint_event_response_404.additional_properties = d + return create_endpoint_event_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_endpoint_fanout_event_response_201.py b/src/convoy/models/create_endpoint_fanout_event_response_201.py new file mode 100644 index 0000000..3cf27f2 --- /dev/null +++ b/src/convoy/models/create_endpoint_fanout_event_response_201.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEndpointFanoutEventResponse201") + + +@_attrs_define +class CreateEndpointFanoutEventResponse201: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_endpoint_fanout_event_response_201 = cls( + message=message, + status=status, + data=data, + ) + + create_endpoint_fanout_event_response_201.additional_properties = d + return create_endpoint_fanout_event_response_201 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_endpoint_fanout_event_response_400.py b/src/convoy/models/create_endpoint_fanout_event_response_400.py new file mode 100644 index 0000000..d951a65 --- /dev/null +++ b/src/convoy/models/create_endpoint_fanout_event_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEndpointFanoutEventResponse400") + + +@_attrs_define +class CreateEndpointFanoutEventResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_endpoint_fanout_event_response_400 = cls( + message=message, + status=status, + data=data, + ) + + create_endpoint_fanout_event_response_400.additional_properties = d + return create_endpoint_fanout_event_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_endpoint_fanout_event_response_401.py b/src/convoy/models/create_endpoint_fanout_event_response_401.py new file mode 100644 index 0000000..64873ab --- /dev/null +++ b/src/convoy/models/create_endpoint_fanout_event_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEndpointFanoutEventResponse401") + + +@_attrs_define +class CreateEndpointFanoutEventResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_endpoint_fanout_event_response_401 = cls( + message=message, + status=status, + data=data, + ) + + create_endpoint_fanout_event_response_401.additional_properties = d + return create_endpoint_fanout_event_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_endpoint_fanout_event_response_404.py b/src/convoy/models/create_endpoint_fanout_event_response_404.py new file mode 100644 index 0000000..852134e --- /dev/null +++ b/src/convoy/models/create_endpoint_fanout_event_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEndpointFanoutEventResponse404") + + +@_attrs_define +class CreateEndpointFanoutEventResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_endpoint_fanout_event_response_404 = cls( + message=message, + status=status, + data=data, + ) + + create_endpoint_fanout_event_response_404.additional_properties = d + return create_endpoint_fanout_event_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_endpoint_response_201.py b/src/convoy/models/create_endpoint_response_201.py new file mode 100644 index 0000000..0947564 --- /dev/null +++ b/src/convoy/models/create_endpoint_response_201.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_endpoint_response import ModelsEndpointResponse + + +T = TypeVar("T", bound="CreateEndpointResponse201") + + +@_attrs_define +class CreateEndpointResponse201: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEndpointResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEndpointResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_endpoint_response import ModelsEndpointResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEndpointResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEndpointResponse.from_dict(_data) + + create_endpoint_response_201 = cls( + message=message, + status=status, + data=data, + ) + + create_endpoint_response_201.additional_properties = d + return create_endpoint_response_201 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_endpoint_response_400.py b/src/convoy/models/create_endpoint_response_400.py new file mode 100644 index 0000000..3b733b7 --- /dev/null +++ b/src/convoy/models/create_endpoint_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEndpointResponse400") + + +@_attrs_define +class CreateEndpointResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_endpoint_response_400 = cls( + message=message, + status=status, + data=data, + ) + + create_endpoint_response_400.additional_properties = d + return create_endpoint_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_endpoint_response_401.py b/src/convoy/models/create_endpoint_response_401.py new file mode 100644 index 0000000..bad1e30 --- /dev/null +++ b/src/convoy/models/create_endpoint_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEndpointResponse401") + + +@_attrs_define +class CreateEndpointResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_endpoint_response_401 = cls( + message=message, + status=status, + data=data, + ) + + create_endpoint_response_401.additional_properties = d + return create_endpoint_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_endpoint_response_404.py b/src/convoy/models/create_endpoint_response_404.py new file mode 100644 index 0000000..8c7cd7d --- /dev/null +++ b/src/convoy/models/create_endpoint_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEndpointResponse404") + + +@_attrs_define +class CreateEndpointResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_endpoint_response_404 = cls( + message=message, + status=status, + data=data, + ) + + create_endpoint_response_404.additional_properties = d + return create_endpoint_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_event_type_response_201.py b/src/convoy/models/create_event_type_response_201.py new file mode 100644 index 0000000..d8ae122 --- /dev/null +++ b/src/convoy/models/create_event_type_response_201.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_event_type_response import ModelsEventTypeResponse + + +T = TypeVar("T", bound="CreateEventTypeResponse201") + + +@_attrs_define +class CreateEventTypeResponse201: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEventTypeResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEventTypeResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_event_type_response import ModelsEventTypeResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEventTypeResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEventTypeResponse.from_dict(_data) + + create_event_type_response_201 = cls( + message=message, + status=status, + data=data, + ) + + create_event_type_response_201.additional_properties = d + return create_event_type_response_201 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_event_type_response_400.py b/src/convoy/models/create_event_type_response_400.py new file mode 100644 index 0000000..129cb4d --- /dev/null +++ b/src/convoy/models/create_event_type_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEventTypeResponse400") + + +@_attrs_define +class CreateEventTypeResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_event_type_response_400 = cls( + message=message, + status=status, + data=data, + ) + + create_event_type_response_400.additional_properties = d + return create_event_type_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_event_type_response_401.py b/src/convoy/models/create_event_type_response_401.py new file mode 100644 index 0000000..0ea0c78 --- /dev/null +++ b/src/convoy/models/create_event_type_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEventTypeResponse401") + + +@_attrs_define +class CreateEventTypeResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_event_type_response_401 = cls( + message=message, + status=status, + data=data, + ) + + create_event_type_response_401.additional_properties = d + return create_event_type_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_event_type_response_404.py b/src/convoy/models/create_event_type_response_404.py new file mode 100644 index 0000000..cdcbf06 --- /dev/null +++ b/src/convoy/models/create_event_type_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateEventTypeResponse404") + + +@_attrs_define +class CreateEventTypeResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_event_type_response_404 = cls( + message=message, + status=status, + data=data, + ) + + create_event_type_response_404.additional_properties = d + return create_event_type_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_filter_response_201.py b/src/convoy/models/create_filter_response_201.py new file mode 100644 index 0000000..5483751 --- /dev/null +++ b/src/convoy/models/create_filter_response_201.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_filter_response import ModelsFilterResponse + + +T = TypeVar("T", bound="CreateFilterResponse201") + + +@_attrs_define +class CreateFilterResponse201: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsFilterResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsFilterResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_filter_response import ModelsFilterResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsFilterResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsFilterResponse.from_dict(_data) + + create_filter_response_201 = cls( + message=message, + status=status, + data=data, + ) + + create_filter_response_201.additional_properties = d + return create_filter_response_201 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_filter_response_400.py b/src/convoy/models/create_filter_response_400.py new file mode 100644 index 0000000..8793b0c --- /dev/null +++ b/src/convoy/models/create_filter_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateFilterResponse400") + + +@_attrs_define +class CreateFilterResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_filter_response_400 = cls( + message=message, + status=status, + data=data, + ) + + create_filter_response_400.additional_properties = d + return create_filter_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_filter_response_401.py b/src/convoy/models/create_filter_response_401.py new file mode 100644 index 0000000..c74d74a --- /dev/null +++ b/src/convoy/models/create_filter_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateFilterResponse401") + + +@_attrs_define +class CreateFilterResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_filter_response_401 = cls( + message=message, + status=status, + data=data, + ) + + create_filter_response_401.additional_properties = d + return create_filter_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_filter_response_404.py b/src/convoy/models/create_filter_response_404.py new file mode 100644 index 0000000..6b0f2ab --- /dev/null +++ b/src/convoy/models/create_filter_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateFilterResponse404") + + +@_attrs_define +class CreateFilterResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_filter_response_404 = cls( + message=message, + status=status, + data=data, + ) + + create_filter_response_404.additional_properties = d + return create_filter_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_portal_link_response_201.py b/src/convoy/models/create_portal_link_response_201.py new file mode 100644 index 0000000..aa282a7 --- /dev/null +++ b/src/convoy/models/create_portal_link_response_201.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_portal_link_response import DatastorePortalLinkResponse + + +T = TypeVar("T", bound="CreatePortalLinkResponse201") + + +@_attrs_define +class CreatePortalLinkResponse201: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (DatastorePortalLinkResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: DatastorePortalLinkResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_portal_link_response import DatastorePortalLinkResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: DatastorePortalLinkResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = DatastorePortalLinkResponse.from_dict(_data) + + create_portal_link_response_201 = cls( + message=message, + status=status, + data=data, + ) + + create_portal_link_response_201.additional_properties = d + return create_portal_link_response_201 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_portal_link_response_400.py b/src/convoy/models/create_portal_link_response_400.py new file mode 100644 index 0000000..b08649e --- /dev/null +++ b/src/convoy/models/create_portal_link_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreatePortalLinkResponse400") + + +@_attrs_define +class CreatePortalLinkResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_portal_link_response_400 = cls( + message=message, + status=status, + data=data, + ) + + create_portal_link_response_400.additional_properties = d + return create_portal_link_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_portal_link_response_401.py b/src/convoy/models/create_portal_link_response_401.py new file mode 100644 index 0000000..6d532b1 --- /dev/null +++ b/src/convoy/models/create_portal_link_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreatePortalLinkResponse401") + + +@_attrs_define +class CreatePortalLinkResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_portal_link_response_401 = cls( + message=message, + status=status, + data=data, + ) + + create_portal_link_response_401.additional_properties = d + return create_portal_link_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_portal_link_response_404.py b/src/convoy/models/create_portal_link_response_404.py new file mode 100644 index 0000000..f40aca5 --- /dev/null +++ b/src/convoy/models/create_portal_link_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreatePortalLinkResponse404") + + +@_attrs_define +class CreatePortalLinkResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_portal_link_response_404 = cls( + message=message, + status=status, + data=data, + ) + + create_portal_link_response_404.additional_properties = d + return create_portal_link_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_project_response_201.py b/src/convoy/models/create_project_response_201.py new file mode 100644 index 0000000..f3c1f16 --- /dev/null +++ b/src/convoy/models/create_project_response_201.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_create_project_response import ModelsCreateProjectResponse + + +T = TypeVar("T", bound="CreateProjectResponse201") + + +@_attrs_define +class CreateProjectResponse201: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsCreateProjectResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsCreateProjectResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_create_project_response import ModelsCreateProjectResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsCreateProjectResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsCreateProjectResponse.from_dict(_data) + + create_project_response_201 = cls( + message=message, + status=status, + data=data, + ) + + create_project_response_201.additional_properties = d + return create_project_response_201 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_project_response_400.py b/src/convoy/models/create_project_response_400.py new file mode 100644 index 0000000..f555ddc --- /dev/null +++ b/src/convoy/models/create_project_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateProjectResponse400") + + +@_attrs_define +class CreateProjectResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_project_response_400 = cls( + message=message, + status=status, + data=data, + ) + + create_project_response_400.additional_properties = d + return create_project_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_project_response_401.py b/src/convoy/models/create_project_response_401.py new file mode 100644 index 0000000..2f896b2 --- /dev/null +++ b/src/convoy/models/create_project_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateProjectResponse401") + + +@_attrs_define +class CreateProjectResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_project_response_401 = cls( + message=message, + status=status, + data=data, + ) + + create_project_response_401.additional_properties = d + return create_project_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_project_response_402.py b/src/convoy/models/create_project_response_402.py new file mode 100644 index 0000000..a1eacee --- /dev/null +++ b/src/convoy/models/create_project_response_402.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateProjectResponse402") + + +@_attrs_define +class CreateProjectResponse402: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_project_response_402 = cls( + message=message, + status=status, + data=data, + ) + + create_project_response_402.additional_properties = d + return create_project_response_402 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_project_response_403.py b/src/convoy/models/create_project_response_403.py new file mode 100644 index 0000000..19379db --- /dev/null +++ b/src/convoy/models/create_project_response_403.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateProjectResponse403") + + +@_attrs_define +class CreateProjectResponse403: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_project_response_403 = cls( + message=message, + status=status, + data=data, + ) + + create_project_response_403.additional_properties = d + return create_project_response_403 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_project_response_404.py b/src/convoy/models/create_project_response_404.py new file mode 100644 index 0000000..d709e45 --- /dev/null +++ b/src/convoy/models/create_project_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateProjectResponse404") + + +@_attrs_define +class CreateProjectResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_project_response_404 = cls( + message=message, + status=status, + data=data, + ) + + create_project_response_404.additional_properties = d + return create_project_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_source_response_201.py b/src/convoy/models/create_source_response_201.py new file mode 100644 index 0000000..4df41b6 --- /dev/null +++ b/src/convoy/models/create_source_response_201.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_source_response import ModelsSourceResponse + + +T = TypeVar("T", bound="CreateSourceResponse201") + + +@_attrs_define +class CreateSourceResponse201: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsSourceResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsSourceResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_source_response import ModelsSourceResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsSourceResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsSourceResponse.from_dict(_data) + + create_source_response_201 = cls( + message=message, + status=status, + data=data, + ) + + create_source_response_201.additional_properties = d + return create_source_response_201 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_source_response_400.py b/src/convoy/models/create_source_response_400.py new file mode 100644 index 0000000..4e38e8b --- /dev/null +++ b/src/convoy/models/create_source_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateSourceResponse400") + + +@_attrs_define +class CreateSourceResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_source_response_400 = cls( + message=message, + status=status, + data=data, + ) + + create_source_response_400.additional_properties = d + return create_source_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_source_response_401.py b/src/convoy/models/create_source_response_401.py new file mode 100644 index 0000000..9f9b54a --- /dev/null +++ b/src/convoy/models/create_source_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateSourceResponse401") + + +@_attrs_define +class CreateSourceResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_source_response_401 = cls( + message=message, + status=status, + data=data, + ) + + create_source_response_401.additional_properties = d + return create_source_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_source_response_404.py b/src/convoy/models/create_source_response_404.py new file mode 100644 index 0000000..b05de65 --- /dev/null +++ b/src/convoy/models/create_source_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateSourceResponse404") + + +@_attrs_define +class CreateSourceResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_source_response_404 = cls( + message=message, + status=status, + data=data, + ) + + create_source_response_404.additional_properties = d + return create_source_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_subscription_response_201.py b/src/convoy/models/create_subscription_response_201.py new file mode 100644 index 0000000..78ecbc2 --- /dev/null +++ b/src/convoy/models/create_subscription_response_201.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_subscription_response import ModelsSubscriptionResponse + + +T = TypeVar("T", bound="CreateSubscriptionResponse201") + + +@_attrs_define +class CreateSubscriptionResponse201: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsSubscriptionResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsSubscriptionResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_subscription_response import ModelsSubscriptionResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsSubscriptionResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsSubscriptionResponse.from_dict(_data) + + create_subscription_response_201 = cls( + message=message, + status=status, + data=data, + ) + + create_subscription_response_201.additional_properties = d + return create_subscription_response_201 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_subscription_response_400.py b/src/convoy/models/create_subscription_response_400.py new file mode 100644 index 0000000..6b14027 --- /dev/null +++ b/src/convoy/models/create_subscription_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateSubscriptionResponse400") + + +@_attrs_define +class CreateSubscriptionResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_subscription_response_400 = cls( + message=message, + status=status, + data=data, + ) + + create_subscription_response_400.additional_properties = d + return create_subscription_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_subscription_response_401.py b/src/convoy/models/create_subscription_response_401.py new file mode 100644 index 0000000..ce3c756 --- /dev/null +++ b/src/convoy/models/create_subscription_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateSubscriptionResponse401") + + +@_attrs_define +class CreateSubscriptionResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_subscription_response_401 = cls( + message=message, + status=status, + data=data, + ) + + create_subscription_response_401.additional_properties = d + return create_subscription_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/create_subscription_response_404.py b/src/convoy/models/create_subscription_response_404.py new file mode 100644 index 0000000..bf31e01 --- /dev/null +++ b/src/convoy/models/create_subscription_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="CreateSubscriptionResponse404") + + +@_attrs_define +class CreateSubscriptionResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + create_subscription_response_404 = cls( + message=message, + status=status, + data=data, + ) + + create_subscription_response_404.additional_properties = d + return create_subscription_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_alert_configuration.py b/src/convoy/models/datastore_alert_configuration.py new file mode 100644 index 0000000..759192a --- /dev/null +++ b/src/convoy/models/datastore_alert_configuration.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreAlertConfiguration") + + +@_attrs_define +class DatastoreAlertConfiguration: + """ + Attributes: + count (int | Unset): + threshold (str | Unset): + """ + + count: int | Unset = UNSET + threshold: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + threshold = self.threshold + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if count is not UNSET: + field_dict["count"] = count + if threshold is not UNSET: + field_dict["threshold"] = threshold + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + count = d.pop("count", UNSET) + + threshold = d.pop("threshold", UNSET) + + datastore_alert_configuration = cls( + count=count, + threshold=threshold, + ) + + datastore_alert_configuration.additional_properties = d + return datastore_alert_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_amqp_credentials.py b/src/convoy/models/datastore_amqp_credentials.py new file mode 100644 index 0000000..8812411 --- /dev/null +++ b/src/convoy/models/datastore_amqp_credentials.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreAmqpCredentials") + + +@_attrs_define +class DatastoreAmqpCredentials: + """ + Attributes: + password (str | Unset): + user (str | Unset): + """ + + password: str | Unset = UNSET + user: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + password = self.password + + user = self.user + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if password is not UNSET: + field_dict["password"] = password + if user is not UNSET: + field_dict["user"] = user + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + password = d.pop("password", UNSET) + + user = d.pop("user", UNSET) + + datastore_amqp_credentials = cls( + password=password, + user=user, + ) + + datastore_amqp_credentials.additional_properties = d + return datastore_amqp_credentials + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_amqp_pub_sub_config.py b/src/convoy/models/datastore_amqp_pub_sub_config.py new file mode 100644 index 0000000..82ee549 --- /dev/null +++ b/src/convoy/models/datastore_amqp_pub_sub_config.py @@ -0,0 +1,146 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_amqp_credentials import DatastoreAmqpCredentials + + +T = TypeVar("T", bound="DatastoreAmqpPubSubConfig") + + +@_attrs_define +class DatastoreAmqpPubSubConfig: + """ + Attributes: + host (str | Unset): + auth (DatastoreAmqpCredentials | Unset): + binded_exchange (str | Unset): + dead_letter_exchange (str | Unset): + port (str | Unset): + queue (str | Unset): + routing_key (str | Unset): + schema (str | Unset): + vhost (str | Unset): + """ + + host: str | Unset = UNSET + auth: DatastoreAmqpCredentials | Unset = UNSET + binded_exchange: str | Unset = UNSET + dead_letter_exchange: str | Unset = UNSET + port: str | Unset = UNSET + queue: str | Unset = UNSET + routing_key: str | Unset = UNSET + schema: str | Unset = UNSET + vhost: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + host = self.host + + auth: dict[str, Any] | Unset = UNSET + if not isinstance(self.auth, Unset): + auth = self.auth.to_dict() + + binded_exchange = self.binded_exchange + + dead_letter_exchange = self.dead_letter_exchange + + port = self.port + + queue = self.queue + + routing_key = self.routing_key + + schema = self.schema + + vhost = self.vhost + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if host is not UNSET: + field_dict["host"] = host + if auth is not UNSET: + field_dict["auth"] = auth + if binded_exchange is not UNSET: + field_dict["bindedExchange"] = binded_exchange + if dead_letter_exchange is not UNSET: + field_dict["deadLetterExchange"] = dead_letter_exchange + if port is not UNSET: + field_dict["port"] = port + if queue is not UNSET: + field_dict["queue"] = queue + if routing_key is not UNSET: + field_dict["routingKey"] = routing_key + if schema is not UNSET: + field_dict["schema"] = schema + if vhost is not UNSET: + field_dict["vhost"] = vhost + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_amqp_credentials import DatastoreAmqpCredentials + + d = dict(src_dict) + host = d.pop("host", UNSET) + + _auth = d.pop("auth", UNSET) + auth: DatastoreAmqpCredentials | Unset + if isinstance(_auth, Unset): + auth = UNSET + else: + auth = DatastoreAmqpCredentials.from_dict(_auth) + + binded_exchange = d.pop("bindedExchange", UNSET) + + dead_letter_exchange = d.pop("deadLetterExchange", UNSET) + + port = d.pop("port", UNSET) + + queue = d.pop("queue", UNSET) + + routing_key = d.pop("routingKey", UNSET) + + schema = d.pop("schema", UNSET) + + vhost = d.pop("vhost", UNSET) + + datastore_amqp_pub_sub_config = cls( + host=host, + auth=auth, + binded_exchange=binded_exchange, + dead_letter_exchange=dead_letter_exchange, + port=port, + queue=queue, + routing_key=routing_key, + schema=schema, + vhost=vhost, + ) + + datastore_amqp_pub_sub_config.additional_properties = d + return datastore_amqp_pub_sub_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_api_key.py b/src/convoy/models/datastore_api_key.py new file mode 100644 index 0000000..4b30636 --- /dev/null +++ b/src/convoy/models/datastore_api_key.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreApiKey") + + +@_attrs_define +class DatastoreApiKey: + """ + Attributes: + header_name (str | Unset): + header_value (str | Unset): + """ + + header_name: str | Unset = UNSET + header_value: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + header_name = self.header_name + + header_value = self.header_value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if header_name is not UNSET: + field_dict["header_name"] = header_name + if header_value is not UNSET: + field_dict["header_value"] = header_value + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + header_name = d.pop("header_name", UNSET) + + header_value = d.pop("header_value", UNSET) + + datastore_api_key = cls( + header_name=header_name, + header_value=header_value, + ) + + datastore_api_key.additional_properties = d + return datastore_api_key + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_api_key_response.py b/src/convoy/models/datastore_api_key_response.py new file mode 100644 index 0000000..c79b272 --- /dev/null +++ b/src/convoy/models/datastore_api_key_response.py @@ -0,0 +1,137 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_role import DatastoreRole + + +T = TypeVar("T", bound="DatastoreAPIKeyResponse") + + +@_attrs_define +class DatastoreAPIKeyResponse: + """ + Attributes: + created_at (str | Unset): + expires_at (str | Unset): + key (str | Unset): + key_type (str | Unset): + name (str | Unset): + role (DatastoreRole | Unset): + uid (str | Unset): + user_id (str | Unset): + """ + + created_at: str | Unset = UNSET + expires_at: str | Unset = UNSET + key: str | Unset = UNSET + key_type: str | Unset = UNSET + name: str | Unset = UNSET + role: DatastoreRole | Unset = UNSET + uid: str | Unset = UNSET + user_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at + + expires_at = self.expires_at + + key = self.key + + key_type = self.key_type + + name = self.name + + role: dict[str, Any] | Unset = UNSET + if not isinstance(self.role, Unset): + role = self.role.to_dict() + + uid = self.uid + + user_id = self.user_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if created_at is not UNSET: + field_dict["created_at"] = created_at + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + if key is not UNSET: + field_dict["key"] = key + if key_type is not UNSET: + field_dict["key_type"] = key_type + if name is not UNSET: + field_dict["name"] = name + if role is not UNSET: + field_dict["role"] = role + if uid is not UNSET: + field_dict["uid"] = uid + if user_id is not UNSET: + field_dict["user_id"] = user_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_role import DatastoreRole + + d = dict(src_dict) + created_at = d.pop("created_at", UNSET) + + expires_at = d.pop("expires_at", UNSET) + + key = d.pop("key", UNSET) + + key_type = d.pop("key_type", UNSET) + + name = d.pop("name", UNSET) + + _role = d.pop("role", UNSET) + role: DatastoreRole | Unset + if isinstance(_role, Unset): + role = UNSET + else: + role = DatastoreRole.from_dict(_role) + + uid = d.pop("uid", UNSET) + + user_id = d.pop("user_id", UNSET) + + datastore_api_key_response = cls( + created_at=created_at, + expires_at=expires_at, + key=key, + key_type=key_type, + name=name, + role=role, + uid=uid, + user_id=user_id, + ) + + datastore_api_key_response.additional_properties = d + return datastore_api_key_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_basic_auth.py b/src/convoy/models/datastore_basic_auth.py new file mode 100644 index 0000000..9ed3ec2 --- /dev/null +++ b/src/convoy/models/datastore_basic_auth.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreBasicAuth") + + +@_attrs_define +class DatastoreBasicAuth: + """ + Attributes: + password (str | Unset): + username (str | Unset): + """ + + password: str | Unset = UNSET + username: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + password = self.password + + username = self.username + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if password is not UNSET: + field_dict["password"] = password + if username is not UNSET: + field_dict["username"] = username + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + password = d.pop("password", UNSET) + + username = d.pop("username", UNSET) + + datastore_basic_auth = cls( + password=password, + username=username, + ) + + datastore_basic_auth.additional_properties = d + return datastore_basic_auth + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_circuit_breaker_configuration.py b/src/convoy/models/datastore_circuit_breaker_configuration.py new file mode 100644 index 0000000..9647911 --- /dev/null +++ b/src/convoy/models/datastore_circuit_breaker_configuration.py @@ -0,0 +1,115 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreCircuitBreakerConfiguration") + + +@_attrs_define +class DatastoreCircuitBreakerConfiguration: + """ + Attributes: + consecutive_failure_threshold (int | Unset): + error_timeout (int | Unset): + failure_threshold (int | Unset): + minimum_request_count (int | Unset): + observability_window (int | Unset): + sample_rate (int | Unset): + success_threshold (int | Unset): + """ + + consecutive_failure_threshold: int | Unset = UNSET + error_timeout: int | Unset = UNSET + failure_threshold: int | Unset = UNSET + minimum_request_count: int | Unset = UNSET + observability_window: int | Unset = UNSET + sample_rate: int | Unset = UNSET + success_threshold: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + consecutive_failure_threshold = self.consecutive_failure_threshold + + error_timeout = self.error_timeout + + failure_threshold = self.failure_threshold + + minimum_request_count = self.minimum_request_count + + observability_window = self.observability_window + + sample_rate = self.sample_rate + + success_threshold = self.success_threshold + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if consecutive_failure_threshold is not UNSET: + field_dict["consecutive_failure_threshold"] = consecutive_failure_threshold + if error_timeout is not UNSET: + field_dict["error_timeout"] = error_timeout + if failure_threshold is not UNSET: + field_dict["failure_threshold"] = failure_threshold + if minimum_request_count is not UNSET: + field_dict["minimum_request_count"] = minimum_request_count + if observability_window is not UNSET: + field_dict["observability_window"] = observability_window + if sample_rate is not UNSET: + field_dict["sample_rate"] = sample_rate + if success_threshold is not UNSET: + field_dict["success_threshold"] = success_threshold + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + consecutive_failure_threshold = d.pop("consecutive_failure_threshold", UNSET) + + error_timeout = d.pop("error_timeout", UNSET) + + failure_threshold = d.pop("failure_threshold", UNSET) + + minimum_request_count = d.pop("minimum_request_count", UNSET) + + observability_window = d.pop("observability_window", UNSET) + + sample_rate = d.pop("sample_rate", UNSET) + + success_threshold = d.pop("success_threshold", UNSET) + + datastore_circuit_breaker_configuration = cls( + consecutive_failure_threshold=consecutive_failure_threshold, + error_timeout=error_timeout, + failure_threshold=failure_threshold, + minimum_request_count=minimum_request_count, + observability_window=observability_window, + sample_rate=sample_rate, + success_threshold=success_threshold, + ) + + datastore_circuit_breaker_configuration.additional_properties = d + return datastore_circuit_breaker_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_cli_metadata.py b/src/convoy/models/datastore_cli_metadata.py new file mode 100644 index 0000000..53121c3 --- /dev/null +++ b/src/convoy/models/datastore_cli_metadata.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreCLIMetadata") + + +@_attrs_define +class DatastoreCLIMetadata: + """ + Attributes: + event_type (str | Unset): + source_id (str | Unset): + """ + + event_type: str | Unset = UNSET + source_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event_type = self.event_type + + source_id = self.source_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if event_type is not UNSET: + field_dict["event_type"] = event_type + if source_id is not UNSET: + field_dict["source_id"] = source_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event_type = d.pop("event_type", UNSET) + + source_id = d.pop("source_id", UNSET) + + datastore_cli_metadata = cls( + event_type=event_type, + source_id=source_id, + ) + + datastore_cli_metadata.additional_properties = d + return datastore_cli_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_create_portal_link_request.py b/src/convoy/models/datastore_create_portal_link_request.py new file mode 100644 index 0000000..67b920d --- /dev/null +++ b/src/convoy/models/datastore_create_portal_link_request.py @@ -0,0 +1,100 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreCreatePortalLinkRequest") + + +@_attrs_define +class DatastoreCreatePortalLinkRequest: + """ + Attributes: + auth_type (str | Unset): + can_manage_endpoint (bool | Unset): Specify whether endpoint management can be done through the Portal Link UI + endpoints (list[str] | Unset): Deprecated + IDs of endpoints in this portal link + name (str | Unset): Portal Link Name + owner_id (str | Unset): OwnerID, the portal link will inherit all the endpoints with this owner ID + """ + + auth_type: str | Unset = UNSET + can_manage_endpoint: bool | Unset = UNSET + endpoints: list[str] | Unset = UNSET + name: str | Unset = UNSET + owner_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + auth_type = self.auth_type + + can_manage_endpoint = self.can_manage_endpoint + + endpoints: list[str] | Unset = UNSET + if not isinstance(self.endpoints, Unset): + endpoints = self.endpoints + + name = self.name + + owner_id = self.owner_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if auth_type is not UNSET: + field_dict["auth_type"] = auth_type + if can_manage_endpoint is not UNSET: + field_dict["can_manage_endpoint"] = can_manage_endpoint + if endpoints is not UNSET: + field_dict["endpoints"] = endpoints + if name is not UNSET: + field_dict["name"] = name + if owner_id is not UNSET: + field_dict["owner_id"] = owner_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + auth_type = d.pop("auth_type", UNSET) + + can_manage_endpoint = d.pop("can_manage_endpoint", UNSET) + + endpoints = cast(list[str], d.pop("endpoints", UNSET)) + + name = d.pop("name", UNSET) + + owner_id = d.pop("owner_id", UNSET) + + datastore_create_portal_link_request = cls( + auth_type=auth_type, + can_manage_endpoint=can_manage_endpoint, + endpoints=endpoints, + name=name, + owner_id=owner_id, + ) + + datastore_create_portal_link_request.additional_properties = d + return datastore_create_portal_link_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_custom_response.py b/src/convoy/models/datastore_custom_response.py new file mode 100644 index 0000000..7487ca0 --- /dev/null +++ b/src/convoy/models/datastore_custom_response.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreCustomResponse") + + +@_attrs_define +class DatastoreCustomResponse: + """ + Attributes: + body (str | Unset): + content_type (str | Unset): + """ + + body: str | Unset = UNSET + content_type: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + body = self.body + + content_type = self.content_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if body is not UNSET: + field_dict["body"] = body + if content_type is not UNSET: + field_dict["content_type"] = content_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + body = d.pop("body", UNSET) + + content_type = d.pop("content_type", UNSET) + + datastore_custom_response = cls( + body=body, + content_type=content_type, + ) + + datastore_custom_response.additional_properties = d + return datastore_custom_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_delivery_attempt.py b/src/convoy/models/datastore_delivery_attempt.py new file mode 100644 index 0000000..b53db8e --- /dev/null +++ b/src/convoy/models/datastore_delivery_attempt.py @@ -0,0 +1,243 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_http_header import DatastoreHttpHeader + + +T = TypeVar("T", bound="DatastoreDeliveryAttempt") + + +@_attrs_define +class DatastoreDeliveryAttempt: + """ + Attributes: + api_version (str | Unset): + created_at (str | Unset): + deleted_at (str | Unset): + endpoint_id (str | Unset): + error (str | Unset): + http_status (str | Unset): + ip_address (str | Unset): + method (str | Unset): + msg_id (str | Unset): + project_id (str | Unset): + request_http_header (DatastoreHttpHeader | Unset): + requested_at (str | Unset): + responded_at (str | Unset): + response_data (str | Unset): + response_http_header (DatastoreHttpHeader | Unset): + status (bool | Unset): + uid (str | Unset): + updated_at (str | Unset): + url (str | Unset): + """ + + api_version: str | Unset = UNSET + created_at: str | Unset = UNSET + deleted_at: str | Unset = UNSET + endpoint_id: str | Unset = UNSET + error: str | Unset = UNSET + http_status: str | Unset = UNSET + ip_address: str | Unset = UNSET + method: str | Unset = UNSET + msg_id: str | Unset = UNSET + project_id: str | Unset = UNSET + request_http_header: DatastoreHttpHeader | Unset = UNSET + requested_at: str | Unset = UNSET + responded_at: str | Unset = UNSET + response_data: str | Unset = UNSET + response_http_header: DatastoreHttpHeader | Unset = UNSET + status: bool | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + api_version = self.api_version + + created_at = self.created_at + + deleted_at = self.deleted_at + + endpoint_id = self.endpoint_id + + error = self.error + + http_status = self.http_status + + ip_address = self.ip_address + + method = self.method + + msg_id = self.msg_id + + project_id = self.project_id + + request_http_header: dict[str, Any] | Unset = UNSET + if not isinstance(self.request_http_header, Unset): + request_http_header = self.request_http_header.to_dict() + + requested_at = self.requested_at + + responded_at = self.responded_at + + response_data = self.response_data + + response_http_header: dict[str, Any] | Unset = UNSET + if not isinstance(self.response_http_header, Unset): + response_http_header = self.response_http_header.to_dict() + + status = self.status + + uid = self.uid + + updated_at = self.updated_at + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if api_version is not UNSET: + field_dict["api_version"] = api_version + if created_at is not UNSET: + field_dict["created_at"] = created_at + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if endpoint_id is not UNSET: + field_dict["endpoint_id"] = endpoint_id + if error is not UNSET: + field_dict["error"] = error + if http_status is not UNSET: + field_dict["http_status"] = http_status + if ip_address is not UNSET: + field_dict["ip_address"] = ip_address + if method is not UNSET: + field_dict["method"] = method + if msg_id is not UNSET: + field_dict["msg_id"] = msg_id + if project_id is not UNSET: + field_dict["project_id"] = project_id + if request_http_header is not UNSET: + field_dict["request_http_header"] = request_http_header + if requested_at is not UNSET: + field_dict["requested_at"] = requested_at + if responded_at is not UNSET: + field_dict["responded_at"] = responded_at + if response_data is not UNSET: + field_dict["response_data"] = response_data + if response_http_header is not UNSET: + field_dict["response_http_header"] = response_http_header + if status is not UNSET: + field_dict["status"] = status + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_http_header import DatastoreHttpHeader + + d = dict(src_dict) + api_version = d.pop("api_version", UNSET) + + created_at = d.pop("created_at", UNSET) + + deleted_at = d.pop("deleted_at", UNSET) + + endpoint_id = d.pop("endpoint_id", UNSET) + + error = d.pop("error", UNSET) + + http_status = d.pop("http_status", UNSET) + + ip_address = d.pop("ip_address", UNSET) + + method = d.pop("method", UNSET) + + msg_id = d.pop("msg_id", UNSET) + + project_id = d.pop("project_id", UNSET) + + _request_http_header = d.pop("request_http_header", UNSET) + request_http_header: DatastoreHttpHeader | Unset + if isinstance(_request_http_header, Unset): + request_http_header = UNSET + else: + request_http_header = DatastoreHttpHeader.from_dict(_request_http_header) + + requested_at = d.pop("requested_at", UNSET) + + responded_at = d.pop("responded_at", UNSET) + + response_data = d.pop("response_data", UNSET) + + _response_http_header = d.pop("response_http_header", UNSET) + response_http_header: DatastoreHttpHeader | Unset + if isinstance(_response_http_header, Unset): + response_http_header = UNSET + else: + response_http_header = DatastoreHttpHeader.from_dict(_response_http_header) + + status = d.pop("status", UNSET) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + url = d.pop("url", UNSET) + + datastore_delivery_attempt = cls( + api_version=api_version, + created_at=created_at, + deleted_at=deleted_at, + endpoint_id=endpoint_id, + error=error, + http_status=http_status, + ip_address=ip_address, + method=method, + msg_id=msg_id, + project_id=project_id, + request_http_header=request_http_header, + requested_at=requested_at, + responded_at=responded_at, + response_data=response_data, + response_http_header=response_http_header, + status=status, + uid=uid, + updated_at=updated_at, + url=url, + ) + + datastore_delivery_attempt.additional_properties = d + return datastore_delivery_attempt + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_delivery_mode.py b/src/convoy/models/datastore_delivery_mode.py new file mode 100644 index 0000000..76e11a4 --- /dev/null +++ b/src/convoy/models/datastore_delivery_mode.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class DatastoreDeliveryMode(str, Enum): + AT_LEAST_ONCE_DELIVERY_MODE = "at_least_once" + AT_MOST_ONCE_DELIVERY_MODE = "at_most_once" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_device.py b/src/convoy/models/datastore_device.py new file mode 100644 index 0000000..f60b168 --- /dev/null +++ b/src/convoy/models/datastore_device.py @@ -0,0 +1,141 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_device_status import DatastoreDeviceStatus +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreDevice") + + +@_attrs_define +class DatastoreDevice: + """ + Attributes: + created_at (str | Unset): + deleted_at (str | Unset): + endpoint_id (str | Unset): + host_name (str | Unset): + last_seen_at (str | Unset): + project_id (str | Unset): + status (DatastoreDeviceStatus | Unset): + uid (str | Unset): + updated_at (str | Unset): + """ + + created_at: str | Unset = UNSET + deleted_at: str | Unset = UNSET + endpoint_id: str | Unset = UNSET + host_name: str | Unset = UNSET + last_seen_at: str | Unset = UNSET + project_id: str | Unset = UNSET + status: DatastoreDeviceStatus | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at + + deleted_at = self.deleted_at + + endpoint_id = self.endpoint_id + + host_name = self.host_name + + last_seen_at = self.last_seen_at + + project_id = self.project_id + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + uid = self.uid + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if created_at is not UNSET: + field_dict["created_at"] = created_at + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if endpoint_id is not UNSET: + field_dict["endpoint_id"] = endpoint_id + if host_name is not UNSET: + field_dict["host_name"] = host_name + if last_seen_at is not UNSET: + field_dict["last_seen_at"] = last_seen_at + if project_id is not UNSET: + field_dict["project_id"] = project_id + if status is not UNSET: + field_dict["status"] = status + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + created_at = d.pop("created_at", UNSET) + + deleted_at = d.pop("deleted_at", UNSET) + + endpoint_id = d.pop("endpoint_id", UNSET) + + host_name = d.pop("host_name", UNSET) + + last_seen_at = d.pop("last_seen_at", UNSET) + + project_id = d.pop("project_id", UNSET) + + _status = d.pop("status", UNSET) + status: DatastoreDeviceStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = DatastoreDeviceStatus(_status) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + datastore_device = cls( + created_at=created_at, + deleted_at=deleted_at, + endpoint_id=endpoint_id, + host_name=host_name, + last_seen_at=last_seen_at, + project_id=project_id, + status=status, + uid=uid, + updated_at=updated_at, + ) + + datastore_device.additional_properties = d + return datastore_device + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_device_status.py b/src/convoy/models/datastore_device_status.py new file mode 100644 index 0000000..151d932 --- /dev/null +++ b/src/convoy/models/datastore_device_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class DatastoreDeviceStatus(str, Enum): + DEVICE_STATUS_DISABLED = "disabled" + DEVICE_STATUS_OFFLINE = "offline" + DEVICE_STATUS_ONLINE = "online" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_encoding_type.py b/src/convoy/models/datastore_encoding_type.py new file mode 100644 index 0000000..ef2e23f --- /dev/null +++ b/src/convoy/models/datastore_encoding_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class DatastoreEncodingType(str, Enum): + BASE_64_ENCODING = "base64" + HEX_ENCODING = "hex" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_endpoint.py b/src/convoy/models/datastore_endpoint.py new file mode 100644 index 0000000..f1fd00c --- /dev/null +++ b/src/convoy/models/datastore_endpoint.py @@ -0,0 +1,349 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_endpoint_status import DatastoreEndpointStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_endpoint_authentication import ( + DatastoreEndpointAuthentication, + ) + from ..models.datastore_mtls_client_cert import DatastoreMtlsClientCert + from ..models.datastore_secret import DatastoreSecret + + +T = TypeVar("T", bound="DatastoreEndpoint") + + +@_attrs_define +class DatastoreEndpoint: + """ + Attributes: + advanced_signatures (bool | Unset): + authentication (DatastoreEndpointAuthentication | Unset): + cb_state (str | Unset): CBState is the circuit breaker state ("open", "half-open", "closed") so the UI + can reflect a tripped breaker on the endpoint status. Nil when CB is + off/unlicensed or has no sample for this endpoint. + content_type (str | Unset): + created_at (str | Unset): + deleted_at (str | Unset): + description (str | Unset): + events (int | Unset): + failure_count (int | Unset): + failure_rate (float | Unset): FailureRate is the circuit breaker's rolling failure rate for this endpoint. + It is a pointer so the API can return null when no rate was computed (circuit + breaker feature off, or sampler not running), distinct from a genuine 0%. + http_timeout (int | Unset): + mtls_client_cert (DatastoreMtlsClientCert | Unset): + name (str | Unset): + owner_id (str | Unset): + period_failure_rate (float | Unset): PeriodFailureRate is the period failure rate from event_deliveries, + (Failure+Retry)/(Success+Failure+Retry). Retry counts as failed-so-far. + Nil when the range has no counted deliveries; sibling counts are transient. + project_id (str | Unset): + rate_limit (int | Unset): + rate_limit_duration (int | Unset): + retry_count (int | Unset): + secrets (list[DatastoreSecret] | Unset): + slack_webhook_url (str | Unset): + status (DatastoreEndpointStatus | Unset): + success_count (int | Unset): + support_email (str | Unset): + uid (str | Unset): + updated_at (str | Unset): + url (str | Unset): + """ + + advanced_signatures: bool | Unset = UNSET + authentication: DatastoreEndpointAuthentication | Unset = UNSET + cb_state: str | Unset = UNSET + content_type: str | Unset = UNSET + created_at: str | Unset = UNSET + deleted_at: str | Unset = UNSET + description: str | Unset = UNSET + events: int | Unset = UNSET + failure_count: int | Unset = UNSET + failure_rate: float | Unset = UNSET + http_timeout: int | Unset = UNSET + mtls_client_cert: DatastoreMtlsClientCert | Unset = UNSET + name: str | Unset = UNSET + owner_id: str | Unset = UNSET + period_failure_rate: float | Unset = UNSET + project_id: str | Unset = UNSET + rate_limit: int | Unset = UNSET + rate_limit_duration: int | Unset = UNSET + retry_count: int | Unset = UNSET + secrets: list[DatastoreSecret] | Unset = UNSET + slack_webhook_url: str | Unset = UNSET + status: DatastoreEndpointStatus | Unset = UNSET + success_count: int | Unset = UNSET + support_email: str | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + advanced_signatures = self.advanced_signatures + + authentication: dict[str, Any] | Unset = UNSET + if not isinstance(self.authentication, Unset): + authentication = self.authentication.to_dict() + + cb_state = self.cb_state + + content_type = self.content_type + + created_at = self.created_at + + deleted_at = self.deleted_at + + description = self.description + + events = self.events + + failure_count = self.failure_count + + failure_rate = self.failure_rate + + http_timeout = self.http_timeout + + mtls_client_cert: dict[str, Any] | Unset = UNSET + if not isinstance(self.mtls_client_cert, Unset): + mtls_client_cert = self.mtls_client_cert.to_dict() + + name = self.name + + owner_id = self.owner_id + + period_failure_rate = self.period_failure_rate + + project_id = self.project_id + + rate_limit = self.rate_limit + + rate_limit_duration = self.rate_limit_duration + + retry_count = self.retry_count + + secrets: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.secrets, Unset): + secrets = [] + for secrets_item_data in self.secrets: + secrets_item = secrets_item_data.to_dict() + secrets.append(secrets_item) + + slack_webhook_url = self.slack_webhook_url + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + success_count = self.success_count + + support_email = self.support_email + + uid = self.uid + + updated_at = self.updated_at + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if advanced_signatures is not UNSET: + field_dict["advanced_signatures"] = advanced_signatures + if authentication is not UNSET: + field_dict["authentication"] = authentication + if cb_state is not UNSET: + field_dict["cb_state"] = cb_state + if content_type is not UNSET: + field_dict["content_type"] = content_type + if created_at is not UNSET: + field_dict["created_at"] = created_at + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if description is not UNSET: + field_dict["description"] = description + if events is not UNSET: + field_dict["events"] = events + if failure_count is not UNSET: + field_dict["failure_count"] = failure_count + if failure_rate is not UNSET: + field_dict["failure_rate"] = failure_rate + if http_timeout is not UNSET: + field_dict["http_timeout"] = http_timeout + if mtls_client_cert is not UNSET: + field_dict["mtls_client_cert"] = mtls_client_cert + if name is not UNSET: + field_dict["name"] = name + if owner_id is not UNSET: + field_dict["owner_id"] = owner_id + if period_failure_rate is not UNSET: + field_dict["period_failure_rate"] = period_failure_rate + if project_id is not UNSET: + field_dict["project_id"] = project_id + if rate_limit is not UNSET: + field_dict["rate_limit"] = rate_limit + if rate_limit_duration is not UNSET: + field_dict["rate_limit_duration"] = rate_limit_duration + if retry_count is not UNSET: + field_dict["retry_count"] = retry_count + if secrets is not UNSET: + field_dict["secrets"] = secrets + if slack_webhook_url is not UNSET: + field_dict["slack_webhook_url"] = slack_webhook_url + if status is not UNSET: + field_dict["status"] = status + if success_count is not UNSET: + field_dict["success_count"] = success_count + if support_email is not UNSET: + field_dict["support_email"] = support_email + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_endpoint_authentication import ( + DatastoreEndpointAuthentication, + ) + from ..models.datastore_mtls_client_cert import DatastoreMtlsClientCert + from ..models.datastore_secret import DatastoreSecret + + d = dict(src_dict) + advanced_signatures = d.pop("advanced_signatures", UNSET) + + _authentication = d.pop("authentication", UNSET) + authentication: DatastoreEndpointAuthentication | Unset + if isinstance(_authentication, Unset): + authentication = UNSET + else: + authentication = DatastoreEndpointAuthentication.from_dict(_authentication) + + cb_state = d.pop("cb_state", UNSET) + + content_type = d.pop("content_type", UNSET) + + created_at = d.pop("created_at", UNSET) + + deleted_at = d.pop("deleted_at", UNSET) + + description = d.pop("description", UNSET) + + events = d.pop("events", UNSET) + + failure_count = d.pop("failure_count", UNSET) + + failure_rate = d.pop("failure_rate", UNSET) + + http_timeout = d.pop("http_timeout", UNSET) + + _mtls_client_cert = d.pop("mtls_client_cert", UNSET) + mtls_client_cert: DatastoreMtlsClientCert | Unset + if isinstance(_mtls_client_cert, Unset): + mtls_client_cert = UNSET + else: + mtls_client_cert = DatastoreMtlsClientCert.from_dict(_mtls_client_cert) + + name = d.pop("name", UNSET) + + owner_id = d.pop("owner_id", UNSET) + + period_failure_rate = d.pop("period_failure_rate", UNSET) + + project_id = d.pop("project_id", UNSET) + + rate_limit = d.pop("rate_limit", UNSET) + + rate_limit_duration = d.pop("rate_limit_duration", UNSET) + + retry_count = d.pop("retry_count", UNSET) + + _secrets = d.pop("secrets", UNSET) + secrets: list[DatastoreSecret] | Unset = UNSET + if _secrets is not UNSET: + secrets = [] + for secrets_item_data in _secrets: + secrets_item = DatastoreSecret.from_dict(secrets_item_data) + + secrets.append(secrets_item) + + slack_webhook_url = d.pop("slack_webhook_url", UNSET) + + _status = d.pop("status", UNSET) + status: DatastoreEndpointStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = DatastoreEndpointStatus(_status) + + success_count = d.pop("success_count", UNSET) + + support_email = d.pop("support_email", UNSET) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + url = d.pop("url", UNSET) + + datastore_endpoint = cls( + advanced_signatures=advanced_signatures, + authentication=authentication, + cb_state=cb_state, + content_type=content_type, + created_at=created_at, + deleted_at=deleted_at, + description=description, + events=events, + failure_count=failure_count, + failure_rate=failure_rate, + http_timeout=http_timeout, + mtls_client_cert=mtls_client_cert, + name=name, + owner_id=owner_id, + period_failure_rate=period_failure_rate, + project_id=project_id, + rate_limit=rate_limit, + rate_limit_duration=rate_limit_duration, + retry_count=retry_count, + secrets=secrets, + slack_webhook_url=slack_webhook_url, + status=status, + success_count=success_count, + support_email=support_email, + uid=uid, + updated_at=updated_at, + url=url, + ) + + datastore_endpoint.additional_properties = d + return datastore_endpoint + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_endpoint_authentication.py b/src/convoy/models/datastore_endpoint_authentication.py new file mode 100644 index 0000000..cf0bb16 --- /dev/null +++ b/src/convoy/models/datastore_endpoint_authentication.py @@ -0,0 +1,129 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_endpoint_authentication_type import ( + DatastoreEndpointAuthenticationType, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_api_key import DatastoreApiKey + from ..models.datastore_basic_auth import DatastoreBasicAuth + from ..models.datastore_o_auth_2 import DatastoreOAuth2 + + +T = TypeVar("T", bound="DatastoreEndpointAuthentication") + + +@_attrs_define +class DatastoreEndpointAuthentication: + """ + Attributes: + api_key (DatastoreApiKey | Unset): + basic_auth (DatastoreBasicAuth | Unset): + oauth2 (DatastoreOAuth2 | Unset): + type_ (DatastoreEndpointAuthenticationType | Unset): + """ + + api_key: DatastoreApiKey | Unset = UNSET + basic_auth: DatastoreBasicAuth | Unset = UNSET + oauth2: DatastoreOAuth2 | Unset = UNSET + type_: DatastoreEndpointAuthenticationType | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + api_key: dict[str, Any] | Unset = UNSET + if not isinstance(self.api_key, Unset): + api_key = self.api_key.to_dict() + + basic_auth: dict[str, Any] | Unset = UNSET + if not isinstance(self.basic_auth, Unset): + basic_auth = self.basic_auth.to_dict() + + oauth2: dict[str, Any] | Unset = UNSET + if not isinstance(self.oauth2, Unset): + oauth2 = self.oauth2.to_dict() + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if api_key is not UNSET: + field_dict["api_key"] = api_key + if basic_auth is not UNSET: + field_dict["basic_auth"] = basic_auth + if oauth2 is not UNSET: + field_dict["oauth2"] = oauth2 + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_api_key import DatastoreApiKey + from ..models.datastore_basic_auth import DatastoreBasicAuth + from ..models.datastore_o_auth_2 import DatastoreOAuth2 + + d = dict(src_dict) + _api_key = d.pop("api_key", UNSET) + api_key: DatastoreApiKey | Unset + if isinstance(_api_key, Unset): + api_key = UNSET + else: + api_key = DatastoreApiKey.from_dict(_api_key) + + _basic_auth = d.pop("basic_auth", UNSET) + basic_auth: DatastoreBasicAuth | Unset + if isinstance(_basic_auth, Unset): + basic_auth = UNSET + else: + basic_auth = DatastoreBasicAuth.from_dict(_basic_auth) + + _oauth2 = d.pop("oauth2", UNSET) + oauth2: DatastoreOAuth2 | Unset + if isinstance(_oauth2, Unset): + oauth2 = UNSET + else: + oauth2 = DatastoreOAuth2.from_dict(_oauth2) + + _type_ = d.pop("type", UNSET) + type_: DatastoreEndpointAuthenticationType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastoreEndpointAuthenticationType(_type_) + + datastore_endpoint_authentication = cls( + api_key=api_key, + basic_auth=basic_auth, + oauth2=oauth2, + type_=type_, + ) + + datastore_endpoint_authentication.additional_properties = d + return datastore_endpoint_authentication + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_endpoint_authentication_type.py b/src/convoy/models/datastore_endpoint_authentication_type.py new file mode 100644 index 0000000..8935ae8 --- /dev/null +++ b/src/convoy/models/datastore_endpoint_authentication_type.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class DatastoreEndpointAuthenticationType(str, Enum): + API_KEY_AUTHENTICATION = "api_key" + BASIC_AUTHENTICATION = "basic_auth" + O_AUTH_2_AUTHENTICATION = "oauth2" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_endpoint_status.py b/src/convoy/models/datastore_endpoint_status.py new file mode 100644 index 0000000..e55f12d --- /dev/null +++ b/src/convoy/models/datastore_endpoint_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class DatastoreEndpointStatus(str, Enum): + ACTIVE_ENDPOINT_STATUS = "active" + INACTIVE_ENDPOINT_STATUS = "inactive" + PAUSED_ENDPOINT_STATUS = "paused" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_event.py b/src/convoy/models/datastore_event.py new file mode 100644 index 0000000..9c999dc --- /dev/null +++ b/src/convoy/models/datastore_event.py @@ -0,0 +1,292 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_event_status import DatastoreEventStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_endpoint import DatastoreEndpoint + from ..models.datastore_source import DatastoreSource + from ..models.httpheader_http_header import HttpheaderHTTPHeader + + +T = TypeVar("T", bound="DatastoreEvent") + + +@_attrs_define +class DatastoreEvent: + """ + Attributes: + acknowledged_at (str | Unset): + app_id (str | Unset): Deprecated + created_at (str | Unset): + data (list[int] | Unset): Data is an arbitrary JSON value that gets sent as the body of the + webhook to the endpoints + deleted_at (str | Unset): + endpoint_metadata (list[DatastoreEndpoint] | Unset): + endpoints (list[str] | Unset): + event_type (str | Unset): + headers (HttpheaderHTTPHeader | Unset): + idempotency_key (str | Unset): + is_duplicate_event (bool | Unset): + metadata (str | Unset): + project_id (str | Unset): + raw (str | Unset): + source_id (str | Unset): + source_metadata (DatastoreSource | Unset): + status (DatastoreEventStatus | Unset): + uid (str | Unset): + updated_at (str | Unset): + url_path (str | Unset): + url_query_params (str | Unset): + """ + + acknowledged_at: str | Unset = UNSET + app_id: str | Unset = UNSET + created_at: str | Unset = UNSET + data: list[int] | Unset = UNSET + deleted_at: str | Unset = UNSET + endpoint_metadata: list[DatastoreEndpoint] | Unset = UNSET + endpoints: list[str] | Unset = UNSET + event_type: str | Unset = UNSET + headers: HttpheaderHTTPHeader | Unset = UNSET + idempotency_key: str | Unset = UNSET + is_duplicate_event: bool | Unset = UNSET + metadata: str | Unset = UNSET + project_id: str | Unset = UNSET + raw: str | Unset = UNSET + source_id: str | Unset = UNSET + source_metadata: DatastoreSource | Unset = UNSET + status: DatastoreEventStatus | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + url_path: str | Unset = UNSET + url_query_params: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + acknowledged_at = self.acknowledged_at + + app_id = self.app_id + + created_at = self.created_at + + data: list[int] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data + + deleted_at = self.deleted_at + + endpoint_metadata: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.endpoint_metadata, Unset): + endpoint_metadata = [] + for endpoint_metadata_item_data in self.endpoint_metadata: + endpoint_metadata_item = endpoint_metadata_item_data.to_dict() + endpoint_metadata.append(endpoint_metadata_item) + + endpoints: list[str] | Unset = UNSET + if not isinstance(self.endpoints, Unset): + endpoints = self.endpoints + + event_type = self.event_type + + headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.headers, Unset): + headers = self.headers.to_dict() + + idempotency_key = self.idempotency_key + + is_duplicate_event = self.is_duplicate_event + + metadata = self.metadata + + project_id = self.project_id + + raw = self.raw + + source_id = self.source_id + + source_metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.source_metadata, Unset): + source_metadata = self.source_metadata.to_dict() + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + uid = self.uid + + updated_at = self.updated_at + + url_path = self.url_path + + url_query_params = self.url_query_params + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if acknowledged_at is not UNSET: + field_dict["acknowledged_at"] = acknowledged_at + if app_id is not UNSET: + field_dict["app_id"] = app_id + if created_at is not UNSET: + field_dict["created_at"] = created_at + if data is not UNSET: + field_dict["data"] = data + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if endpoint_metadata is not UNSET: + field_dict["endpoint_metadata"] = endpoint_metadata + if endpoints is not UNSET: + field_dict["endpoints"] = endpoints + if event_type is not UNSET: + field_dict["event_type"] = event_type + if headers is not UNSET: + field_dict["headers"] = headers + if idempotency_key is not UNSET: + field_dict["idempotency_key"] = idempotency_key + if is_duplicate_event is not UNSET: + field_dict["is_duplicate_event"] = is_duplicate_event + if metadata is not UNSET: + field_dict["metadata"] = metadata + if project_id is not UNSET: + field_dict["project_id"] = project_id + if raw is not UNSET: + field_dict["raw"] = raw + if source_id is not UNSET: + field_dict["source_id"] = source_id + if source_metadata is not UNSET: + field_dict["source_metadata"] = source_metadata + if status is not UNSET: + field_dict["status"] = status + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if url_path is not UNSET: + field_dict["url_path"] = url_path + if url_query_params is not UNSET: + field_dict["url_query_params"] = url_query_params + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_endpoint import DatastoreEndpoint + from ..models.datastore_source import DatastoreSource + from ..models.httpheader_http_header import HttpheaderHTTPHeader + + d = dict(src_dict) + acknowledged_at = d.pop("acknowledged_at", UNSET) + + app_id = d.pop("app_id", UNSET) + + created_at = d.pop("created_at", UNSET) + + data = cast(list[int], d.pop("data", UNSET)) + + deleted_at = d.pop("deleted_at", UNSET) + + _endpoint_metadata = d.pop("endpoint_metadata", UNSET) + endpoint_metadata: list[DatastoreEndpoint] | Unset = UNSET + if _endpoint_metadata is not UNSET: + endpoint_metadata = [] + for endpoint_metadata_item_data in _endpoint_metadata: + endpoint_metadata_item = DatastoreEndpoint.from_dict( + endpoint_metadata_item_data + ) + + endpoint_metadata.append(endpoint_metadata_item) + + endpoints = cast(list[str], d.pop("endpoints", UNSET)) + + event_type = d.pop("event_type", UNSET) + + _headers = d.pop("headers", UNSET) + headers: HttpheaderHTTPHeader | Unset + if isinstance(_headers, Unset): + headers = UNSET + else: + headers = HttpheaderHTTPHeader.from_dict(_headers) + + idempotency_key = d.pop("idempotency_key", UNSET) + + is_duplicate_event = d.pop("is_duplicate_event", UNSET) + + metadata = d.pop("metadata", UNSET) + + project_id = d.pop("project_id", UNSET) + + raw = d.pop("raw", UNSET) + + source_id = d.pop("source_id", UNSET) + + _source_metadata = d.pop("source_metadata", UNSET) + source_metadata: DatastoreSource | Unset + if isinstance(_source_metadata, Unset): + source_metadata = UNSET + else: + source_metadata = DatastoreSource.from_dict(_source_metadata) + + _status = d.pop("status", UNSET) + status: DatastoreEventStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = DatastoreEventStatus(_status) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + url_path = d.pop("url_path", UNSET) + + url_query_params = d.pop("url_query_params", UNSET) + + datastore_event = cls( + acknowledged_at=acknowledged_at, + app_id=app_id, + created_at=created_at, + data=data, + deleted_at=deleted_at, + endpoint_metadata=endpoint_metadata, + endpoints=endpoints, + event_type=event_type, + headers=headers, + idempotency_key=idempotency_key, + is_duplicate_event=is_duplicate_event, + metadata=metadata, + project_id=project_id, + raw=raw, + source_id=source_id, + source_metadata=source_metadata, + status=status, + uid=uid, + updated_at=updated_at, + url_path=url_path, + url_query_params=url_query_params, + ) + + datastore_event.additional_properties = d + return datastore_event + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_event_delivery_status.py b/src/convoy/models/datastore_event_delivery_status.py new file mode 100644 index 0000000..8bb3dc4 --- /dev/null +++ b/src/convoy/models/datastore_event_delivery_status.py @@ -0,0 +1,13 @@ +from enum import Enum + + +class DatastoreEventDeliveryStatus(str, Enum): + DISCARDED_EVENT_STATUS = "Discarded" + FAILURE_EVENT_STATUS = "Failure" + PROCESSING_EVENT_STATUS = "Processing" + RETRY_EVENT_STATUS = "Retry" + SCHEDULED_EVENT_STATUS = "Scheduled" + SUCCESS_EVENT_STATUS = "Success" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_event_status.py b/src/convoy/models/datastore_event_status.py new file mode 100644 index 0000000..145585c --- /dev/null +++ b/src/convoy/models/datastore_event_status.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class DatastoreEventStatus(str, Enum): + FAILURE_STATUS = "Failure" + PENDING_STATUS = "Pending" + PROCESSING_STATUS = "Processing" + RETRY_STATUS = "Retry" + SUCCESS_STATUS = "Success" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_filter_configuration.py b/src/convoy/models/datastore_filter_configuration.py new file mode 100644 index 0000000..5daeccd --- /dev/null +++ b/src/convoy/models/datastore_filter_configuration.py @@ -0,0 +1,85 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_filter_schema import DatastoreFilterSchema + + +T = TypeVar("T", bound="DatastoreFilterConfiguration") + + +@_attrs_define +class DatastoreFilterConfiguration: + """ + Attributes: + event_types (list[str] | Unset): + filter_ (DatastoreFilterSchema | Unset): + """ + + event_types: list[str] | Unset = UNSET + filter_: DatastoreFilterSchema | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event_types: list[str] | Unset = UNSET + if not isinstance(self.event_types, Unset): + event_types = self.event_types + + filter_: dict[str, Any] | Unset = UNSET + if not isinstance(self.filter_, Unset): + filter_ = self.filter_.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if event_types is not UNSET: + field_dict["event_types"] = event_types + if filter_ is not UNSET: + field_dict["filter"] = filter_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_filter_schema import DatastoreFilterSchema + + d = dict(src_dict) + event_types = cast(list[str], d.pop("event_types", UNSET)) + + _filter_ = d.pop("filter", UNSET) + filter_: DatastoreFilterSchema | Unset + if isinstance(_filter_, Unset): + filter_ = UNSET + else: + filter_ = DatastoreFilterSchema.from_dict(_filter_) + + datastore_filter_configuration = cls( + event_types=event_types, + filter_=filter_, + ) + + datastore_filter_configuration.additional_properties = d + return datastore_filter_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_filter_schema.py b/src/convoy/models/datastore_filter_schema.py new file mode 100644 index 0000000..b4558ac --- /dev/null +++ b/src/convoy/models/datastore_filter_schema.py @@ -0,0 +1,131 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_m import DatastoreM + + +T = TypeVar("T", bound="DatastoreFilterSchema") + + +@_attrs_define +class DatastoreFilterSchema: + """ + Attributes: + body (DatastoreM | Unset): + headers (DatastoreM | Unset): + is_flattened (bool | Unset): + path (DatastoreM | Unset): + query (DatastoreM | Unset): + """ + + body: DatastoreM | Unset = UNSET + headers: DatastoreM | Unset = UNSET + is_flattened: bool | Unset = UNSET + path: DatastoreM | Unset = UNSET + query: DatastoreM | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + body: dict[str, Any] | Unset = UNSET + if not isinstance(self.body, Unset): + body = self.body.to_dict() + + headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.headers, Unset): + headers = self.headers.to_dict() + + is_flattened = self.is_flattened + + path: dict[str, Any] | Unset = UNSET + if not isinstance(self.path, Unset): + path = self.path.to_dict() + + query: dict[str, Any] | Unset = UNSET + if not isinstance(self.query, Unset): + query = self.query.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if body is not UNSET: + field_dict["body"] = body + if headers is not UNSET: + field_dict["headers"] = headers + if is_flattened is not UNSET: + field_dict["is_flattened"] = is_flattened + if path is not UNSET: + field_dict["path"] = path + if query is not UNSET: + field_dict["query"] = query + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_m import DatastoreM + + d = dict(src_dict) + _body = d.pop("body", UNSET) + body: DatastoreM | Unset + if isinstance(_body, Unset): + body = UNSET + else: + body = DatastoreM.from_dict(_body) + + _headers = d.pop("headers", UNSET) + headers: DatastoreM | Unset + if isinstance(_headers, Unset): + headers = UNSET + else: + headers = DatastoreM.from_dict(_headers) + + is_flattened = d.pop("is_flattened", UNSET) + + _path = d.pop("path", UNSET) + path: DatastoreM | Unset + if isinstance(_path, Unset): + path = UNSET + else: + path = DatastoreM.from_dict(_path) + + _query = d.pop("query", UNSET) + query: DatastoreM | Unset + if isinstance(_query, Unset): + query = UNSET + else: + query = DatastoreM.from_dict(_query) + + datastore_filter_schema = cls( + body=body, + headers=headers, + is_flattened=is_flattened, + path=path, + query=query, + ) + + datastore_filter_schema.additional_properties = d + return datastore_filter_schema + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_google_pub_sub_config.py b/src/convoy/models/datastore_google_pub_sub_config.py new file mode 100644 index 0000000..395f241 --- /dev/null +++ b/src/convoy/models/datastore_google_pub_sub_config.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreGooglePubSubConfig") + + +@_attrs_define +class DatastoreGooglePubSubConfig: + """ + Attributes: + project_id (str | Unset): + service_account (list[int] | Unset): + subscription_id (str | Unset): + """ + + project_id: str | Unset = UNSET + service_account: list[int] | Unset = UNSET + subscription_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + project_id = self.project_id + + service_account: list[int] | Unset = UNSET + if not isinstance(self.service_account, Unset): + service_account = self.service_account + + subscription_id = self.subscription_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if project_id is not UNSET: + field_dict["project_id"] = project_id + if service_account is not UNSET: + field_dict["service_account"] = service_account + if subscription_id is not UNSET: + field_dict["subscription_id"] = subscription_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_id = d.pop("project_id", UNSET) + + service_account = cast(list[int], d.pop("service_account", UNSET)) + + subscription_id = d.pop("subscription_id", UNSET) + + datastore_google_pub_sub_config = cls( + project_id=project_id, + service_account=service_account, + subscription_id=subscription_id, + ) + + datastore_google_pub_sub_config.additional_properties = d + return datastore_google_pub_sub_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_h_mac.py b/src/convoy/models/datastore_h_mac.py new file mode 100644 index 0000000..0108e71 --- /dev/null +++ b/src/convoy/models/datastore_h_mac.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_encoding_type import DatastoreEncodingType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreHMac") + + +@_attrs_define +class DatastoreHMac: + """ + Attributes: + encoding (DatastoreEncodingType | Unset): + hash_ (str | Unset): + header (str | Unset): + secret (str | Unset): + """ + + encoding: DatastoreEncodingType | Unset = UNSET + hash_: str | Unset = UNSET + header: str | Unset = UNSET + secret: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + encoding: str | Unset = UNSET + if not isinstance(self.encoding, Unset): + encoding = self.encoding.value + + hash_ = self.hash_ + + header = self.header + + secret = self.secret + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if encoding is not UNSET: + field_dict["encoding"] = encoding + if hash_ is not UNSET: + field_dict["hash"] = hash_ + if header is not UNSET: + field_dict["header"] = header + if secret is not UNSET: + field_dict["secret"] = secret + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _encoding = d.pop("encoding", UNSET) + encoding: DatastoreEncodingType | Unset + if isinstance(_encoding, Unset): + encoding = UNSET + else: + encoding = DatastoreEncodingType(_encoding) + + hash_ = d.pop("hash", UNSET) + + header = d.pop("header", UNSET) + + secret = d.pop("secret", UNSET) + + datastore_h_mac = cls( + encoding=encoding, + hash_=hash_, + header=header, + secret=secret, + ) + + datastore_h_mac.additional_properties = d + return datastore_h_mac + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_http_header.py b/src/convoy/models/datastore_http_header.py new file mode 100644 index 0000000..3de7128 --- /dev/null +++ b/src/convoy/models/datastore_http_header.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="DatastoreHttpHeader") + + +@_attrs_define +class DatastoreHttpHeader: + """ """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + datastore_http_header = cls() + + datastore_http_header.additional_properties = d + return datastore_http_header + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_kafka_auth.py b/src/convoy/models/datastore_kafka_auth.py new file mode 100644 index 0000000..a771f14 --- /dev/null +++ b/src/convoy/models/datastore_kafka_auth.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreKafkaAuth") + + +@_attrs_define +class DatastoreKafkaAuth: + """ + Attributes: + hash_ (str | Unset): + password (str | Unset): + tls (bool | Unset): + type_ (str | Unset): + username (str | Unset): + """ + + hash_: str | Unset = UNSET + password: str | Unset = UNSET + tls: bool | Unset = UNSET + type_: str | Unset = UNSET + username: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + hash_ = self.hash_ + + password = self.password + + tls = self.tls + + type_ = self.type_ + + username = self.username + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if hash_ is not UNSET: + field_dict["hash"] = hash_ + if password is not UNSET: + field_dict["password"] = password + if tls is not UNSET: + field_dict["tls"] = tls + if type_ is not UNSET: + field_dict["type"] = type_ + if username is not UNSET: + field_dict["username"] = username + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + hash_ = d.pop("hash", UNSET) + + password = d.pop("password", UNSET) + + tls = d.pop("tls", UNSET) + + type_ = d.pop("type", UNSET) + + username = d.pop("username", UNSET) + + datastore_kafka_auth = cls( + hash_=hash_, + password=password, + tls=tls, + type_=type_, + username=username, + ) + + datastore_kafka_auth.additional_properties = d + return datastore_kafka_auth + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_kafka_pub_sub_config.py b/src/convoy/models/datastore_kafka_pub_sub_config.py new file mode 100644 index 0000000..0170814 --- /dev/null +++ b/src/convoy/models/datastore_kafka_pub_sub_config.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_kafka_auth import DatastoreKafkaAuth + + +T = TypeVar("T", bound="DatastoreKafkaPubSubConfig") + + +@_attrs_define +class DatastoreKafkaPubSubConfig: + """ + Attributes: + auth (DatastoreKafkaAuth | Unset): + brokers (list[str] | Unset): + consumer_group_id (str | Unset): + topic_name (str | Unset): + """ + + auth: DatastoreKafkaAuth | Unset = UNSET + brokers: list[str] | Unset = UNSET + consumer_group_id: str | Unset = UNSET + topic_name: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + auth: dict[str, Any] | Unset = UNSET + if not isinstance(self.auth, Unset): + auth = self.auth.to_dict() + + brokers: list[str] | Unset = UNSET + if not isinstance(self.brokers, Unset): + brokers = self.brokers + + consumer_group_id = self.consumer_group_id + + topic_name = self.topic_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if auth is not UNSET: + field_dict["auth"] = auth + if brokers is not UNSET: + field_dict["brokers"] = brokers + if consumer_group_id is not UNSET: + field_dict["consumer_group_id"] = consumer_group_id + if topic_name is not UNSET: + field_dict["topic_name"] = topic_name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_kafka_auth import DatastoreKafkaAuth + + d = dict(src_dict) + _auth = d.pop("auth", UNSET) + auth: DatastoreKafkaAuth | Unset + if isinstance(_auth, Unset): + auth = UNSET + else: + auth = DatastoreKafkaAuth.from_dict(_auth) + + brokers = cast(list[str], d.pop("brokers", UNSET)) + + consumer_group_id = d.pop("consumer_group_id", UNSET) + + topic_name = d.pop("topic_name", UNSET) + + datastore_kafka_pub_sub_config = cls( + auth=auth, + brokers=brokers, + consumer_group_id=consumer_group_id, + topic_name=topic_name, + ) + + datastore_kafka_pub_sub_config.additional_properties = d + return datastore_kafka_pub_sub_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_m.py b/src/convoy/models/datastore_m.py new file mode 100644 index 0000000..8c47d7d --- /dev/null +++ b/src/convoy/models/datastore_m.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="DatastoreM") + + +@_attrs_define +class DatastoreM: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + datastore_m = cls() + + datastore_m.additional_properties = d + return datastore_m + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_meta_event_attempt.py b/src/convoy/models/datastore_meta_event_attempt.py new file mode 100644 index 0000000..cd1be37 --- /dev/null +++ b/src/convoy/models/datastore_meta_event_attempt.py @@ -0,0 +1,99 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_http_header import DatastoreHttpHeader + + +T = TypeVar("T", bound="DatastoreMetaEventAttempt") + + +@_attrs_define +class DatastoreMetaEventAttempt: + """ + Attributes: + request_http_header (DatastoreHttpHeader | Unset): + response_data (str | Unset): + response_http_header (DatastoreHttpHeader | Unset): + """ + + request_http_header: DatastoreHttpHeader | Unset = UNSET + response_data: str | Unset = UNSET + response_http_header: DatastoreHttpHeader | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + request_http_header: dict[str, Any] | Unset = UNSET + if not isinstance(self.request_http_header, Unset): + request_http_header = self.request_http_header.to_dict() + + response_data = self.response_data + + response_http_header: dict[str, Any] | Unset = UNSET + if not isinstance(self.response_http_header, Unset): + response_http_header = self.response_http_header.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if request_http_header is not UNSET: + field_dict["request_http_header"] = request_http_header + if response_data is not UNSET: + field_dict["response_data"] = response_data + if response_http_header is not UNSET: + field_dict["response_http_header"] = response_http_header + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_http_header import DatastoreHttpHeader + + d = dict(src_dict) + _request_http_header = d.pop("request_http_header", UNSET) + request_http_header: DatastoreHttpHeader | Unset + if isinstance(_request_http_header, Unset): + request_http_header = UNSET + else: + request_http_header = DatastoreHttpHeader.from_dict(_request_http_header) + + response_data = d.pop("response_data", UNSET) + + _response_http_header = d.pop("response_http_header", UNSET) + response_http_header: DatastoreHttpHeader | Unset + if isinstance(_response_http_header, Unset): + response_http_header = UNSET + else: + response_http_header = DatastoreHttpHeader.from_dict(_response_http_header) + + datastore_meta_event_attempt = cls( + request_http_header=request_http_header, + response_data=response_data, + response_http_header=response_http_header, + ) + + datastore_meta_event_attempt.additional_properties = d + return datastore_meta_event_attempt + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_meta_event_configuration.py b/src/convoy/models/datastore_meta_event_configuration.py new file mode 100644 index 0000000..7ad80a3 --- /dev/null +++ b/src/convoy/models/datastore_meta_event_configuration.py @@ -0,0 +1,129 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_meta_event_type import DatastoreMetaEventType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_pub_sub_config import DatastorePubSubConfig + + +T = TypeVar("T", bound="DatastoreMetaEventConfiguration") + + +@_attrs_define +class DatastoreMetaEventConfiguration: + """ + Attributes: + event_type (list[str] | Unset): + is_enabled (bool | Unset): + pub_sub (DatastorePubSubConfig | Unset): + secret (str | Unset): + type_ (DatastoreMetaEventType | Unset): + url (str | Unset): + """ + + event_type: list[str] | Unset = UNSET + is_enabled: bool | Unset = UNSET + pub_sub: DatastorePubSubConfig | Unset = UNSET + secret: str | Unset = UNSET + type_: DatastoreMetaEventType | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event_type: list[str] | Unset = UNSET + if not isinstance(self.event_type, Unset): + event_type = self.event_type + + is_enabled = self.is_enabled + + pub_sub: dict[str, Any] | Unset = UNSET + if not isinstance(self.pub_sub, Unset): + pub_sub = self.pub_sub.to_dict() + + secret = self.secret + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if event_type is not UNSET: + field_dict["event_type"] = event_type + if is_enabled is not UNSET: + field_dict["is_enabled"] = is_enabled + if pub_sub is not UNSET: + field_dict["pub_sub"] = pub_sub + if secret is not UNSET: + field_dict["secret"] = secret + if type_ is not UNSET: + field_dict["type"] = type_ + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_pub_sub_config import DatastorePubSubConfig + + d = dict(src_dict) + event_type = cast(list[str], d.pop("event_type", UNSET)) + + is_enabled = d.pop("is_enabled", UNSET) + + _pub_sub = d.pop("pub_sub", UNSET) + pub_sub: DatastorePubSubConfig | Unset + if isinstance(_pub_sub, Unset): + pub_sub = UNSET + else: + pub_sub = DatastorePubSubConfig.from_dict(_pub_sub) + + secret = d.pop("secret", UNSET) + + _type_ = d.pop("type", UNSET) + type_: DatastoreMetaEventType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastoreMetaEventType(_type_) + + url = d.pop("url", UNSET) + + datastore_meta_event_configuration = cls( + event_type=event_type, + is_enabled=is_enabled, + pub_sub=pub_sub, + secret=secret, + type_=type_, + url=url, + ) + + datastore_meta_event_configuration.additional_properties = d + return datastore_meta_event_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_meta_event_type.py b/src/convoy/models/datastore_meta_event_type.py new file mode 100644 index 0000000..3bf2191 --- /dev/null +++ b/src/convoy/models/datastore_meta_event_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class DatastoreMetaEventType(str, Enum): + HTTP_META_EVENT = "http" + PUB_SUB_META_EVENT = "pub_sub" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_metadata.py b/src/convoy/models/datastore_metadata.py new file mode 100644 index 0000000..89536c2 --- /dev/null +++ b/src/convoy/models/datastore_metadata.py @@ -0,0 +1,135 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_strategy_provider import DatastoreStrategyProvider +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreMetadata") + + +@_attrs_define +class DatastoreMetadata: + """ + Attributes: + data (list[int] | Unset): Data to be sent to endpoint. + interval_seconds (int | Unset): + max_retry_seconds (int | Unset): + next_send_time (str | Unset): + num_trials (int | Unset): NumTrials: number of times we have tried to deliver this Event to + an application + raw (str | Unset): + retry_limit (int | Unset): + strategy (DatastoreStrategyProvider | Unset): + """ + + data: list[int] | Unset = UNSET + interval_seconds: int | Unset = UNSET + max_retry_seconds: int | Unset = UNSET + next_send_time: str | Unset = UNSET + num_trials: int | Unset = UNSET + raw: str | Unset = UNSET + retry_limit: int | Unset = UNSET + strategy: DatastoreStrategyProvider | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data: list[int] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data + + interval_seconds = self.interval_seconds + + max_retry_seconds = self.max_retry_seconds + + next_send_time = self.next_send_time + + num_trials = self.num_trials + + raw = self.raw + + retry_limit = self.retry_limit + + strategy: str | Unset = UNSET + if not isinstance(self.strategy, Unset): + strategy = self.strategy.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if data is not UNSET: + field_dict["data"] = data + if interval_seconds is not UNSET: + field_dict["interval_seconds"] = interval_seconds + if max_retry_seconds is not UNSET: + field_dict["max_retry_seconds"] = max_retry_seconds + if next_send_time is not UNSET: + field_dict["next_send_time"] = next_send_time + if num_trials is not UNSET: + field_dict["num_trials"] = num_trials + if raw is not UNSET: + field_dict["raw"] = raw + if retry_limit is not UNSET: + field_dict["retry_limit"] = retry_limit + if strategy is not UNSET: + field_dict["strategy"] = strategy + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + data = cast(list[int], d.pop("data", UNSET)) + + interval_seconds = d.pop("interval_seconds", UNSET) + + max_retry_seconds = d.pop("max_retry_seconds", UNSET) + + next_send_time = d.pop("next_send_time", UNSET) + + num_trials = d.pop("num_trials", UNSET) + + raw = d.pop("raw", UNSET) + + retry_limit = d.pop("retry_limit", UNSET) + + _strategy = d.pop("strategy", UNSET) + strategy: DatastoreStrategyProvider | Unset + if isinstance(_strategy, Unset): + strategy = UNSET + else: + strategy = DatastoreStrategyProvider(_strategy) + + datastore_metadata = cls( + data=data, + interval_seconds=interval_seconds, + max_retry_seconds=max_retry_seconds, + next_send_time=next_send_time, + num_trials=num_trials, + raw=raw, + retry_limit=retry_limit, + strategy=strategy, + ) + + datastore_metadata.additional_properties = d + return datastore_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_mtls_client_cert.py b/src/convoy/models/datastore_mtls_client_cert.py new file mode 100644 index 0000000..57f114f --- /dev/null +++ b/src/convoy/models/datastore_mtls_client_cert.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreMtlsClientCert") + + +@_attrs_define +class DatastoreMtlsClientCert: + """ + Attributes: + client_cert (str | Unset): ClientCert is the client certificate PEM string + client_key (str | Unset): ClientKey is the client private key PEM string + """ + + client_cert: str | Unset = UNSET + client_key: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + client_cert = self.client_cert + + client_key = self.client_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if client_cert is not UNSET: + field_dict["client_cert"] = client_cert + if client_key is not UNSET: + field_dict["client_key"] = client_key + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + client_cert = d.pop("client_cert", UNSET) + + client_key = d.pop("client_key", UNSET) + + datastore_mtls_client_cert = cls( + client_cert=client_cert, + client_key=client_key, + ) + + datastore_mtls_client_cert.additional_properties = d + return datastore_mtls_client_cert + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_o_auth_2.py b/src/convoy/models/datastore_o_auth_2.py new file mode 100644 index 0000000..7b94346 --- /dev/null +++ b/src/convoy/models/datastore_o_auth_2.py @@ -0,0 +1,213 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_o_auth_2_authentication_type import ( + DatastoreOAuth2AuthenticationType, +) +from ..models.datastore_o_auth_2_expiry_time_unit import DatastoreOAuth2ExpiryTimeUnit +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_o_auth_2_field_mapping import DatastoreOAuth2FieldMapping + from ..models.datastore_o_auth_2_signing_key import DatastoreOAuth2SigningKey + + +T = TypeVar("T", bound="DatastoreOAuth2") + + +@_attrs_define +class DatastoreOAuth2: + """ + Attributes: + audience (str | Unset): + authentication_type (DatastoreOAuth2AuthenticationType | Unset): + client_id (str | Unset): + client_secret (str | Unset): Encrypted at rest + expiry_time_unit (DatastoreOAuth2ExpiryTimeUnit | Unset): + field_mapping (DatastoreOAuth2FieldMapping | Unset): + grant_type (str | Unset): + issuer (str | Unset): + scope (str | Unset): + signing_algorithm (str | Unset): + signing_key (DatastoreOAuth2SigningKey | Unset): + subject (str | Unset): + url (str | Unset): + """ + + audience: str | Unset = UNSET + authentication_type: DatastoreOAuth2AuthenticationType | Unset = UNSET + client_id: str | Unset = UNSET + client_secret: str | Unset = UNSET + expiry_time_unit: DatastoreOAuth2ExpiryTimeUnit | Unset = UNSET + field_mapping: DatastoreOAuth2FieldMapping | Unset = UNSET + grant_type: str | Unset = UNSET + issuer: str | Unset = UNSET + scope: str | Unset = UNSET + signing_algorithm: str | Unset = UNSET + signing_key: DatastoreOAuth2SigningKey | Unset = UNSET + subject: str | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + audience = self.audience + + authentication_type: str | Unset = UNSET + if not isinstance(self.authentication_type, Unset): + authentication_type = self.authentication_type.value + + client_id = self.client_id + + client_secret = self.client_secret + + expiry_time_unit: str | Unset = UNSET + if not isinstance(self.expiry_time_unit, Unset): + expiry_time_unit = self.expiry_time_unit.value + + field_mapping: dict[str, Any] | Unset = UNSET + if not isinstance(self.field_mapping, Unset): + field_mapping = self.field_mapping.to_dict() + + grant_type = self.grant_type + + issuer = self.issuer + + scope = self.scope + + signing_algorithm = self.signing_algorithm + + signing_key: dict[str, Any] | Unset = UNSET + if not isinstance(self.signing_key, Unset): + signing_key = self.signing_key.to_dict() + + subject = self.subject + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if audience is not UNSET: + field_dict["audience"] = audience + if authentication_type is not UNSET: + field_dict["authentication_type"] = authentication_type + if client_id is not UNSET: + field_dict["client_id"] = client_id + if client_secret is not UNSET: + field_dict["client_secret"] = client_secret + if expiry_time_unit is not UNSET: + field_dict["expiry_time_unit"] = expiry_time_unit + if field_mapping is not UNSET: + field_dict["field_mapping"] = field_mapping + if grant_type is not UNSET: + field_dict["grant_type"] = grant_type + if issuer is not UNSET: + field_dict["issuer"] = issuer + if scope is not UNSET: + field_dict["scope"] = scope + if signing_algorithm is not UNSET: + field_dict["signing_algorithm"] = signing_algorithm + if signing_key is not UNSET: + field_dict["signing_key"] = signing_key + if subject is not UNSET: + field_dict["subject"] = subject + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_o_auth_2_field_mapping import ( + DatastoreOAuth2FieldMapping, + ) + from ..models.datastore_o_auth_2_signing_key import DatastoreOAuth2SigningKey + + d = dict(src_dict) + audience = d.pop("audience", UNSET) + + _authentication_type = d.pop("authentication_type", UNSET) + authentication_type: DatastoreOAuth2AuthenticationType | Unset + if isinstance(_authentication_type, Unset): + authentication_type = UNSET + else: + authentication_type = DatastoreOAuth2AuthenticationType( + _authentication_type + ) + + client_id = d.pop("client_id", UNSET) + + client_secret = d.pop("client_secret", UNSET) + + _expiry_time_unit = d.pop("expiry_time_unit", UNSET) + expiry_time_unit: DatastoreOAuth2ExpiryTimeUnit | Unset + if isinstance(_expiry_time_unit, Unset): + expiry_time_unit = UNSET + else: + expiry_time_unit = DatastoreOAuth2ExpiryTimeUnit(_expiry_time_unit) + + _field_mapping = d.pop("field_mapping", UNSET) + field_mapping: DatastoreOAuth2FieldMapping | Unset + if isinstance(_field_mapping, Unset): + field_mapping = UNSET + else: + field_mapping = DatastoreOAuth2FieldMapping.from_dict(_field_mapping) + + grant_type = d.pop("grant_type", UNSET) + + issuer = d.pop("issuer", UNSET) + + scope = d.pop("scope", UNSET) + + signing_algorithm = d.pop("signing_algorithm", UNSET) + + _signing_key = d.pop("signing_key", UNSET) + signing_key: DatastoreOAuth2SigningKey | Unset + if isinstance(_signing_key, Unset): + signing_key = UNSET + else: + signing_key = DatastoreOAuth2SigningKey.from_dict(_signing_key) + + subject = d.pop("subject", UNSET) + + url = d.pop("url", UNSET) + + datastore_o_auth_2 = cls( + audience=audience, + authentication_type=authentication_type, + client_id=client_id, + client_secret=client_secret, + expiry_time_unit=expiry_time_unit, + field_mapping=field_mapping, + grant_type=grant_type, + issuer=issuer, + scope=scope, + signing_algorithm=signing_algorithm, + signing_key=signing_key, + subject=subject, + url=url, + ) + + datastore_o_auth_2.additional_properties = d + return datastore_o_auth_2 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_o_auth_2_authentication_type.py b/src/convoy/models/datastore_o_auth_2_authentication_type.py new file mode 100644 index 0000000..9f9db02 --- /dev/null +++ b/src/convoy/models/datastore_o_auth_2_authentication_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class DatastoreOAuth2AuthenticationType(str, Enum): + CLIENT_ASSERTION_AUTH = "client_assertion" + SHARED_SECRET_AUTH = "shared_secret" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_o_auth_2_expiry_time_unit.py b/src/convoy/models/datastore_o_auth_2_expiry_time_unit.py new file mode 100644 index 0000000..a82354a --- /dev/null +++ b/src/convoy/models/datastore_o_auth_2_expiry_time_unit.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class DatastoreOAuth2ExpiryTimeUnit(str, Enum): + EXPIRY_TIME_UNIT_HOURS = "hours" + EXPIRY_TIME_UNIT_MILLISECONDS = "milliseconds" + EXPIRY_TIME_UNIT_MINUTES = "minutes" + EXPIRY_TIME_UNIT_SECONDS = "seconds" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_o_auth_2_field_mapping.py b/src/convoy/models/datastore_o_auth_2_field_mapping.py new file mode 100644 index 0000000..8f01993 --- /dev/null +++ b/src/convoy/models/datastore_o_auth_2_field_mapping.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreOAuth2FieldMapping") + + +@_attrs_define +class DatastoreOAuth2FieldMapping: + """ + Attributes: + access_token (str | Unset): Field name for access token (e.g., "accessToken", "access_token", "token") + expires_in (str | Unset): Field name for expiry time (e.g., "expiresIn", "expires_in", "expiresAt") + token_type (str | Unset): Field name for token type (e.g., "tokenType", "token_type") + """ + + access_token: str | Unset = UNSET + expires_in: str | Unset = UNSET + token_type: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + access_token = self.access_token + + expires_in = self.expires_in + + token_type = self.token_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if access_token is not UNSET: + field_dict["access_token"] = access_token + if expires_in is not UNSET: + field_dict["expires_in"] = expires_in + if token_type is not UNSET: + field_dict["token_type"] = token_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + access_token = d.pop("access_token", UNSET) + + expires_in = d.pop("expires_in", UNSET) + + token_type = d.pop("token_type", UNSET) + + datastore_o_auth_2_field_mapping = cls( + access_token=access_token, + expires_in=expires_in, + token_type=token_type, + ) + + datastore_o_auth_2_field_mapping.additional_properties = d + return datastore_o_auth_2_field_mapping + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_o_auth_2_signing_key.py b/src/convoy/models/datastore_o_auth_2_signing_key.py new file mode 100644 index 0000000..f68a240 --- /dev/null +++ b/src/convoy/models/datastore_o_auth_2_signing_key.py @@ -0,0 +1,169 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreOAuth2SigningKey") + + +@_attrs_define +class DatastoreOAuth2SigningKey: + """ + Attributes: + crv (str | Unset): EC (Elliptic Curve) key fields + d (str | Unset): Private key (EC only) + dp (str | Unset): RSA first factor CRT exponent (RSA private key only) + dq (str | Unset): RSA second factor CRT exponent (RSA private key only) + e (str | Unset): RSA public exponent (RSA only) + kid (str | Unset): Key ID + kty (str | Unset): Key type: "EC" or "RSA" + n (str | Unset): RSA key fields + p (str | Unset): RSA first prime factor (RSA private key only) + q (str | Unset): RSA second prime factor (RSA private key only) + qi (str | Unset): RSA first CRT coefficient (RSA private key only) + x (str | Unset): X coordinate (EC only) + y (str | Unset): Y coordinate (EC only) + """ + + crv: str | Unset = UNSET + d: str | Unset = UNSET + dp: str | Unset = UNSET + dq: str | Unset = UNSET + e: str | Unset = UNSET + kid: str | Unset = UNSET + kty: str | Unset = UNSET + n: str | Unset = UNSET + p: str | Unset = UNSET + q: str | Unset = UNSET + qi: str | Unset = UNSET + x: str | Unset = UNSET + y: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + crv = self.crv + + d = self.d + + dp = self.dp + + dq = self.dq + + e = self.e + + kid = self.kid + + kty = self.kty + + n = self.n + + p = self.p + + q = self.q + + qi = self.qi + + x = self.x + + y = self.y + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if crv is not UNSET: + field_dict["crv"] = crv + if d is not UNSET: + field_dict["d"] = d + if dp is not UNSET: + field_dict["dp"] = dp + if dq is not UNSET: + field_dict["dq"] = dq + if e is not UNSET: + field_dict["e"] = e + if kid is not UNSET: + field_dict["kid"] = kid + if kty is not UNSET: + field_dict["kty"] = kty + if n is not UNSET: + field_dict["n"] = n + if p is not UNSET: + field_dict["p"] = p + if q is not UNSET: + field_dict["q"] = q + if qi is not UNSET: + field_dict["qi"] = qi + if x is not UNSET: + field_dict["x"] = x + if y is not UNSET: + field_dict["y"] = y + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + crv = d.pop("crv", UNSET) + + d = d.pop("d", UNSET) + + dp = d.pop("dp", UNSET) + + dq = d.pop("dq", UNSET) + + e = d.pop("e", UNSET) + + kid = d.pop("kid", UNSET) + + kty = d.pop("kty", UNSET) + + n = d.pop("n", UNSET) + + p = d.pop("p", UNSET) + + q = d.pop("q", UNSET) + + qi = d.pop("qi", UNSET) + + x = d.pop("x", UNSET) + + y = d.pop("y", UNSET) + + datastore_o_auth_2_signing_key = cls( + crv=crv, + d=d, + dp=dp, + dq=dq, + e=e, + kid=kid, + kty=kty, + n=n, + p=p, + q=q, + qi=qi, + x=x, + y=y, + ) + + datastore_o_auth_2_signing_key.additional_properties = d + return datastore_o_auth_2_signing_key + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_page_direction.py b/src/convoy/models/datastore_page_direction.py new file mode 100644 index 0000000..a979a43 --- /dev/null +++ b/src/convoy/models/datastore_page_direction.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class DatastorePageDirection(str, Enum): + NEXT = "next" + PREV = "prev" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_pagination_data.py b/src/convoy/models/datastore_pagination_data.py new file mode 100644 index 0000000..ac02a9c --- /dev/null +++ b/src/convoy/models/datastore_pagination_data.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastorePaginationData") + + +@_attrs_define +class DatastorePaginationData: + """ + Attributes: + has_next_page (bool | Unset): + has_prev_page (bool | Unset): + next_page_cursor (str | Unset): + per_page (int | Unset): + prev_page_cursor (str | Unset): + total (int | Unset): + """ + + has_next_page: bool | Unset = UNSET + has_prev_page: bool | Unset = UNSET + next_page_cursor: str | Unset = UNSET + per_page: int | Unset = UNSET + prev_page_cursor: str | Unset = UNSET + total: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + has_next_page = self.has_next_page + + has_prev_page = self.has_prev_page + + next_page_cursor = self.next_page_cursor + + per_page = self.per_page + + prev_page_cursor = self.prev_page_cursor + + total = self.total + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if has_next_page is not UNSET: + field_dict["has_next_page"] = has_next_page + if has_prev_page is not UNSET: + field_dict["has_prev_page"] = has_prev_page + if next_page_cursor is not UNSET: + field_dict["next_page_cursor"] = next_page_cursor + if per_page is not UNSET: + field_dict["per_page"] = per_page + if prev_page_cursor is not UNSET: + field_dict["prev_page_cursor"] = prev_page_cursor + if total is not UNSET: + field_dict["total"] = total + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + has_next_page = d.pop("has_next_page", UNSET) + + has_prev_page = d.pop("has_prev_page", UNSET) + + next_page_cursor = d.pop("next_page_cursor", UNSET) + + per_page = d.pop("per_page", UNSET) + + prev_page_cursor = d.pop("prev_page_cursor", UNSET) + + total = d.pop("total", UNSET) + + datastore_pagination_data = cls( + has_next_page=has_next_page, + has_prev_page=has_prev_page, + next_page_cursor=next_page_cursor, + per_page=per_page, + prev_page_cursor=prev_page_cursor, + total=total, + ) + + datastore_pagination_data.additional_properties = d + return datastore_pagination_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_portal_auth_type.py b/src/convoy/models/datastore_portal_auth_type.py new file mode 100644 index 0000000..b544738 --- /dev/null +++ b/src/convoy/models/datastore_portal_auth_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class DatastorePortalAuthType(str, Enum): + PORTAL_AUTH_TYPE_REFRESH_TOKEN = "refresh_token" + PORTAL_AUTH_TYPE_STATIC_TOKEN = "static_token" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_portal_link_response.py b/src/convoy/models/datastore_portal_link_response.py new file mode 100644 index 0000000..55cb000 --- /dev/null +++ b/src/convoy/models/datastore_portal_link_response.py @@ -0,0 +1,217 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_portal_auth_type import DatastorePortalAuthType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_endpoint import DatastoreEndpoint + + +T = TypeVar("T", bound="DatastorePortalLinkResponse") + + +@_attrs_define +class DatastorePortalLinkResponse: + """ + Attributes: + auth_key (str | Unset): + auth_type (DatastorePortalAuthType | Unset): + can_manage_endpoint (bool | Unset): + created_at (str | Unset): + deleted_at (str | Unset): + endpoint_count (int | Unset): + endpoints (list[str] | Unset): + endpoints_metadata (list[DatastoreEndpoint] | Unset): + name (str | Unset): + owner_id (str | Unset): + project_id (str | Unset): + token (str | Unset): + uid (str | Unset): + updated_at (str | Unset): + url (str | Unset): + """ + + auth_key: str | Unset = UNSET + auth_type: DatastorePortalAuthType | Unset = UNSET + can_manage_endpoint: bool | Unset = UNSET + created_at: str | Unset = UNSET + deleted_at: str | Unset = UNSET + endpoint_count: int | Unset = UNSET + endpoints: list[str] | Unset = UNSET + endpoints_metadata: list[DatastoreEndpoint] | Unset = UNSET + name: str | Unset = UNSET + owner_id: str | Unset = UNSET + project_id: str | Unset = UNSET + token: str | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + auth_key = self.auth_key + + auth_type: str | Unset = UNSET + if not isinstance(self.auth_type, Unset): + auth_type = self.auth_type.value + + can_manage_endpoint = self.can_manage_endpoint + + created_at = self.created_at + + deleted_at = self.deleted_at + + endpoint_count = self.endpoint_count + + endpoints: list[str] | Unset = UNSET + if not isinstance(self.endpoints, Unset): + endpoints = self.endpoints + + endpoints_metadata: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.endpoints_metadata, Unset): + endpoints_metadata = [] + for endpoints_metadata_item_data in self.endpoints_metadata: + endpoints_metadata_item = endpoints_metadata_item_data.to_dict() + endpoints_metadata.append(endpoints_metadata_item) + + name = self.name + + owner_id = self.owner_id + + project_id = self.project_id + + token = self.token + + uid = self.uid + + updated_at = self.updated_at + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if auth_key is not UNSET: + field_dict["auth_key"] = auth_key + if auth_type is not UNSET: + field_dict["auth_type"] = auth_type + if can_manage_endpoint is not UNSET: + field_dict["can_manage_endpoint"] = can_manage_endpoint + if created_at is not UNSET: + field_dict["created_at"] = created_at + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if endpoint_count is not UNSET: + field_dict["endpoint_count"] = endpoint_count + if endpoints is not UNSET: + field_dict["endpoints"] = endpoints + if endpoints_metadata is not UNSET: + field_dict["endpoints_metadata"] = endpoints_metadata + if name is not UNSET: + field_dict["name"] = name + if owner_id is not UNSET: + field_dict["owner_id"] = owner_id + if project_id is not UNSET: + field_dict["project_id"] = project_id + if token is not UNSET: + field_dict["token"] = token + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_endpoint import DatastoreEndpoint + + d = dict(src_dict) + auth_key = d.pop("auth_key", UNSET) + + _auth_type = d.pop("auth_type", UNSET) + auth_type: DatastorePortalAuthType | Unset + if isinstance(_auth_type, Unset): + auth_type = UNSET + else: + auth_type = DatastorePortalAuthType(_auth_type) + + can_manage_endpoint = d.pop("can_manage_endpoint", UNSET) + + created_at = d.pop("created_at", UNSET) + + deleted_at = d.pop("deleted_at", UNSET) + + endpoint_count = d.pop("endpoint_count", UNSET) + + endpoints = cast(list[str], d.pop("endpoints", UNSET)) + + _endpoints_metadata = d.pop("endpoints_metadata", UNSET) + endpoints_metadata: list[DatastoreEndpoint] | Unset = UNSET + if _endpoints_metadata is not UNSET: + endpoints_metadata = [] + for endpoints_metadata_item_data in _endpoints_metadata: + endpoints_metadata_item = DatastoreEndpoint.from_dict( + endpoints_metadata_item_data + ) + + endpoints_metadata.append(endpoints_metadata_item) + + name = d.pop("name", UNSET) + + owner_id = d.pop("owner_id", UNSET) + + project_id = d.pop("project_id", UNSET) + + token = d.pop("token", UNSET) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + url = d.pop("url", UNSET) + + datastore_portal_link_response = cls( + auth_key=auth_key, + auth_type=auth_type, + can_manage_endpoint=can_manage_endpoint, + created_at=created_at, + deleted_at=deleted_at, + endpoint_count=endpoint_count, + endpoints=endpoints, + endpoints_metadata=endpoints_metadata, + name=name, + owner_id=owner_id, + project_id=project_id, + token=token, + uid=uid, + updated_at=updated_at, + url=url, + ) + + datastore_portal_link_response.additional_properties = d + return datastore_portal_link_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_project_config.py b/src/convoy/models/datastore_project_config.py new file mode 100644 index 0000000..16e51bf --- /dev/null +++ b/src/convoy/models/datastore_project_config.py @@ -0,0 +1,263 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.config_request_id_header_provider import ConfigRequestIDHeaderProvider +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_circuit_breaker_configuration import ( + DatastoreCircuitBreakerConfiguration, + ) + from ..models.datastore_meta_event_configuration import ( + DatastoreMetaEventConfiguration, + ) + from ..models.datastore_rate_limit_configuration import ( + DatastoreRateLimitConfiguration, + ) + from ..models.datastore_signature_configuration import ( + DatastoreSignatureConfiguration, + ) + from ..models.datastore_ssl_configuration import DatastoreSSLConfiguration + from ..models.datastore_strategy_configuration import DatastoreStrategyConfiguration + + +T = TypeVar("T", bound="DatastoreProjectConfig") + + +@_attrs_define +class DatastoreProjectConfig: + """ + Attributes: + add_event_id_trace_headers (bool | Unset): + circuit_breaker (DatastoreCircuitBreakerConfiguration | Unset): + disable_endpoint (bool | Unset): + max_payload_read_size (int | Unset): + meta_event (DatastoreMetaEventConfiguration | Unset): + multiple_endpoint_subscriptions (bool | Unset): + ratelimit (DatastoreRateLimitConfiguration | Unset): + replay_attacks_prevention_enabled (bool | Unset): + request_id_header (ConfigRequestIDHeaderProvider | Unset): + search_policy (str | Unset): + signature (DatastoreSignatureConfiguration | Unset): + ssl (DatastoreSSLConfiguration | Unset): + strategy (DatastoreStrategyConfiguration | Unset): + """ + + add_event_id_trace_headers: bool | Unset = UNSET + circuit_breaker: DatastoreCircuitBreakerConfiguration | Unset = UNSET + disable_endpoint: bool | Unset = UNSET + max_payload_read_size: int | Unset = UNSET + meta_event: DatastoreMetaEventConfiguration | Unset = UNSET + multiple_endpoint_subscriptions: bool | Unset = UNSET + ratelimit: DatastoreRateLimitConfiguration | Unset = UNSET + replay_attacks_prevention_enabled: bool | Unset = UNSET + request_id_header: ConfigRequestIDHeaderProvider | Unset = UNSET + search_policy: str | Unset = UNSET + signature: DatastoreSignatureConfiguration | Unset = UNSET + ssl: DatastoreSSLConfiguration | Unset = UNSET + strategy: DatastoreStrategyConfiguration | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + add_event_id_trace_headers = self.add_event_id_trace_headers + + circuit_breaker: dict[str, Any] | Unset = UNSET + if not isinstance(self.circuit_breaker, Unset): + circuit_breaker = self.circuit_breaker.to_dict() + + disable_endpoint = self.disable_endpoint + + max_payload_read_size = self.max_payload_read_size + + meta_event: dict[str, Any] | Unset = UNSET + if not isinstance(self.meta_event, Unset): + meta_event = self.meta_event.to_dict() + + multiple_endpoint_subscriptions = self.multiple_endpoint_subscriptions + + ratelimit: dict[str, Any] | Unset = UNSET + if not isinstance(self.ratelimit, Unset): + ratelimit = self.ratelimit.to_dict() + + replay_attacks_prevention_enabled = self.replay_attacks_prevention_enabled + + request_id_header: str | Unset = UNSET + if not isinstance(self.request_id_header, Unset): + request_id_header = self.request_id_header.value + + search_policy = self.search_policy + + signature: dict[str, Any] | Unset = UNSET + if not isinstance(self.signature, Unset): + signature = self.signature.to_dict() + + ssl: dict[str, Any] | Unset = UNSET + if not isinstance(self.ssl, Unset): + ssl = self.ssl.to_dict() + + strategy: dict[str, Any] | Unset = UNSET + if not isinstance(self.strategy, Unset): + strategy = self.strategy.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if add_event_id_trace_headers is not UNSET: + field_dict["add_event_id_trace_headers"] = add_event_id_trace_headers + if circuit_breaker is not UNSET: + field_dict["circuit_breaker"] = circuit_breaker + if disable_endpoint is not UNSET: + field_dict["disable_endpoint"] = disable_endpoint + if max_payload_read_size is not UNSET: + field_dict["max_payload_read_size"] = max_payload_read_size + if meta_event is not UNSET: + field_dict["meta_event"] = meta_event + if multiple_endpoint_subscriptions is not UNSET: + field_dict["multiple_endpoint_subscriptions"] = ( + multiple_endpoint_subscriptions + ) + if ratelimit is not UNSET: + field_dict["ratelimit"] = ratelimit + if replay_attacks_prevention_enabled is not UNSET: + field_dict["replay_attacks_prevention_enabled"] = ( + replay_attacks_prevention_enabled + ) + if request_id_header is not UNSET: + field_dict["request_id_header"] = request_id_header + if search_policy is not UNSET: + field_dict["search_policy"] = search_policy + if signature is not UNSET: + field_dict["signature"] = signature + if ssl is not UNSET: + field_dict["ssl"] = ssl + if strategy is not UNSET: + field_dict["strategy"] = strategy + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_circuit_breaker_configuration import ( + DatastoreCircuitBreakerConfiguration, + ) + from ..models.datastore_meta_event_configuration import ( + DatastoreMetaEventConfiguration, + ) + from ..models.datastore_rate_limit_configuration import ( + DatastoreRateLimitConfiguration, + ) + from ..models.datastore_signature_configuration import ( + DatastoreSignatureConfiguration, + ) + from ..models.datastore_ssl_configuration import DatastoreSSLConfiguration + from ..models.datastore_strategy_configuration import ( + DatastoreStrategyConfiguration, + ) + + d = dict(src_dict) + add_event_id_trace_headers = d.pop("add_event_id_trace_headers", UNSET) + + _circuit_breaker = d.pop("circuit_breaker", UNSET) + circuit_breaker: DatastoreCircuitBreakerConfiguration | Unset + if isinstance(_circuit_breaker, Unset): + circuit_breaker = UNSET + else: + circuit_breaker = DatastoreCircuitBreakerConfiguration.from_dict( + _circuit_breaker + ) + + disable_endpoint = d.pop("disable_endpoint", UNSET) + + max_payload_read_size = d.pop("max_payload_read_size", UNSET) + + _meta_event = d.pop("meta_event", UNSET) + meta_event: DatastoreMetaEventConfiguration | Unset + if isinstance(_meta_event, Unset): + meta_event = UNSET + else: + meta_event = DatastoreMetaEventConfiguration.from_dict(_meta_event) + + multiple_endpoint_subscriptions = d.pop( + "multiple_endpoint_subscriptions", UNSET + ) + + _ratelimit = d.pop("ratelimit", UNSET) + ratelimit: DatastoreRateLimitConfiguration | Unset + if isinstance(_ratelimit, Unset): + ratelimit = UNSET + else: + ratelimit = DatastoreRateLimitConfiguration.from_dict(_ratelimit) + + replay_attacks_prevention_enabled = d.pop( + "replay_attacks_prevention_enabled", UNSET + ) + + _request_id_header = d.pop("request_id_header", UNSET) + request_id_header: ConfigRequestIDHeaderProvider | Unset + if isinstance(_request_id_header, Unset): + request_id_header = UNSET + else: + request_id_header = ConfigRequestIDHeaderProvider(_request_id_header) + + search_policy = d.pop("search_policy", UNSET) + + _signature = d.pop("signature", UNSET) + signature: DatastoreSignatureConfiguration | Unset + if isinstance(_signature, Unset): + signature = UNSET + else: + signature = DatastoreSignatureConfiguration.from_dict(_signature) + + _ssl = d.pop("ssl", UNSET) + ssl: DatastoreSSLConfiguration | Unset + if isinstance(_ssl, Unset): + ssl = UNSET + else: + ssl = DatastoreSSLConfiguration.from_dict(_ssl) + + _strategy = d.pop("strategy", UNSET) + strategy: DatastoreStrategyConfiguration | Unset + if isinstance(_strategy, Unset): + strategy = UNSET + else: + strategy = DatastoreStrategyConfiguration.from_dict(_strategy) + + datastore_project_config = cls( + add_event_id_trace_headers=add_event_id_trace_headers, + circuit_breaker=circuit_breaker, + disable_endpoint=disable_endpoint, + max_payload_read_size=max_payload_read_size, + meta_event=meta_event, + multiple_endpoint_subscriptions=multiple_endpoint_subscriptions, + ratelimit=ratelimit, + replay_attacks_prevention_enabled=replay_attacks_prevention_enabled, + request_id_header=request_id_header, + search_policy=search_policy, + signature=signature, + ssl=ssl, + strategy=strategy, + ) + + datastore_project_config.additional_properties = d + return datastore_project_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_project_statistics.py b/src/convoy/models/datastore_project_statistics.py new file mode 100644 index 0000000..c959102 --- /dev/null +++ b/src/convoy/models/datastore_project_statistics.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreProjectStatistics") + + +@_attrs_define +class DatastoreProjectStatistics: + """ + Attributes: + endpoints_exist (bool | Unset): + events_exist (bool | Unset): + sources_exist (bool | Unset): + subscriptions_exist (bool | Unset): + """ + + endpoints_exist: bool | Unset = UNSET + events_exist: bool | Unset = UNSET + sources_exist: bool | Unset = UNSET + subscriptions_exist: bool | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + endpoints_exist = self.endpoints_exist + + events_exist = self.events_exist + + sources_exist = self.sources_exist + + subscriptions_exist = self.subscriptions_exist + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if endpoints_exist is not UNSET: + field_dict["endpoints_exist"] = endpoints_exist + if events_exist is not UNSET: + field_dict["events_exist"] = events_exist + if sources_exist is not UNSET: + field_dict["sources_exist"] = sources_exist + if subscriptions_exist is not UNSET: + field_dict["subscriptions_exist"] = subscriptions_exist + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + endpoints_exist = d.pop("endpoints_exist", UNSET) + + events_exist = d.pop("events_exist", UNSET) + + sources_exist = d.pop("sources_exist", UNSET) + + subscriptions_exist = d.pop("subscriptions_exist", UNSET) + + datastore_project_statistics = cls( + endpoints_exist=endpoints_exist, + events_exist=events_exist, + sources_exist=sources_exist, + subscriptions_exist=subscriptions_exist, + ) + + datastore_project_statistics.additional_properties = d + return datastore_project_statistics + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_project_type.py b/src/convoy/models/datastore_project_type.py new file mode 100644 index 0000000..12e6a54 --- /dev/null +++ b/src/convoy/models/datastore_project_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class DatastoreProjectType(str, Enum): + INCOMING_PROJECT = "incoming" + OUTGOING_PROJECT = "outgoing" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_provider_config.py b/src/convoy/models/datastore_provider_config.py new file mode 100644 index 0000000..1c7c641 --- /dev/null +++ b/src/convoy/models/datastore_provider_config.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_twitter_provider_config import ( + DatastoreTwitterProviderConfig, + ) + + +T = TypeVar("T", bound="DatastoreProviderConfig") + + +@_attrs_define +class DatastoreProviderConfig: + """ + Attributes: + twitter (DatastoreTwitterProviderConfig | Unset): + """ + + twitter: DatastoreTwitterProviderConfig | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + twitter: dict[str, Any] | Unset = UNSET + if not isinstance(self.twitter, Unset): + twitter = self.twitter.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if twitter is not UNSET: + field_dict["twitter"] = twitter + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_twitter_provider_config import ( + DatastoreTwitterProviderConfig, + ) + + d = dict(src_dict) + _twitter = d.pop("twitter", UNSET) + twitter: DatastoreTwitterProviderConfig | Unset + if isinstance(_twitter, Unset): + twitter = UNSET + else: + twitter = DatastoreTwitterProviderConfig.from_dict(_twitter) + + datastore_provider_config = cls( + twitter=twitter, + ) + + datastore_provider_config.additional_properties = d + return datastore_provider_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_pub_sub_config.py b/src/convoy/models/datastore_pub_sub_config.py new file mode 100644 index 0000000..46d51ff --- /dev/null +++ b/src/convoy/models/datastore_pub_sub_config.py @@ -0,0 +1,154 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_pub_sub_type import DatastorePubSubType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_amqp_pub_sub_config import DatastoreAmqpPubSubConfig + from ..models.datastore_google_pub_sub_config import DatastoreGooglePubSubConfig + from ..models.datastore_kafka_pub_sub_config import DatastoreKafkaPubSubConfig + from ..models.datastore_sqs_pub_sub_config import DatastoreSQSPubSubConfig + + +T = TypeVar("T", bound="DatastorePubSubConfig") + + +@_attrs_define +class DatastorePubSubConfig: + """ + Attributes: + amqp (DatastoreAmqpPubSubConfig | Unset): + google (DatastoreGooglePubSubConfig | Unset): + kafka (DatastoreKafkaPubSubConfig | Unset): + sqs (DatastoreSQSPubSubConfig | Unset): + type_ (DatastorePubSubType | Unset): + workers (int | Unset): + """ + + amqp: DatastoreAmqpPubSubConfig | Unset = UNSET + google: DatastoreGooglePubSubConfig | Unset = UNSET + kafka: DatastoreKafkaPubSubConfig | Unset = UNSET + sqs: DatastoreSQSPubSubConfig | Unset = UNSET + type_: DatastorePubSubType | Unset = UNSET + workers: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + amqp: dict[str, Any] | Unset = UNSET + if not isinstance(self.amqp, Unset): + amqp = self.amqp.to_dict() + + google: dict[str, Any] | Unset = UNSET + if not isinstance(self.google, Unset): + google = self.google.to_dict() + + kafka: dict[str, Any] | Unset = UNSET + if not isinstance(self.kafka, Unset): + kafka = self.kafka.to_dict() + + sqs: dict[str, Any] | Unset = UNSET + if not isinstance(self.sqs, Unset): + sqs = self.sqs.to_dict() + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + workers = self.workers + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if amqp is not UNSET: + field_dict["amqp"] = amqp + if google is not UNSET: + field_dict["google"] = google + if kafka is not UNSET: + field_dict["kafka"] = kafka + if sqs is not UNSET: + field_dict["sqs"] = sqs + if type_ is not UNSET: + field_dict["type"] = type_ + if workers is not UNSET: + field_dict["workers"] = workers + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_amqp_pub_sub_config import DatastoreAmqpPubSubConfig + from ..models.datastore_google_pub_sub_config import DatastoreGooglePubSubConfig + from ..models.datastore_kafka_pub_sub_config import DatastoreKafkaPubSubConfig + from ..models.datastore_sqs_pub_sub_config import DatastoreSQSPubSubConfig + + d = dict(src_dict) + _amqp = d.pop("amqp", UNSET) + amqp: DatastoreAmqpPubSubConfig | Unset + if isinstance(_amqp, Unset): + amqp = UNSET + else: + amqp = DatastoreAmqpPubSubConfig.from_dict(_amqp) + + _google = d.pop("google", UNSET) + google: DatastoreGooglePubSubConfig | Unset + if isinstance(_google, Unset): + google = UNSET + else: + google = DatastoreGooglePubSubConfig.from_dict(_google) + + _kafka = d.pop("kafka", UNSET) + kafka: DatastoreKafkaPubSubConfig | Unset + if isinstance(_kafka, Unset): + kafka = UNSET + else: + kafka = DatastoreKafkaPubSubConfig.from_dict(_kafka) + + _sqs = d.pop("sqs", UNSET) + sqs: DatastoreSQSPubSubConfig | Unset + if isinstance(_sqs, Unset): + sqs = UNSET + else: + sqs = DatastoreSQSPubSubConfig.from_dict(_sqs) + + _type_ = d.pop("type", UNSET) + type_: DatastorePubSubType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastorePubSubType(_type_) + + workers = d.pop("workers", UNSET) + + datastore_pub_sub_config = cls( + amqp=amqp, + google=google, + kafka=kafka, + sqs=sqs, + type_=type_, + workers=workers, + ) + + datastore_pub_sub_config.additional_properties = d + return datastore_pub_sub_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_pub_sub_type.py b/src/convoy/models/datastore_pub_sub_type.py new file mode 100644 index 0000000..1d4be7a --- /dev/null +++ b/src/convoy/models/datastore_pub_sub_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class DatastorePubSubType(str, Enum): + AMQP_PUB_SUB = "amqp" + GOOGLE_PUB_SUB = "google" + KAFKA_PUB_SUB = "kafka" + SQS_PUB_SUB = "sqs" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_rate_limit_configuration.py b/src/convoy/models/datastore_rate_limit_configuration.py new file mode 100644 index 0000000..ddbd9db --- /dev/null +++ b/src/convoy/models/datastore_rate_limit_configuration.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreRateLimitConfiguration") + + +@_attrs_define +class DatastoreRateLimitConfiguration: + """ + Attributes: + count (int | Unset): + duration (int | Unset): + """ + + count: int | Unset = UNSET + duration: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + duration = self.duration + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if count is not UNSET: + field_dict["count"] = count + if duration is not UNSET: + field_dict["duration"] = duration + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + count = d.pop("count", UNSET) + + duration = d.pop("duration", UNSET) + + datastore_rate_limit_configuration = cls( + count=count, + duration=duration, + ) + + datastore_rate_limit_configuration.additional_properties = d + return datastore_rate_limit_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_retry_configuration.py b/src/convoy/models/datastore_retry_configuration.py new file mode 100644 index 0000000..ec03c56 --- /dev/null +++ b/src/convoy/models/datastore_retry_configuration.py @@ -0,0 +1,87 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_strategy_provider import DatastoreStrategyProvider +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreRetryConfiguration") + + +@_attrs_define +class DatastoreRetryConfiguration: + """ + Attributes: + duration (int | Unset): + retry_count (int | Unset): + type_ (DatastoreStrategyProvider | Unset): + """ + + duration: int | Unset = UNSET + retry_count: int | Unset = UNSET + type_: DatastoreStrategyProvider | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + duration = self.duration + + retry_count = self.retry_count + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if duration is not UNSET: + field_dict["duration"] = duration + if retry_count is not UNSET: + field_dict["retry_count"] = retry_count + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + duration = d.pop("duration", UNSET) + + retry_count = d.pop("retry_count", UNSET) + + _type_ = d.pop("type", UNSET) + type_: DatastoreStrategyProvider | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastoreStrategyProvider(_type_) + + datastore_retry_configuration = cls( + duration=duration, + retry_count=retry_count, + type_=type_, + ) + + datastore_retry_configuration.additional_properties = d + return datastore_retry_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_role.py b/src/convoy/models/datastore_role.py new file mode 100644 index 0000000..9fbce62 --- /dev/null +++ b/src/convoy/models/datastore_role.py @@ -0,0 +1,87 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.auth_role_type import AuthRoleType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreRole") + + +@_attrs_define +class DatastoreRole: + """ + Attributes: + app (str | Unset): + project (str | Unset): + type_ (AuthRoleType | Unset): + """ + + app: str | Unset = UNSET + project: str | Unset = UNSET + type_: AuthRoleType | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + app = self.app + + project = self.project + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if app is not UNSET: + field_dict["app"] = app + if project is not UNSET: + field_dict["project"] = project + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + app = d.pop("app", UNSET) + + project = d.pop("project", UNSET) + + _type_ = d.pop("type", UNSET) + type_: AuthRoleType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = AuthRoleType(_type_) + + datastore_role = cls( + app=app, + project=project, + type_=type_, + ) + + datastore_role.additional_properties = d + return datastore_role + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_secret.py b/src/convoy/models/datastore_secret.py new file mode 100644 index 0000000..38f5293 --- /dev/null +++ b/src/convoy/models/datastore_secret.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreSecret") + + +@_attrs_define +class DatastoreSecret: + """ + Attributes: + created_at (str | Unset): + deleted_at (str | Unset): + expires_at (str | Unset): + uid (str | Unset): + updated_at (str | Unset): + value (str | Unset): + """ + + created_at: str | Unset = UNSET + deleted_at: str | Unset = UNSET + expires_at: str | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + value: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at + + deleted_at = self.deleted_at + + expires_at = self.expires_at + + uid = self.uid + + updated_at = self.updated_at + + value = self.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if created_at is not UNSET: + field_dict["created_at"] = created_at + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if value is not UNSET: + field_dict["value"] = value + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + created_at = d.pop("created_at", UNSET) + + deleted_at = d.pop("deleted_at", UNSET) + + expires_at = d.pop("expires_at", UNSET) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + value = d.pop("value", UNSET) + + datastore_secret = cls( + created_at=created_at, + deleted_at=deleted_at, + expires_at=expires_at, + uid=uid, + updated_at=updated_at, + value=value, + ) + + datastore_secret.additional_properties = d + return datastore_secret + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_signature_configuration.py b/src/convoy/models/datastore_signature_configuration.py new file mode 100644 index 0000000..69bef50 --- /dev/null +++ b/src/convoy/models/datastore_signature_configuration.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.config_signature_header_provider import ConfigSignatureHeaderProvider +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_signature_version import DatastoreSignatureVersion + + +T = TypeVar("T", bound="DatastoreSignatureConfiguration") + + +@_attrs_define +class DatastoreSignatureConfiguration: + """ + Attributes: + header (ConfigSignatureHeaderProvider | Unset): + versions (list[DatastoreSignatureVersion] | Unset): + """ + + header: ConfigSignatureHeaderProvider | Unset = UNSET + versions: list[DatastoreSignatureVersion] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + header: str | Unset = UNSET + if not isinstance(self.header, Unset): + header = self.header.value + + versions: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.versions, Unset): + versions = [] + for versions_item_data in self.versions: + versions_item = versions_item_data.to_dict() + versions.append(versions_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if header is not UNSET: + field_dict["header"] = header + if versions is not UNSET: + field_dict["versions"] = versions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_signature_version import DatastoreSignatureVersion + + d = dict(src_dict) + _header = d.pop("header", UNSET) + header: ConfigSignatureHeaderProvider | Unset + if isinstance(_header, Unset): + header = UNSET + else: + header = ConfigSignatureHeaderProvider(_header) + + _versions = d.pop("versions", UNSET) + versions: list[DatastoreSignatureVersion] | Unset = UNSET + if _versions is not UNSET: + versions = [] + for versions_item_data in _versions: + versions_item = DatastoreSignatureVersion.from_dict(versions_item_data) + + versions.append(versions_item) + + datastore_signature_configuration = cls( + header=header, + versions=versions, + ) + + datastore_signature_configuration.additional_properties = d + return datastore_signature_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_signature_version.py b/src/convoy/models/datastore_signature_version.py new file mode 100644 index 0000000..bec6d7b --- /dev/null +++ b/src/convoy/models/datastore_signature_version.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_encoding_type import DatastoreEncodingType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreSignatureVersion") + + +@_attrs_define +class DatastoreSignatureVersion: + """ + Attributes: + created_at (str | Unset): + encoding (DatastoreEncodingType | Unset): + hash_ (str | Unset): + uid (str | Unset): + """ + + created_at: str | Unset = UNSET + encoding: DatastoreEncodingType | Unset = UNSET + hash_: str | Unset = UNSET + uid: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at + + encoding: str | Unset = UNSET + if not isinstance(self.encoding, Unset): + encoding = self.encoding.value + + hash_ = self.hash_ + + uid = self.uid + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if created_at is not UNSET: + field_dict["created_at"] = created_at + if encoding is not UNSET: + field_dict["encoding"] = encoding + if hash_ is not UNSET: + field_dict["hash"] = hash_ + if uid is not UNSET: + field_dict["uid"] = uid + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + created_at = d.pop("created_at", UNSET) + + _encoding = d.pop("encoding", UNSET) + encoding: DatastoreEncodingType | Unset + if isinstance(_encoding, Unset): + encoding = UNSET + else: + encoding = DatastoreEncodingType(_encoding) + + hash_ = d.pop("hash", UNSET) + + uid = d.pop("uid", UNSET) + + datastore_signature_version = cls( + created_at=created_at, + encoding=encoding, + hash_=hash_, + uid=uid, + ) + + datastore_signature_version.additional_properties = d + return datastore_signature_version + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_source.py b/src/convoy/models/datastore_source.py new file mode 100644 index 0000000..9bd1e39 --- /dev/null +++ b/src/convoy/models/datastore_source.py @@ -0,0 +1,292 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_source_provider import DatastoreSourceProvider +from ..models.datastore_source_type import DatastoreSourceType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_custom_response import DatastoreCustomResponse + from ..models.datastore_provider_config import DatastoreProviderConfig + from ..models.datastore_pub_sub_config import DatastorePubSubConfig + from ..models.datastore_verifier_config import DatastoreVerifierConfig + + +T = TypeVar("T", bound="DatastoreSource") + + +@_attrs_define +class DatastoreSource: + """ + Attributes: + body_function (str | Unset): + created_at (str | Unset): + custom_response (DatastoreCustomResponse | Unset): + deleted_at (str | Unset): + event_type_location (str | Unset): + forward_headers (list[str] | Unset): + header_function (str | Unset): + idempotency_keys (list[str] | Unset): + is_disabled (bool | Unset): + mask_id (str | Unset): + name (str | Unset): + project_id (str | Unset): + provider (DatastoreSourceProvider | Unset): + provider_config (DatastoreProviderConfig | Unset): + pub_sub (DatastorePubSubConfig | Unset): + type_ (DatastoreSourceType | Unset): + uid (str | Unset): + updated_at (str | Unset): + url (str | Unset): + verifier (DatastoreVerifierConfig | Unset): + """ + + body_function: str | Unset = UNSET + created_at: str | Unset = UNSET + custom_response: DatastoreCustomResponse | Unset = UNSET + deleted_at: str | Unset = UNSET + event_type_location: str | Unset = UNSET + forward_headers: list[str] | Unset = UNSET + header_function: str | Unset = UNSET + idempotency_keys: list[str] | Unset = UNSET + is_disabled: bool | Unset = UNSET + mask_id: str | Unset = UNSET + name: str | Unset = UNSET + project_id: str | Unset = UNSET + provider: DatastoreSourceProvider | Unset = UNSET + provider_config: DatastoreProviderConfig | Unset = UNSET + pub_sub: DatastorePubSubConfig | Unset = UNSET + type_: DatastoreSourceType | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + url: str | Unset = UNSET + verifier: DatastoreVerifierConfig | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + body_function = self.body_function + + created_at = self.created_at + + custom_response: dict[str, Any] | Unset = UNSET + if not isinstance(self.custom_response, Unset): + custom_response = self.custom_response.to_dict() + + deleted_at = self.deleted_at + + event_type_location = self.event_type_location + + forward_headers: list[str] | Unset = UNSET + if not isinstance(self.forward_headers, Unset): + forward_headers = self.forward_headers + + header_function = self.header_function + + idempotency_keys: list[str] | Unset = UNSET + if not isinstance(self.idempotency_keys, Unset): + idempotency_keys = self.idempotency_keys + + is_disabled = self.is_disabled + + mask_id = self.mask_id + + name = self.name + + project_id = self.project_id + + provider: str | Unset = UNSET + if not isinstance(self.provider, Unset): + provider = self.provider.value + + provider_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.provider_config, Unset): + provider_config = self.provider_config.to_dict() + + pub_sub: dict[str, Any] | Unset = UNSET + if not isinstance(self.pub_sub, Unset): + pub_sub = self.pub_sub.to_dict() + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + uid = self.uid + + updated_at = self.updated_at + + url = self.url + + verifier: dict[str, Any] | Unset = UNSET + if not isinstance(self.verifier, Unset): + verifier = self.verifier.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if body_function is not UNSET: + field_dict["body_function"] = body_function + if created_at is not UNSET: + field_dict["created_at"] = created_at + if custom_response is not UNSET: + field_dict["custom_response"] = custom_response + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if event_type_location is not UNSET: + field_dict["event_type_location"] = event_type_location + if forward_headers is not UNSET: + field_dict["forward_headers"] = forward_headers + if header_function is not UNSET: + field_dict["header_function"] = header_function + if idempotency_keys is not UNSET: + field_dict["idempotency_keys"] = idempotency_keys + if is_disabled is not UNSET: + field_dict["is_disabled"] = is_disabled + if mask_id is not UNSET: + field_dict["mask_id"] = mask_id + if name is not UNSET: + field_dict["name"] = name + if project_id is not UNSET: + field_dict["project_id"] = project_id + if provider is not UNSET: + field_dict["provider"] = provider + if provider_config is not UNSET: + field_dict["provider_config"] = provider_config + if pub_sub is not UNSET: + field_dict["pub_sub"] = pub_sub + if type_ is not UNSET: + field_dict["type"] = type_ + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if url is not UNSET: + field_dict["url"] = url + if verifier is not UNSET: + field_dict["verifier"] = verifier + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_custom_response import DatastoreCustomResponse + from ..models.datastore_provider_config import DatastoreProviderConfig + from ..models.datastore_pub_sub_config import DatastorePubSubConfig + from ..models.datastore_verifier_config import DatastoreVerifierConfig + + d = dict(src_dict) + body_function = d.pop("body_function", UNSET) + + created_at = d.pop("created_at", UNSET) + + _custom_response = d.pop("custom_response", UNSET) + custom_response: DatastoreCustomResponse | Unset + if isinstance(_custom_response, Unset): + custom_response = UNSET + else: + custom_response = DatastoreCustomResponse.from_dict(_custom_response) + + deleted_at = d.pop("deleted_at", UNSET) + + event_type_location = d.pop("event_type_location", UNSET) + + forward_headers = cast(list[str], d.pop("forward_headers", UNSET)) + + header_function = d.pop("header_function", UNSET) + + idempotency_keys = cast(list[str], d.pop("idempotency_keys", UNSET)) + + is_disabled = d.pop("is_disabled", UNSET) + + mask_id = d.pop("mask_id", UNSET) + + name = d.pop("name", UNSET) + + project_id = d.pop("project_id", UNSET) + + _provider = d.pop("provider", UNSET) + provider: DatastoreSourceProvider | Unset + if isinstance(_provider, Unset): + provider = UNSET + else: + provider = DatastoreSourceProvider(_provider) + + _provider_config = d.pop("provider_config", UNSET) + provider_config: DatastoreProviderConfig | Unset + if isinstance(_provider_config, Unset): + provider_config = UNSET + else: + provider_config = DatastoreProviderConfig.from_dict(_provider_config) + + _pub_sub = d.pop("pub_sub", UNSET) + pub_sub: DatastorePubSubConfig | Unset + if isinstance(_pub_sub, Unset): + pub_sub = UNSET + else: + pub_sub = DatastorePubSubConfig.from_dict(_pub_sub) + + _type_ = d.pop("type", UNSET) + type_: DatastoreSourceType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastoreSourceType(_type_) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + url = d.pop("url", UNSET) + + _verifier = d.pop("verifier", UNSET) + verifier: DatastoreVerifierConfig | Unset + if isinstance(_verifier, Unset): + verifier = UNSET + else: + verifier = DatastoreVerifierConfig.from_dict(_verifier) + + datastore_source = cls( + body_function=body_function, + created_at=created_at, + custom_response=custom_response, + deleted_at=deleted_at, + event_type_location=event_type_location, + forward_headers=forward_headers, + header_function=header_function, + idempotency_keys=idempotency_keys, + is_disabled=is_disabled, + mask_id=mask_id, + name=name, + project_id=project_id, + provider=provider, + provider_config=provider_config, + pub_sub=pub_sub, + type_=type_, + uid=uid, + updated_at=updated_at, + url=url, + verifier=verifier, + ) + + datastore_source.additional_properties = d + return datastore_source + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_source_provider.py b/src/convoy/models/datastore_source_provider.py new file mode 100644 index 0000000..2b8a33e --- /dev/null +++ b/src/convoy/models/datastore_source_provider.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class DatastoreSourceProvider(str, Enum): + GITHUB_SOURCE_PROVIDER = "github" + SHOPIFY_SOURCE_PROVIDER = "shopify" + TWITTER_SOURCE_PROVIDER = "twitter" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_source_type.py b/src/convoy/models/datastore_source_type.py new file mode 100644 index 0000000..389e4dd --- /dev/null +++ b/src/convoy/models/datastore_source_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class DatastoreSourceType(str, Enum): + DB_CHANGE_STREAM = "db_change_stream" + HTTP_SOURCE = "http" + PUB_SUB_SOURCE = "pub_sub" + REST_API_SOURCE = "rest_api" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_sqs_pub_sub_config.py b/src/convoy/models/datastore_sqs_pub_sub_config.py new file mode 100644 index 0000000..ed6f898 --- /dev/null +++ b/src/convoy/models/datastore_sqs_pub_sub_config.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreSQSPubSubConfig") + + +@_attrs_define +class DatastoreSQSPubSubConfig: + """ + Attributes: + access_key_id (str | Unset): + default_region (str | Unset): + endpoint (str | Unset): Optional: for LocalStack testing + queue_name (str | Unset): + secret_key (str | Unset): + """ + + access_key_id: str | Unset = UNSET + default_region: str | Unset = UNSET + endpoint: str | Unset = UNSET + queue_name: str | Unset = UNSET + secret_key: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + access_key_id = self.access_key_id + + default_region = self.default_region + + endpoint = self.endpoint + + queue_name = self.queue_name + + secret_key = self.secret_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if access_key_id is not UNSET: + field_dict["access_key_id"] = access_key_id + if default_region is not UNSET: + field_dict["default_region"] = default_region + if endpoint is not UNSET: + field_dict["endpoint"] = endpoint + if queue_name is not UNSET: + field_dict["queue_name"] = queue_name + if secret_key is not UNSET: + field_dict["secret_key"] = secret_key + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + access_key_id = d.pop("access_key_id", UNSET) + + default_region = d.pop("default_region", UNSET) + + endpoint = d.pop("endpoint", UNSET) + + queue_name = d.pop("queue_name", UNSET) + + secret_key = d.pop("secret_key", UNSET) + + datastore_sqs_pub_sub_config = cls( + access_key_id=access_key_id, + default_region=default_region, + endpoint=endpoint, + queue_name=queue_name, + secret_key=secret_key, + ) + + datastore_sqs_pub_sub_config.additional_properties = d + return datastore_sqs_pub_sub_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_ssl_configuration.py b/src/convoy/models/datastore_ssl_configuration.py new file mode 100644 index 0000000..407f764 --- /dev/null +++ b/src/convoy/models/datastore_ssl_configuration.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreSSLConfiguration") + + +@_attrs_define +class DatastoreSSLConfiguration: + """ + Attributes: + enforce_secure_endpoints (bool | Unset): + """ + + enforce_secure_endpoints: bool | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + enforce_secure_endpoints = self.enforce_secure_endpoints + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if enforce_secure_endpoints is not UNSET: + field_dict["enforce_secure_endpoints"] = enforce_secure_endpoints + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + enforce_secure_endpoints = d.pop("enforce_secure_endpoints", UNSET) + + datastore_ssl_configuration = cls( + enforce_secure_endpoints=enforce_secure_endpoints, + ) + + datastore_ssl_configuration.additional_properties = d + return datastore_ssl_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_strategy_configuration.py b/src/convoy/models/datastore_strategy_configuration.py new file mode 100644 index 0000000..1c8ccf6 --- /dev/null +++ b/src/convoy/models/datastore_strategy_configuration.py @@ -0,0 +1,87 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_strategy_provider import DatastoreStrategyProvider +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreStrategyConfiguration") + + +@_attrs_define +class DatastoreStrategyConfiguration: + """ + Attributes: + duration (int | Unset): + retry_count (int | Unset): + type_ (DatastoreStrategyProvider | Unset): + """ + + duration: int | Unset = UNSET + retry_count: int | Unset = UNSET + type_: DatastoreStrategyProvider | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + duration = self.duration + + retry_count = self.retry_count + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if duration is not UNSET: + field_dict["duration"] = duration + if retry_count is not UNSET: + field_dict["retry_count"] = retry_count + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + duration = d.pop("duration", UNSET) + + retry_count = d.pop("retry_count", UNSET) + + _type_ = d.pop("type", UNSET) + type_: DatastoreStrategyProvider | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastoreStrategyProvider(_type_) + + datastore_strategy_configuration = cls( + duration=duration, + retry_count=retry_count, + type_=type_, + ) + + datastore_strategy_configuration.additional_properties = d + return datastore_strategy_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_strategy_provider.py b/src/convoy/models/datastore_strategy_provider.py new file mode 100644 index 0000000..6a53e0a --- /dev/null +++ b/src/convoy/models/datastore_strategy_provider.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class DatastoreStrategyProvider(str, Enum): + EXPONENTIAL_STRATEGY_PROVIDER = "exponential" + LINEAR_STRATEGY_PROVIDER = "linear" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_subscription_type.py b/src/convoy/models/datastore_subscription_type.py new file mode 100644 index 0000000..c6c4063 --- /dev/null +++ b/src/convoy/models/datastore_subscription_type.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class DatastoreSubscriptionType(str, Enum): + SUBSCRIPTION_TYPE_API = "api" + SUBSCRIPTION_TYPE_CLI = "cli" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/datastore_twitter_provider_config.py b/src/convoy/models/datastore_twitter_provider_config.py new file mode 100644 index 0000000..931e1ca --- /dev/null +++ b/src/convoy/models/datastore_twitter_provider_config.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreTwitterProviderConfig") + + +@_attrs_define +class DatastoreTwitterProviderConfig: + """ + Attributes: + crc_verified_at (str | Unset): + """ + + crc_verified_at: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + crc_verified_at = self.crc_verified_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if crc_verified_at is not UNSET: + field_dict["crc_verified_at"] = crc_verified_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + crc_verified_at = d.pop("crc_verified_at", UNSET) + + datastore_twitter_provider_config = cls( + crc_verified_at=crc_verified_at, + ) + + datastore_twitter_provider_config.additional_properties = d + return datastore_twitter_provider_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_update_portal_link_request.py b/src/convoy/models/datastore_update_portal_link_request.py new file mode 100644 index 0000000..230b2aa --- /dev/null +++ b/src/convoy/models/datastore_update_portal_link_request.py @@ -0,0 +1,100 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DatastoreUpdatePortalLinkRequest") + + +@_attrs_define +class DatastoreUpdatePortalLinkRequest: + """ + Attributes: + auth_type (str | Unset): + can_manage_endpoint (bool | Unset): Specify whether endpoint management can be done through the Portal Link UI + endpoints (list[str] | Unset): Deprecated + IDs of endpoints in this portal link + name (str | Unset): Portal Link Name + owner_id (str | Unset): OwnerID, the portal link will inherit all the endpoints with this owner ID + """ + + auth_type: str | Unset = UNSET + can_manage_endpoint: bool | Unset = UNSET + endpoints: list[str] | Unset = UNSET + name: str | Unset = UNSET + owner_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + auth_type = self.auth_type + + can_manage_endpoint = self.can_manage_endpoint + + endpoints: list[str] | Unset = UNSET + if not isinstance(self.endpoints, Unset): + endpoints = self.endpoints + + name = self.name + + owner_id = self.owner_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if auth_type is not UNSET: + field_dict["auth_type"] = auth_type + if can_manage_endpoint is not UNSET: + field_dict["can_manage_endpoint"] = can_manage_endpoint + if endpoints is not UNSET: + field_dict["endpoints"] = endpoints + if name is not UNSET: + field_dict["name"] = name + if owner_id is not UNSET: + field_dict["owner_id"] = owner_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + auth_type = d.pop("auth_type", UNSET) + + can_manage_endpoint = d.pop("can_manage_endpoint", UNSET) + + endpoints = cast(list[str], d.pop("endpoints", UNSET)) + + name = d.pop("name", UNSET) + + owner_id = d.pop("owner_id", UNSET) + + datastore_update_portal_link_request = cls( + auth_type=auth_type, + can_manage_endpoint=can_manage_endpoint, + endpoints=endpoints, + name=name, + owner_id=owner_id, + ) + + datastore_update_portal_link_request.additional_properties = d + return datastore_update_portal_link_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_verifier_config.py b/src/convoy/models/datastore_verifier_config.py new file mode 100644 index 0000000..0060dd5 --- /dev/null +++ b/src/convoy/models/datastore_verifier_config.py @@ -0,0 +1,127 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_verifier_type import DatastoreVerifierType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_api_key import DatastoreApiKey + from ..models.datastore_basic_auth import DatastoreBasicAuth + from ..models.datastore_h_mac import DatastoreHMac + + +T = TypeVar("T", bound="DatastoreVerifierConfig") + + +@_attrs_define +class DatastoreVerifierConfig: + """ + Attributes: + api_key (DatastoreApiKey | Unset): + basic_auth (DatastoreBasicAuth | Unset): + hmac (DatastoreHMac | Unset): + type_ (DatastoreVerifierType | Unset): + """ + + api_key: DatastoreApiKey | Unset = UNSET + basic_auth: DatastoreBasicAuth | Unset = UNSET + hmac: DatastoreHMac | Unset = UNSET + type_: DatastoreVerifierType | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + api_key: dict[str, Any] | Unset = UNSET + if not isinstance(self.api_key, Unset): + api_key = self.api_key.to_dict() + + basic_auth: dict[str, Any] | Unset = UNSET + if not isinstance(self.basic_auth, Unset): + basic_auth = self.basic_auth.to_dict() + + hmac: dict[str, Any] | Unset = UNSET + if not isinstance(self.hmac, Unset): + hmac = self.hmac.to_dict() + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if api_key is not UNSET: + field_dict["api_key"] = api_key + if basic_auth is not UNSET: + field_dict["basic_auth"] = basic_auth + if hmac is not UNSET: + field_dict["hmac"] = hmac + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_api_key import DatastoreApiKey + from ..models.datastore_basic_auth import DatastoreBasicAuth + from ..models.datastore_h_mac import DatastoreHMac + + d = dict(src_dict) + _api_key = d.pop("api_key", UNSET) + api_key: DatastoreApiKey | Unset + if isinstance(_api_key, Unset): + api_key = UNSET + else: + api_key = DatastoreApiKey.from_dict(_api_key) + + _basic_auth = d.pop("basic_auth", UNSET) + basic_auth: DatastoreBasicAuth | Unset + if isinstance(_basic_auth, Unset): + basic_auth = UNSET + else: + basic_auth = DatastoreBasicAuth.from_dict(_basic_auth) + + _hmac = d.pop("hmac", UNSET) + hmac: DatastoreHMac | Unset + if isinstance(_hmac, Unset): + hmac = UNSET + else: + hmac = DatastoreHMac.from_dict(_hmac) + + _type_ = d.pop("type", UNSET) + type_: DatastoreVerifierType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastoreVerifierType(_type_) + + datastore_verifier_config = cls( + api_key=api_key, + basic_auth=basic_auth, + hmac=hmac, + type_=type_, + ) + + datastore_verifier_config.additional_properties = d + return datastore_verifier_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/datastore_verifier_type.py b/src/convoy/models/datastore_verifier_type.py new file mode 100644 index 0000000..7f89ee5 --- /dev/null +++ b/src/convoy/models/datastore_verifier_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class DatastoreVerifierType(str, Enum): + API_KEY_VERIFIER = "api_key" + BASIC_AUTH_VERIFIER = "basic_auth" + H_MAC_VERIFIER = "hmac" + NOOP_VERIFIER = "noop" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/delete_endpoint_response_200.py b/src/convoy/models/delete_endpoint_response_200.py new file mode 100644 index 0000000..cd67467 --- /dev/null +++ b/src/convoy/models/delete_endpoint_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteEndpointResponse200") + + +@_attrs_define +class DeleteEndpointResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_endpoint_response_200 = cls( + message=message, + status=status, + data=data, + ) + + delete_endpoint_response_200.additional_properties = d + return delete_endpoint_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_endpoint_response_400.py b/src/convoy/models/delete_endpoint_response_400.py new file mode 100644 index 0000000..72faf83 --- /dev/null +++ b/src/convoy/models/delete_endpoint_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteEndpointResponse400") + + +@_attrs_define +class DeleteEndpointResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_endpoint_response_400 = cls( + message=message, + status=status, + data=data, + ) + + delete_endpoint_response_400.additional_properties = d + return delete_endpoint_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_endpoint_response_401.py b/src/convoy/models/delete_endpoint_response_401.py new file mode 100644 index 0000000..5e1baaa --- /dev/null +++ b/src/convoy/models/delete_endpoint_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteEndpointResponse401") + + +@_attrs_define +class DeleteEndpointResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_endpoint_response_401 = cls( + message=message, + status=status, + data=data, + ) + + delete_endpoint_response_401.additional_properties = d + return delete_endpoint_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_endpoint_response_404.py b/src/convoy/models/delete_endpoint_response_404.py new file mode 100644 index 0000000..17d1b53 --- /dev/null +++ b/src/convoy/models/delete_endpoint_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteEndpointResponse404") + + +@_attrs_define +class DeleteEndpointResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_endpoint_response_404 = cls( + message=message, + status=status, + data=data, + ) + + delete_endpoint_response_404.additional_properties = d + return delete_endpoint_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_filter_response_200.py b/src/convoy/models/delete_filter_response_200.py new file mode 100644 index 0000000..920200c --- /dev/null +++ b/src/convoy/models/delete_filter_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteFilterResponse200") + + +@_attrs_define +class DeleteFilterResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_filter_response_200 = cls( + message=message, + status=status, + data=data, + ) + + delete_filter_response_200.additional_properties = d + return delete_filter_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_filter_response_400.py b/src/convoy/models/delete_filter_response_400.py new file mode 100644 index 0000000..4e9f181 --- /dev/null +++ b/src/convoy/models/delete_filter_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteFilterResponse400") + + +@_attrs_define +class DeleteFilterResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_filter_response_400 = cls( + message=message, + status=status, + data=data, + ) + + delete_filter_response_400.additional_properties = d + return delete_filter_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_filter_response_401.py b/src/convoy/models/delete_filter_response_401.py new file mode 100644 index 0000000..79e1916 --- /dev/null +++ b/src/convoy/models/delete_filter_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteFilterResponse401") + + +@_attrs_define +class DeleteFilterResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_filter_response_401 = cls( + message=message, + status=status, + data=data, + ) + + delete_filter_response_401.additional_properties = d + return delete_filter_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_filter_response_404.py b/src/convoy/models/delete_filter_response_404.py new file mode 100644 index 0000000..0c7d4c5 --- /dev/null +++ b/src/convoy/models/delete_filter_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteFilterResponse404") + + +@_attrs_define +class DeleteFilterResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_filter_response_404 = cls( + message=message, + status=status, + data=data, + ) + + delete_filter_response_404.additional_properties = d + return delete_filter_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_project_response_200.py b/src/convoy/models/delete_project_response_200.py new file mode 100644 index 0000000..e701b45 --- /dev/null +++ b/src/convoy/models/delete_project_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteProjectResponse200") + + +@_attrs_define +class DeleteProjectResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_project_response_200 = cls( + message=message, + status=status, + data=data, + ) + + delete_project_response_200.additional_properties = d + return delete_project_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_project_response_400.py b/src/convoy/models/delete_project_response_400.py new file mode 100644 index 0000000..7a819c7 --- /dev/null +++ b/src/convoy/models/delete_project_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteProjectResponse400") + + +@_attrs_define +class DeleteProjectResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_project_response_400 = cls( + message=message, + status=status, + data=data, + ) + + delete_project_response_400.additional_properties = d + return delete_project_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_project_response_401.py b/src/convoy/models/delete_project_response_401.py new file mode 100644 index 0000000..0dababe --- /dev/null +++ b/src/convoy/models/delete_project_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteProjectResponse401") + + +@_attrs_define +class DeleteProjectResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_project_response_401 = cls( + message=message, + status=status, + data=data, + ) + + delete_project_response_401.additional_properties = d + return delete_project_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_project_response_403.py b/src/convoy/models/delete_project_response_403.py new file mode 100644 index 0000000..bb88f11 --- /dev/null +++ b/src/convoy/models/delete_project_response_403.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteProjectResponse403") + + +@_attrs_define +class DeleteProjectResponse403: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_project_response_403 = cls( + message=message, + status=status, + data=data, + ) + + delete_project_response_403.additional_properties = d + return delete_project_response_403 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_project_response_404.py b/src/convoy/models/delete_project_response_404.py new file mode 100644 index 0000000..fb261e7 --- /dev/null +++ b/src/convoy/models/delete_project_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteProjectResponse404") + + +@_attrs_define +class DeleteProjectResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_project_response_404 = cls( + message=message, + status=status, + data=data, + ) + + delete_project_response_404.additional_properties = d + return delete_project_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_source_response_200.py b/src/convoy/models/delete_source_response_200.py new file mode 100644 index 0000000..7786da7 --- /dev/null +++ b/src/convoy/models/delete_source_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteSourceResponse200") + + +@_attrs_define +class DeleteSourceResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_source_response_200 = cls( + message=message, + status=status, + data=data, + ) + + delete_source_response_200.additional_properties = d + return delete_source_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_source_response_400.py b/src/convoy/models/delete_source_response_400.py new file mode 100644 index 0000000..d202481 --- /dev/null +++ b/src/convoy/models/delete_source_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteSourceResponse400") + + +@_attrs_define +class DeleteSourceResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_source_response_400 = cls( + message=message, + status=status, + data=data, + ) + + delete_source_response_400.additional_properties = d + return delete_source_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_source_response_401.py b/src/convoy/models/delete_source_response_401.py new file mode 100644 index 0000000..44f1c30 --- /dev/null +++ b/src/convoy/models/delete_source_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteSourceResponse401") + + +@_attrs_define +class DeleteSourceResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_source_response_401 = cls( + message=message, + status=status, + data=data, + ) + + delete_source_response_401.additional_properties = d + return delete_source_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_source_response_404.py b/src/convoy/models/delete_source_response_404.py new file mode 100644 index 0000000..b59421b --- /dev/null +++ b/src/convoy/models/delete_source_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteSourceResponse404") + + +@_attrs_define +class DeleteSourceResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_source_response_404 = cls( + message=message, + status=status, + data=data, + ) + + delete_source_response_404.additional_properties = d + return delete_source_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_subscription_response_200.py b/src/convoy/models/delete_subscription_response_200.py new file mode 100644 index 0000000..938816d --- /dev/null +++ b/src/convoy/models/delete_subscription_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteSubscriptionResponse200") + + +@_attrs_define +class DeleteSubscriptionResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_subscription_response_200 = cls( + message=message, + status=status, + data=data, + ) + + delete_subscription_response_200.additional_properties = d + return delete_subscription_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_subscription_response_400.py b/src/convoy/models/delete_subscription_response_400.py new file mode 100644 index 0000000..5a69864 --- /dev/null +++ b/src/convoy/models/delete_subscription_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteSubscriptionResponse400") + + +@_attrs_define +class DeleteSubscriptionResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_subscription_response_400 = cls( + message=message, + status=status, + data=data, + ) + + delete_subscription_response_400.additional_properties = d + return delete_subscription_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_subscription_response_401.py b/src/convoy/models/delete_subscription_response_401.py new file mode 100644 index 0000000..9b403ea --- /dev/null +++ b/src/convoy/models/delete_subscription_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteSubscriptionResponse401") + + +@_attrs_define +class DeleteSubscriptionResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_subscription_response_401 = cls( + message=message, + status=status, + data=data, + ) + + delete_subscription_response_401.additional_properties = d + return delete_subscription_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/delete_subscription_response_404.py b/src/convoy/models/delete_subscription_response_404.py new file mode 100644 index 0000000..8de0070 --- /dev/null +++ b/src/convoy/models/delete_subscription_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeleteSubscriptionResponse404") + + +@_attrs_define +class DeleteSubscriptionResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + delete_subscription_response_404 = cls( + message=message, + status=status, + data=data, + ) + + delete_subscription_response_404.additional_properties = d + return delete_subscription_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/deprecate_event_type_response_201.py b/src/convoy/models/deprecate_event_type_response_201.py new file mode 100644 index 0000000..5e535a8 --- /dev/null +++ b/src/convoy/models/deprecate_event_type_response_201.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_event_type_response import ModelsEventTypeResponse + + +T = TypeVar("T", bound="DeprecateEventTypeResponse201") + + +@_attrs_define +class DeprecateEventTypeResponse201: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEventTypeResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEventTypeResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_event_type_response import ModelsEventTypeResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEventTypeResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEventTypeResponse.from_dict(_data) + + deprecate_event_type_response_201 = cls( + message=message, + status=status, + data=data, + ) + + deprecate_event_type_response_201.additional_properties = d + return deprecate_event_type_response_201 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/deprecate_event_type_response_400.py b/src/convoy/models/deprecate_event_type_response_400.py new file mode 100644 index 0000000..129ea2e --- /dev/null +++ b/src/convoy/models/deprecate_event_type_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeprecateEventTypeResponse400") + + +@_attrs_define +class DeprecateEventTypeResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + deprecate_event_type_response_400 = cls( + message=message, + status=status, + data=data, + ) + + deprecate_event_type_response_400.additional_properties = d + return deprecate_event_type_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/deprecate_event_type_response_401.py b/src/convoy/models/deprecate_event_type_response_401.py new file mode 100644 index 0000000..3cd2b8d --- /dev/null +++ b/src/convoy/models/deprecate_event_type_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeprecateEventTypeResponse401") + + +@_attrs_define +class DeprecateEventTypeResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + deprecate_event_type_response_401 = cls( + message=message, + status=status, + data=data, + ) + + deprecate_event_type_response_401.additional_properties = d + return deprecate_event_type_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/deprecate_event_type_response_404.py b/src/convoy/models/deprecate_event_type_response_404.py new file mode 100644 index 0000000..a6a8e11 --- /dev/null +++ b/src/convoy/models/deprecate_event_type_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="DeprecateEventTypeResponse404") + + +@_attrs_define +class DeprecateEventTypeResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + deprecate_event_type_response_404 = cls( + message=message, + status=status, + data=data, + ) + + deprecate_event_type_response_404.additional_properties = d + return deprecate_event_type_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/expire_secret_response_200.py b/src/convoy/models/expire_secret_response_200.py new file mode 100644 index 0000000..b69a392 --- /dev/null +++ b/src/convoy/models/expire_secret_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_endpoint_response import ModelsEndpointResponse + + +T = TypeVar("T", bound="ExpireSecretResponse200") + + +@_attrs_define +class ExpireSecretResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEndpointResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEndpointResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_endpoint_response import ModelsEndpointResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEndpointResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEndpointResponse.from_dict(_data) + + expire_secret_response_200 = cls( + message=message, + status=status, + data=data, + ) + + expire_secret_response_200.additional_properties = d + return expire_secret_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/expire_secret_response_400.py b/src/convoy/models/expire_secret_response_400.py new file mode 100644 index 0000000..0decec3 --- /dev/null +++ b/src/convoy/models/expire_secret_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ExpireSecretResponse400") + + +@_attrs_define +class ExpireSecretResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + expire_secret_response_400 = cls( + message=message, + status=status, + data=data, + ) + + expire_secret_response_400.additional_properties = d + return expire_secret_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/expire_secret_response_401.py b/src/convoy/models/expire_secret_response_401.py new file mode 100644 index 0000000..ea95138 --- /dev/null +++ b/src/convoy/models/expire_secret_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ExpireSecretResponse401") + + +@_attrs_define +class ExpireSecretResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + expire_secret_response_401 = cls( + message=message, + status=status, + data=data, + ) + + expire_secret_response_401.additional_properties = d + return expire_secret_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/expire_secret_response_404.py b/src/convoy/models/expire_secret_response_404.py new file mode 100644 index 0000000..d18e464 --- /dev/null +++ b/src/convoy/models/expire_secret_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ExpireSecretResponse404") + + +@_attrs_define +class ExpireSecretResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + expire_secret_response_404 = cls( + message=message, + status=status, + data=data, + ) + + expire_secret_response_404.additional_properties = d + return expire_secret_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/force_resend_event_deliveries_response_200.py b/src/convoy/models/force_resend_event_deliveries_response_200.py new file mode 100644 index 0000000..fd9abbd --- /dev/null +++ b/src/convoy/models/force_resend_event_deliveries_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ForceResendEventDeliveriesResponse200") + + +@_attrs_define +class ForceResendEventDeliveriesResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + force_resend_event_deliveries_response_200 = cls( + message=message, + status=status, + data=data, + ) + + force_resend_event_deliveries_response_200.additional_properties = d + return force_resend_event_deliveries_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/force_resend_event_deliveries_response_400.py b/src/convoy/models/force_resend_event_deliveries_response_400.py new file mode 100644 index 0000000..90c197d --- /dev/null +++ b/src/convoy/models/force_resend_event_deliveries_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ForceResendEventDeliveriesResponse400") + + +@_attrs_define +class ForceResendEventDeliveriesResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + force_resend_event_deliveries_response_400 = cls( + message=message, + status=status, + data=data, + ) + + force_resend_event_deliveries_response_400.additional_properties = d + return force_resend_event_deliveries_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/force_resend_event_deliveries_response_401.py b/src/convoy/models/force_resend_event_deliveries_response_401.py new file mode 100644 index 0000000..3a2ecb3 --- /dev/null +++ b/src/convoy/models/force_resend_event_deliveries_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ForceResendEventDeliveriesResponse401") + + +@_attrs_define +class ForceResendEventDeliveriesResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + force_resend_event_deliveries_response_401 = cls( + message=message, + status=status, + data=data, + ) + + force_resend_event_deliveries_response_401.additional_properties = d + return force_resend_event_deliveries_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/force_resend_event_deliveries_response_404.py b/src/convoy/models/force_resend_event_deliveries_response_404.py new file mode 100644 index 0000000..58c8dd4 --- /dev/null +++ b/src/convoy/models/force_resend_event_deliveries_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ForceResendEventDeliveriesResponse404") + + +@_attrs_define +class ForceResendEventDeliveriesResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + force_resend_event_deliveries_response_404 = cls( + message=message, + status=status, + data=data, + ) + + force_resend_event_deliveries_response_404.additional_properties = d + return force_resend_event_deliveries_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_delivery_attempt_response_200.py b/src/convoy/models/get_delivery_attempt_response_200.py new file mode 100644 index 0000000..7105441 --- /dev/null +++ b/src/convoy/models/get_delivery_attempt_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_delivery_attempt import DatastoreDeliveryAttempt + + +T = TypeVar("T", bound="GetDeliveryAttemptResponse200") + + +@_attrs_define +class GetDeliveryAttemptResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (DatastoreDeliveryAttempt | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: DatastoreDeliveryAttempt | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_delivery_attempt import DatastoreDeliveryAttempt + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: DatastoreDeliveryAttempt | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = DatastoreDeliveryAttempt.from_dict(_data) + + get_delivery_attempt_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_delivery_attempt_response_200.additional_properties = d + return get_delivery_attempt_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_delivery_attempt_response_400.py b/src/convoy/models/get_delivery_attempt_response_400.py new file mode 100644 index 0000000..b4e704f --- /dev/null +++ b/src/convoy/models/get_delivery_attempt_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetDeliveryAttemptResponse400") + + +@_attrs_define +class GetDeliveryAttemptResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_delivery_attempt_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_delivery_attempt_response_400.additional_properties = d + return get_delivery_attempt_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_delivery_attempt_response_401.py b/src/convoy/models/get_delivery_attempt_response_401.py new file mode 100644 index 0000000..2e289b0 --- /dev/null +++ b/src/convoy/models/get_delivery_attempt_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetDeliveryAttemptResponse401") + + +@_attrs_define +class GetDeliveryAttemptResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_delivery_attempt_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_delivery_attempt_response_401.additional_properties = d + return get_delivery_attempt_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_delivery_attempt_response_404.py b/src/convoy/models/get_delivery_attempt_response_404.py new file mode 100644 index 0000000..29d6c86 --- /dev/null +++ b/src/convoy/models/get_delivery_attempt_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetDeliveryAttemptResponse404") + + +@_attrs_define +class GetDeliveryAttemptResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_delivery_attempt_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_delivery_attempt_response_404.additional_properties = d + return get_delivery_attempt_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_delivery_attempts_response_200.py b/src/convoy/models/get_delivery_attempts_response_200.py new file mode 100644 index 0000000..6a650ed --- /dev/null +++ b/src/convoy/models/get_delivery_attempts_response_200.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_delivery_attempt import DatastoreDeliveryAttempt + + +T = TypeVar("T", bound="GetDeliveryAttemptsResponse200") + + +@_attrs_define +class GetDeliveryAttemptsResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (list[DatastoreDeliveryAttempt] | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: list[DatastoreDeliveryAttempt] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.data, Unset): + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_delivery_attempt import DatastoreDeliveryAttempt + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: list[DatastoreDeliveryAttempt] | Unset = UNSET + if _data is not UNSET: + data = [] + for data_item_data in _data: + data_item = DatastoreDeliveryAttempt.from_dict(data_item_data) + + data.append(data_item) + + get_delivery_attempts_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_delivery_attempts_response_200.additional_properties = d + return get_delivery_attempts_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_delivery_attempts_response_400.py b/src/convoy/models/get_delivery_attempts_response_400.py new file mode 100644 index 0000000..6045551 --- /dev/null +++ b/src/convoy/models/get_delivery_attempts_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetDeliveryAttemptsResponse400") + + +@_attrs_define +class GetDeliveryAttemptsResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_delivery_attempts_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_delivery_attempts_response_400.additional_properties = d + return get_delivery_attempts_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_delivery_attempts_response_401.py b/src/convoy/models/get_delivery_attempts_response_401.py new file mode 100644 index 0000000..4f80088 --- /dev/null +++ b/src/convoy/models/get_delivery_attempts_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetDeliveryAttemptsResponse401") + + +@_attrs_define +class GetDeliveryAttemptsResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_delivery_attempts_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_delivery_attempts_response_401.additional_properties = d + return get_delivery_attempts_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_delivery_attempts_response_404.py b/src/convoy/models/get_delivery_attempts_response_404.py new file mode 100644 index 0000000..06b7964 --- /dev/null +++ b/src/convoy/models/get_delivery_attempts_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetDeliveryAttemptsResponse404") + + +@_attrs_define +class GetDeliveryAttemptsResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_delivery_attempts_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_delivery_attempts_response_404.additional_properties = d + return get_delivery_attempts_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_endpoint_event_response_200.py b/src/convoy/models/get_endpoint_event_response_200.py new file mode 100644 index 0000000..491cb3b --- /dev/null +++ b/src/convoy/models/get_endpoint_event_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_event_response import ModelsEventResponse + + +T = TypeVar("T", bound="GetEndpointEventResponse200") + + +@_attrs_define +class GetEndpointEventResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEventResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEventResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_event_response import ModelsEventResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEventResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEventResponse.from_dict(_data) + + get_endpoint_event_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_endpoint_event_response_200.additional_properties = d + return get_endpoint_event_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_endpoint_event_response_400.py b/src/convoy/models/get_endpoint_event_response_400.py new file mode 100644 index 0000000..68eda8a --- /dev/null +++ b/src/convoy/models/get_endpoint_event_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEndpointEventResponse400") + + +@_attrs_define +class GetEndpointEventResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_endpoint_event_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_endpoint_event_response_400.additional_properties = d + return get_endpoint_event_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_endpoint_event_response_401.py b/src/convoy/models/get_endpoint_event_response_401.py new file mode 100644 index 0000000..28a943d --- /dev/null +++ b/src/convoy/models/get_endpoint_event_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEndpointEventResponse401") + + +@_attrs_define +class GetEndpointEventResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_endpoint_event_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_endpoint_event_response_401.additional_properties = d + return get_endpoint_event_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_endpoint_event_response_404.py b/src/convoy/models/get_endpoint_event_response_404.py new file mode 100644 index 0000000..c99d510 --- /dev/null +++ b/src/convoy/models/get_endpoint_event_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEndpointEventResponse404") + + +@_attrs_define +class GetEndpointEventResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_endpoint_event_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_endpoint_event_response_404.additional_properties = d + return get_endpoint_event_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_endpoint_response_200.py b/src/convoy/models/get_endpoint_response_200.py new file mode 100644 index 0000000..8d4efc2 --- /dev/null +++ b/src/convoy/models/get_endpoint_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_endpoint_response import ModelsEndpointResponse + + +T = TypeVar("T", bound="GetEndpointResponse200") + + +@_attrs_define +class GetEndpointResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEndpointResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEndpointResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_endpoint_response import ModelsEndpointResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEndpointResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEndpointResponse.from_dict(_data) + + get_endpoint_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_endpoint_response_200.additional_properties = d + return get_endpoint_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_endpoint_response_400.py b/src/convoy/models/get_endpoint_response_400.py new file mode 100644 index 0000000..f415720 --- /dev/null +++ b/src/convoy/models/get_endpoint_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEndpointResponse400") + + +@_attrs_define +class GetEndpointResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_endpoint_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_endpoint_response_400.additional_properties = d + return get_endpoint_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_endpoint_response_401.py b/src/convoy/models/get_endpoint_response_401.py new file mode 100644 index 0000000..acead3e --- /dev/null +++ b/src/convoy/models/get_endpoint_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEndpointResponse401") + + +@_attrs_define +class GetEndpointResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_endpoint_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_endpoint_response_401.additional_properties = d + return get_endpoint_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_endpoint_response_404.py b/src/convoy/models/get_endpoint_response_404.py new file mode 100644 index 0000000..db0297f --- /dev/null +++ b/src/convoy/models/get_endpoint_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEndpointResponse404") + + +@_attrs_define +class GetEndpointResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_endpoint_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_endpoint_response_404.additional_properties = d + return get_endpoint_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_endpoints_direction.py b/src/convoy/models/get_endpoints_direction.py new file mode 100644 index 0000000..486eee6 --- /dev/null +++ b/src/convoy/models/get_endpoints_direction.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class GetEndpointsDirection(str, Enum): + NEXT = "next" + PREV = "prev" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/get_endpoints_response_200.py b/src/convoy/models/get_endpoints_response_200.py new file mode 100644 index 0000000..036255c --- /dev/null +++ b/src/convoy/models/get_endpoints_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.get_endpoints_response_200_data import GetEndpointsResponse200Data + + +T = TypeVar("T", bound="GetEndpointsResponse200") + + +@_attrs_define +class GetEndpointsResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (GetEndpointsResponse200Data | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: GetEndpointsResponse200Data | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.get_endpoints_response_200_data import GetEndpointsResponse200Data + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: GetEndpointsResponse200Data | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = GetEndpointsResponse200Data.from_dict(_data) + + get_endpoints_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_endpoints_response_200.additional_properties = d + return get_endpoints_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_endpoints_response_200_data.py b/src/convoy/models/get_endpoints_response_200_data.py new file mode 100644 index 0000000..1a6a865 --- /dev/null +++ b/src/convoy/models/get_endpoints_response_200_data.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.models_endpoint_response import ModelsEndpointResponse + + +T = TypeVar("T", bound="GetEndpointsResponse200Data") + + +@_attrs_define +class GetEndpointsResponse200Data: + """ + Attributes: + content (list[ModelsEndpointResponse] | Unset): + pagination (DatastorePaginationData | None | Unset): + """ + + content: list[ModelsEndpointResponse] | Unset = UNSET + pagination: DatastorePaginationData | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.datastore_pagination_data import DatastorePaginationData + + content: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.content, Unset): + content = [] + for content_item_data in self.content: + content_item = content_item_data.to_dict() + content.append(content_item) + + pagination: dict[str, Any] | None | Unset + if isinstance(self.pagination, Unset): + pagination = UNSET + elif isinstance(self.pagination, DatastorePaginationData): + pagination = self.pagination.to_dict() + else: + pagination = self.pagination + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if content is not UNSET: + field_dict["content"] = content + if pagination is not UNSET: + field_dict["pagination"] = pagination + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.models_endpoint_response import ModelsEndpointResponse + + d = dict(src_dict) + _content = d.pop("content", UNSET) + content: list[ModelsEndpointResponse] | Unset = UNSET + if _content is not UNSET: + content = [] + for content_item_data in _content: + content_item = ModelsEndpointResponse.from_dict(content_item_data) + + content.append(content_item) + + def _parse_pagination(data: object) -> DatastorePaginationData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + pagination_type_1 = DatastorePaginationData.from_dict(data) + + return pagination_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DatastorePaginationData | None | Unset, data) + + pagination = _parse_pagination(d.pop("pagination", UNSET)) + + get_endpoints_response_200_data = cls( + content=content, + pagination=pagination, + ) + + get_endpoints_response_200_data.additional_properties = d + return get_endpoints_response_200_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_endpoints_response_400.py b/src/convoy/models/get_endpoints_response_400.py new file mode 100644 index 0000000..929d63c --- /dev/null +++ b/src/convoy/models/get_endpoints_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEndpointsResponse400") + + +@_attrs_define +class GetEndpointsResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_endpoints_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_endpoints_response_400.additional_properties = d + return get_endpoints_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_endpoints_response_401.py b/src/convoy/models/get_endpoints_response_401.py new file mode 100644 index 0000000..bfd1160 --- /dev/null +++ b/src/convoy/models/get_endpoints_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEndpointsResponse401") + + +@_attrs_define +class GetEndpointsResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_endpoints_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_endpoints_response_401.additional_properties = d + return get_endpoints_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_endpoints_response_404.py b/src/convoy/models/get_endpoints_response_404.py new file mode 100644 index 0000000..f74b70c --- /dev/null +++ b/src/convoy/models/get_endpoints_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEndpointsResponse404") + + +@_attrs_define +class GetEndpointsResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_endpoints_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_endpoints_response_404.additional_properties = d + return get_endpoints_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_event_deliveries_paged_direction.py b/src/convoy/models/get_event_deliveries_paged_direction.py new file mode 100644 index 0000000..35c91c0 --- /dev/null +++ b/src/convoy/models/get_event_deliveries_paged_direction.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class GetEventDeliveriesPagedDirection(str, Enum): + NEXT = "next" + PREV = "prev" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/get_event_deliveries_paged_response_200.py b/src/convoy/models/get_event_deliveries_paged_response_200.py new file mode 100644 index 0000000..64df226 --- /dev/null +++ b/src/convoy/models/get_event_deliveries_paged_response_200.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.get_event_deliveries_paged_response_200_data import ( + GetEventDeliveriesPagedResponse200Data, + ) + + +T = TypeVar("T", bound="GetEventDeliveriesPagedResponse200") + + +@_attrs_define +class GetEventDeliveriesPagedResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (GetEventDeliveriesPagedResponse200Data | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: GetEventDeliveriesPagedResponse200Data | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.get_event_deliveries_paged_response_200_data import ( + GetEventDeliveriesPagedResponse200Data, + ) + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: GetEventDeliveriesPagedResponse200Data | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = GetEventDeliveriesPagedResponse200Data.from_dict(_data) + + get_event_deliveries_paged_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_event_deliveries_paged_response_200.additional_properties = d + return get_event_deliveries_paged_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_event_deliveries_paged_response_200_data.py b/src/convoy/models/get_event_deliveries_paged_response_200_data.py new file mode 100644 index 0000000..f7d0465 --- /dev/null +++ b/src/convoy/models/get_event_deliveries_paged_response_200_data.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.models_event_delivery_response import ModelsEventDeliveryResponse + + +T = TypeVar("T", bound="GetEventDeliveriesPagedResponse200Data") + + +@_attrs_define +class GetEventDeliveriesPagedResponse200Data: + """ + Attributes: + content (list[ModelsEventDeliveryResponse] | Unset): + pagination (DatastorePaginationData | None | Unset): + """ + + content: list[ModelsEventDeliveryResponse] | Unset = UNSET + pagination: DatastorePaginationData | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.datastore_pagination_data import DatastorePaginationData + + content: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.content, Unset): + content = [] + for content_item_data in self.content: + content_item = content_item_data.to_dict() + content.append(content_item) + + pagination: dict[str, Any] | None | Unset + if isinstance(self.pagination, Unset): + pagination = UNSET + elif isinstance(self.pagination, DatastorePaginationData): + pagination = self.pagination.to_dict() + else: + pagination = self.pagination + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if content is not UNSET: + field_dict["content"] = content + if pagination is not UNSET: + field_dict["pagination"] = pagination + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.models_event_delivery_response import ModelsEventDeliveryResponse + + d = dict(src_dict) + _content = d.pop("content", UNSET) + content: list[ModelsEventDeliveryResponse] | Unset = UNSET + if _content is not UNSET: + content = [] + for content_item_data in _content: + content_item = ModelsEventDeliveryResponse.from_dict(content_item_data) + + content.append(content_item) + + def _parse_pagination(data: object) -> DatastorePaginationData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + pagination_type_1 = DatastorePaginationData.from_dict(data) + + return pagination_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DatastorePaginationData | None | Unset, data) + + pagination = _parse_pagination(d.pop("pagination", UNSET)) + + get_event_deliveries_paged_response_200_data = cls( + content=content, + pagination=pagination, + ) + + get_event_deliveries_paged_response_200_data.additional_properties = d + return get_event_deliveries_paged_response_200_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_event_deliveries_paged_response_400.py b/src/convoy/models/get_event_deliveries_paged_response_400.py new file mode 100644 index 0000000..76c1129 --- /dev/null +++ b/src/convoy/models/get_event_deliveries_paged_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEventDeliveriesPagedResponse400") + + +@_attrs_define +class GetEventDeliveriesPagedResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_event_deliveries_paged_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_event_deliveries_paged_response_400.additional_properties = d + return get_event_deliveries_paged_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_event_deliveries_paged_response_401.py b/src/convoy/models/get_event_deliveries_paged_response_401.py new file mode 100644 index 0000000..e7e14fd --- /dev/null +++ b/src/convoy/models/get_event_deliveries_paged_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEventDeliveriesPagedResponse401") + + +@_attrs_define +class GetEventDeliveriesPagedResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_event_deliveries_paged_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_event_deliveries_paged_response_401.additional_properties = d + return get_event_deliveries_paged_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_event_deliveries_paged_response_404.py b/src/convoy/models/get_event_deliveries_paged_response_404.py new file mode 100644 index 0000000..17314d7 --- /dev/null +++ b/src/convoy/models/get_event_deliveries_paged_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEventDeliveriesPagedResponse404") + + +@_attrs_define +class GetEventDeliveriesPagedResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_event_deliveries_paged_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_event_deliveries_paged_response_404.additional_properties = d + return get_event_deliveries_paged_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_event_delivery_response_200.py b/src/convoy/models/get_event_delivery_response_200.py new file mode 100644 index 0000000..b5dc3f0 --- /dev/null +++ b/src/convoy/models/get_event_delivery_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_event_delivery_response import ModelsEventDeliveryResponse + + +T = TypeVar("T", bound="GetEventDeliveryResponse200") + + +@_attrs_define +class GetEventDeliveryResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEventDeliveryResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEventDeliveryResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_event_delivery_response import ModelsEventDeliveryResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEventDeliveryResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEventDeliveryResponse.from_dict(_data) + + get_event_delivery_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_event_delivery_response_200.additional_properties = d + return get_event_delivery_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_event_delivery_response_400.py b/src/convoy/models/get_event_delivery_response_400.py new file mode 100644 index 0000000..469966e --- /dev/null +++ b/src/convoy/models/get_event_delivery_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEventDeliveryResponse400") + + +@_attrs_define +class GetEventDeliveryResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_event_delivery_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_event_delivery_response_400.additional_properties = d + return get_event_delivery_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_event_delivery_response_401.py b/src/convoy/models/get_event_delivery_response_401.py new file mode 100644 index 0000000..bec9ca9 --- /dev/null +++ b/src/convoy/models/get_event_delivery_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEventDeliveryResponse401") + + +@_attrs_define +class GetEventDeliveryResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_event_delivery_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_event_delivery_response_401.additional_properties = d + return get_event_delivery_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_event_delivery_response_404.py b/src/convoy/models/get_event_delivery_response_404.py new file mode 100644 index 0000000..dc8b227 --- /dev/null +++ b/src/convoy/models/get_event_delivery_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEventDeliveryResponse404") + + +@_attrs_define +class GetEventDeliveryResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_event_delivery_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_event_delivery_response_404.additional_properties = d + return get_event_delivery_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_event_types_response_200.py b/src/convoy/models/get_event_types_response_200.py new file mode 100644 index 0000000..ba903c5 --- /dev/null +++ b/src/convoy/models/get_event_types_response_200.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_event_type_response import ModelsEventTypeResponse + + +T = TypeVar("T", bound="GetEventTypesResponse200") + + +@_attrs_define +class GetEventTypesResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (list[ModelsEventTypeResponse] | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: list[ModelsEventTypeResponse] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.data, Unset): + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_event_type_response import ModelsEventTypeResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: list[ModelsEventTypeResponse] | Unset = UNSET + if _data is not UNSET: + data = [] + for data_item_data in _data: + data_item = ModelsEventTypeResponse.from_dict(data_item_data) + + data.append(data_item) + + get_event_types_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_event_types_response_200.additional_properties = d + return get_event_types_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_event_types_response_400.py b/src/convoy/models/get_event_types_response_400.py new file mode 100644 index 0000000..cced6e4 --- /dev/null +++ b/src/convoy/models/get_event_types_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEventTypesResponse400") + + +@_attrs_define +class GetEventTypesResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_event_types_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_event_types_response_400.additional_properties = d + return get_event_types_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_event_types_response_401.py b/src/convoy/models/get_event_types_response_401.py new file mode 100644 index 0000000..1198cd7 --- /dev/null +++ b/src/convoy/models/get_event_types_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEventTypesResponse401") + + +@_attrs_define +class GetEventTypesResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_event_types_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_event_types_response_401.additional_properties = d + return get_event_types_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_event_types_response_404.py b/src/convoy/models/get_event_types_response_404.py new file mode 100644 index 0000000..bd9957b --- /dev/null +++ b/src/convoy/models/get_event_types_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEventTypesResponse404") + + +@_attrs_define +class GetEventTypesResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_event_types_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_event_types_response_404.additional_properties = d + return get_event_types_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_events_paged_direction.py b/src/convoy/models/get_events_paged_direction.py new file mode 100644 index 0000000..1b0e50a --- /dev/null +++ b/src/convoy/models/get_events_paged_direction.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class GetEventsPagedDirection(str, Enum): + NEXT = "next" + PREV = "prev" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/get_events_paged_response_200.py b/src/convoy/models/get_events_paged_response_200.py new file mode 100644 index 0000000..ecdc55a --- /dev/null +++ b/src/convoy/models/get_events_paged_response_200.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.get_events_paged_response_200_data import ( + GetEventsPagedResponse200Data, + ) + + +T = TypeVar("T", bound="GetEventsPagedResponse200") + + +@_attrs_define +class GetEventsPagedResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (GetEventsPagedResponse200Data | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: GetEventsPagedResponse200Data | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.get_events_paged_response_200_data import ( + GetEventsPagedResponse200Data, + ) + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: GetEventsPagedResponse200Data | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = GetEventsPagedResponse200Data.from_dict(_data) + + get_events_paged_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_events_paged_response_200.additional_properties = d + return get_events_paged_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_events_paged_response_200_data.py b/src/convoy/models/get_events_paged_response_200_data.py new file mode 100644 index 0000000..f4a86ef --- /dev/null +++ b/src/convoy/models/get_events_paged_response_200_data.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.models_event_response import ModelsEventResponse + + +T = TypeVar("T", bound="GetEventsPagedResponse200Data") + + +@_attrs_define +class GetEventsPagedResponse200Data: + """ + Attributes: + content (list[ModelsEventResponse] | Unset): + pagination (DatastorePaginationData | None | Unset): + """ + + content: list[ModelsEventResponse] | Unset = UNSET + pagination: DatastorePaginationData | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.datastore_pagination_data import DatastorePaginationData + + content: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.content, Unset): + content = [] + for content_item_data in self.content: + content_item = content_item_data.to_dict() + content.append(content_item) + + pagination: dict[str, Any] | None | Unset + if isinstance(self.pagination, Unset): + pagination = UNSET + elif isinstance(self.pagination, DatastorePaginationData): + pagination = self.pagination.to_dict() + else: + pagination = self.pagination + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if content is not UNSET: + field_dict["content"] = content + if pagination is not UNSET: + field_dict["pagination"] = pagination + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.models_event_response import ModelsEventResponse + + d = dict(src_dict) + _content = d.pop("content", UNSET) + content: list[ModelsEventResponse] | Unset = UNSET + if _content is not UNSET: + content = [] + for content_item_data in _content: + content_item = ModelsEventResponse.from_dict(content_item_data) + + content.append(content_item) + + def _parse_pagination(data: object) -> DatastorePaginationData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + pagination_type_1 = DatastorePaginationData.from_dict(data) + + return pagination_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DatastorePaginationData | None | Unset, data) + + pagination = _parse_pagination(d.pop("pagination", UNSET)) + + get_events_paged_response_200_data = cls( + content=content, + pagination=pagination, + ) + + get_events_paged_response_200_data.additional_properties = d + return get_events_paged_response_200_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_events_paged_response_400.py b/src/convoy/models/get_events_paged_response_400.py new file mode 100644 index 0000000..50efafd --- /dev/null +++ b/src/convoy/models/get_events_paged_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEventsPagedResponse400") + + +@_attrs_define +class GetEventsPagedResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_events_paged_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_events_paged_response_400.additional_properties = d + return get_events_paged_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_events_paged_response_401.py b/src/convoy/models/get_events_paged_response_401.py new file mode 100644 index 0000000..4c06565 --- /dev/null +++ b/src/convoy/models/get_events_paged_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEventsPagedResponse401") + + +@_attrs_define +class GetEventsPagedResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_events_paged_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_events_paged_response_401.additional_properties = d + return get_events_paged_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_events_paged_response_404.py b/src/convoy/models/get_events_paged_response_404.py new file mode 100644 index 0000000..074c725 --- /dev/null +++ b/src/convoy/models/get_events_paged_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetEventsPagedResponse404") + + +@_attrs_define +class GetEventsPagedResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_events_paged_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_events_paged_response_404.additional_properties = d + return get_events_paged_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_filter_response_200.py b/src/convoy/models/get_filter_response_200.py new file mode 100644 index 0000000..001aea7 --- /dev/null +++ b/src/convoy/models/get_filter_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_filter_response import ModelsFilterResponse + + +T = TypeVar("T", bound="GetFilterResponse200") + + +@_attrs_define +class GetFilterResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsFilterResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsFilterResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_filter_response import ModelsFilterResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsFilterResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsFilterResponse.from_dict(_data) + + get_filter_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_filter_response_200.additional_properties = d + return get_filter_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_filter_response_400.py b/src/convoy/models/get_filter_response_400.py new file mode 100644 index 0000000..2290a1f --- /dev/null +++ b/src/convoy/models/get_filter_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetFilterResponse400") + + +@_attrs_define +class GetFilterResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_filter_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_filter_response_400.additional_properties = d + return get_filter_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_filter_response_401.py b/src/convoy/models/get_filter_response_401.py new file mode 100644 index 0000000..4d15688 --- /dev/null +++ b/src/convoy/models/get_filter_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetFilterResponse401") + + +@_attrs_define +class GetFilterResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_filter_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_filter_response_401.additional_properties = d + return get_filter_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_filter_response_404.py b/src/convoy/models/get_filter_response_404.py new file mode 100644 index 0000000..cccfbbe --- /dev/null +++ b/src/convoy/models/get_filter_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetFilterResponse404") + + +@_attrs_define +class GetFilterResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_filter_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_filter_response_404.additional_properties = d + return get_filter_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_filters_response_200.py b/src/convoy/models/get_filters_response_200.py new file mode 100644 index 0000000..75947a1 --- /dev/null +++ b/src/convoy/models/get_filters_response_200.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_filter_response import ModelsFilterResponse + + +T = TypeVar("T", bound="GetFiltersResponse200") + + +@_attrs_define +class GetFiltersResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (list[ModelsFilterResponse] | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: list[ModelsFilterResponse] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.data, Unset): + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_filter_response import ModelsFilterResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: list[ModelsFilterResponse] | Unset = UNSET + if _data is not UNSET: + data = [] + for data_item_data in _data: + data_item = ModelsFilterResponse.from_dict(data_item_data) + + data.append(data_item) + + get_filters_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_filters_response_200.additional_properties = d + return get_filters_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_filters_response_400.py b/src/convoy/models/get_filters_response_400.py new file mode 100644 index 0000000..aa95067 --- /dev/null +++ b/src/convoy/models/get_filters_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetFiltersResponse400") + + +@_attrs_define +class GetFiltersResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_filters_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_filters_response_400.additional_properties = d + return get_filters_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_filters_response_401.py b/src/convoy/models/get_filters_response_401.py new file mode 100644 index 0000000..a8f6620 --- /dev/null +++ b/src/convoy/models/get_filters_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetFiltersResponse401") + + +@_attrs_define +class GetFiltersResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_filters_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_filters_response_401.additional_properties = d + return get_filters_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_filters_response_404.py b/src/convoy/models/get_filters_response_404.py new file mode 100644 index 0000000..968b27a --- /dev/null +++ b/src/convoy/models/get_filters_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetFiltersResponse404") + + +@_attrs_define +class GetFiltersResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_filters_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_filters_response_404.additional_properties = d + return get_filters_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_meta_event_response_200.py b/src/convoy/models/get_meta_event_response_200.py new file mode 100644 index 0000000..706eb21 --- /dev/null +++ b/src/convoy/models/get_meta_event_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_meta_event_response import ModelsMetaEventResponse + + +T = TypeVar("T", bound="GetMetaEventResponse200") + + +@_attrs_define +class GetMetaEventResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsMetaEventResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsMetaEventResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_meta_event_response import ModelsMetaEventResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsMetaEventResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsMetaEventResponse.from_dict(_data) + + get_meta_event_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_meta_event_response_200.additional_properties = d + return get_meta_event_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_meta_event_response_400.py b/src/convoy/models/get_meta_event_response_400.py new file mode 100644 index 0000000..0fec3bf --- /dev/null +++ b/src/convoy/models/get_meta_event_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetMetaEventResponse400") + + +@_attrs_define +class GetMetaEventResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_meta_event_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_meta_event_response_400.additional_properties = d + return get_meta_event_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_meta_event_response_401.py b/src/convoy/models/get_meta_event_response_401.py new file mode 100644 index 0000000..195f279 --- /dev/null +++ b/src/convoy/models/get_meta_event_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetMetaEventResponse401") + + +@_attrs_define +class GetMetaEventResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_meta_event_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_meta_event_response_401.additional_properties = d + return get_meta_event_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_meta_event_response_404.py b/src/convoy/models/get_meta_event_response_404.py new file mode 100644 index 0000000..91080f4 --- /dev/null +++ b/src/convoy/models/get_meta_event_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetMetaEventResponse404") + + +@_attrs_define +class GetMetaEventResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_meta_event_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_meta_event_response_404.additional_properties = d + return get_meta_event_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_meta_events_paged_direction.py b/src/convoy/models/get_meta_events_paged_direction.py new file mode 100644 index 0000000..3d98026 --- /dev/null +++ b/src/convoy/models/get_meta_events_paged_direction.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class GetMetaEventsPagedDirection(str, Enum): + NEXT = "next" + PREV = "prev" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/get_meta_events_paged_response_200.py b/src/convoy/models/get_meta_events_paged_response_200.py new file mode 100644 index 0000000..f532843 --- /dev/null +++ b/src/convoy/models/get_meta_events_paged_response_200.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.get_meta_events_paged_response_200_data import ( + GetMetaEventsPagedResponse200Data, + ) + + +T = TypeVar("T", bound="GetMetaEventsPagedResponse200") + + +@_attrs_define +class GetMetaEventsPagedResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (GetMetaEventsPagedResponse200Data | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: GetMetaEventsPagedResponse200Data | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.get_meta_events_paged_response_200_data import ( + GetMetaEventsPagedResponse200Data, + ) + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: GetMetaEventsPagedResponse200Data | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = GetMetaEventsPagedResponse200Data.from_dict(_data) + + get_meta_events_paged_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_meta_events_paged_response_200.additional_properties = d + return get_meta_events_paged_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_meta_events_paged_response_200_data.py b/src/convoy/models/get_meta_events_paged_response_200_data.py new file mode 100644 index 0000000..2f8b149 --- /dev/null +++ b/src/convoy/models/get_meta_events_paged_response_200_data.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.models_meta_event_response import ModelsMetaEventResponse + + +T = TypeVar("T", bound="GetMetaEventsPagedResponse200Data") + + +@_attrs_define +class GetMetaEventsPagedResponse200Data: + """ + Attributes: + content (list[ModelsMetaEventResponse] | Unset): + pagination (DatastorePaginationData | None | Unset): + """ + + content: list[ModelsMetaEventResponse] | Unset = UNSET + pagination: DatastorePaginationData | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.datastore_pagination_data import DatastorePaginationData + + content: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.content, Unset): + content = [] + for content_item_data in self.content: + content_item = content_item_data.to_dict() + content.append(content_item) + + pagination: dict[str, Any] | None | Unset + if isinstance(self.pagination, Unset): + pagination = UNSET + elif isinstance(self.pagination, DatastorePaginationData): + pagination = self.pagination.to_dict() + else: + pagination = self.pagination + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if content is not UNSET: + field_dict["content"] = content + if pagination is not UNSET: + field_dict["pagination"] = pagination + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.models_meta_event_response import ModelsMetaEventResponse + + d = dict(src_dict) + _content = d.pop("content", UNSET) + content: list[ModelsMetaEventResponse] | Unset = UNSET + if _content is not UNSET: + content = [] + for content_item_data in _content: + content_item = ModelsMetaEventResponse.from_dict(content_item_data) + + content.append(content_item) + + def _parse_pagination(data: object) -> DatastorePaginationData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + pagination_type_1 = DatastorePaginationData.from_dict(data) + + return pagination_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DatastorePaginationData | None | Unset, data) + + pagination = _parse_pagination(d.pop("pagination", UNSET)) + + get_meta_events_paged_response_200_data = cls( + content=content, + pagination=pagination, + ) + + get_meta_events_paged_response_200_data.additional_properties = d + return get_meta_events_paged_response_200_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_meta_events_paged_response_400.py b/src/convoy/models/get_meta_events_paged_response_400.py new file mode 100644 index 0000000..1c1ad32 --- /dev/null +++ b/src/convoy/models/get_meta_events_paged_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetMetaEventsPagedResponse400") + + +@_attrs_define +class GetMetaEventsPagedResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_meta_events_paged_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_meta_events_paged_response_400.additional_properties = d + return get_meta_events_paged_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_meta_events_paged_response_401.py b/src/convoy/models/get_meta_events_paged_response_401.py new file mode 100644 index 0000000..1f852b1 --- /dev/null +++ b/src/convoy/models/get_meta_events_paged_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetMetaEventsPagedResponse401") + + +@_attrs_define +class GetMetaEventsPagedResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_meta_events_paged_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_meta_events_paged_response_401.additional_properties = d + return get_meta_events_paged_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_meta_events_paged_response_404.py b/src/convoy/models/get_meta_events_paged_response_404.py new file mode 100644 index 0000000..02325d9 --- /dev/null +++ b/src/convoy/models/get_meta_events_paged_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetMetaEventsPagedResponse404") + + +@_attrs_define +class GetMetaEventsPagedResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_meta_events_paged_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_meta_events_paged_response_404.additional_properties = d + return get_meta_events_paged_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_portal_link_response_200.py b/src/convoy/models/get_portal_link_response_200.py new file mode 100644 index 0000000..db1f946 --- /dev/null +++ b/src/convoy/models/get_portal_link_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_portal_link_response import DatastorePortalLinkResponse + + +T = TypeVar("T", bound="GetPortalLinkResponse200") + + +@_attrs_define +class GetPortalLinkResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (DatastorePortalLinkResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: DatastorePortalLinkResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_portal_link_response import DatastorePortalLinkResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: DatastorePortalLinkResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = DatastorePortalLinkResponse.from_dict(_data) + + get_portal_link_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_portal_link_response_200.additional_properties = d + return get_portal_link_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_portal_link_response_400.py b/src/convoy/models/get_portal_link_response_400.py new file mode 100644 index 0000000..a296226 --- /dev/null +++ b/src/convoy/models/get_portal_link_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetPortalLinkResponse400") + + +@_attrs_define +class GetPortalLinkResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_portal_link_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_portal_link_response_400.additional_properties = d + return get_portal_link_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_portal_link_response_401.py b/src/convoy/models/get_portal_link_response_401.py new file mode 100644 index 0000000..4097f6c --- /dev/null +++ b/src/convoy/models/get_portal_link_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetPortalLinkResponse401") + + +@_attrs_define +class GetPortalLinkResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_portal_link_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_portal_link_response_401.additional_properties = d + return get_portal_link_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_portal_link_response_404.py b/src/convoy/models/get_portal_link_response_404.py new file mode 100644 index 0000000..6421244 --- /dev/null +++ b/src/convoy/models/get_portal_link_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetPortalLinkResponse404") + + +@_attrs_define +class GetPortalLinkResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_portal_link_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_portal_link_response_404.additional_properties = d + return get_portal_link_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_project_response_200.py b/src/convoy/models/get_project_response_200.py new file mode 100644 index 0000000..b945d75 --- /dev/null +++ b/src/convoy/models/get_project_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_project_response import ModelsProjectResponse + + +T = TypeVar("T", bound="GetProjectResponse200") + + +@_attrs_define +class GetProjectResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsProjectResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsProjectResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_project_response import ModelsProjectResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsProjectResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsProjectResponse.from_dict(_data) + + get_project_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_project_response_200.additional_properties = d + return get_project_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_project_response_400.py b/src/convoy/models/get_project_response_400.py new file mode 100644 index 0000000..28ece21 --- /dev/null +++ b/src/convoy/models/get_project_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetProjectResponse400") + + +@_attrs_define +class GetProjectResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_project_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_project_response_400.additional_properties = d + return get_project_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_project_response_401.py b/src/convoy/models/get_project_response_401.py new file mode 100644 index 0000000..e8d2e9b --- /dev/null +++ b/src/convoy/models/get_project_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetProjectResponse401") + + +@_attrs_define +class GetProjectResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_project_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_project_response_401.additional_properties = d + return get_project_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_project_response_404.py b/src/convoy/models/get_project_response_404.py new file mode 100644 index 0000000..650a83b --- /dev/null +++ b/src/convoy/models/get_project_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetProjectResponse404") + + +@_attrs_define +class GetProjectResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_project_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_project_response_404.additional_properties = d + return get_project_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_projects_response_200.py b/src/convoy/models/get_projects_response_200.py new file mode 100644 index 0000000..e574c59 --- /dev/null +++ b/src/convoy/models/get_projects_response_200.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_project_response import ModelsProjectResponse + + +T = TypeVar("T", bound="GetProjectsResponse200") + + +@_attrs_define +class GetProjectsResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (list[ModelsProjectResponse] | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: list[ModelsProjectResponse] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.data, Unset): + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_project_response import ModelsProjectResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: list[ModelsProjectResponse] | Unset = UNSET + if _data is not UNSET: + data = [] + for data_item_data in _data: + data_item = ModelsProjectResponse.from_dict(data_item_data) + + data.append(data_item) + + get_projects_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_projects_response_200.additional_properties = d + return get_projects_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_projects_response_400.py b/src/convoy/models/get_projects_response_400.py new file mode 100644 index 0000000..c25e007 --- /dev/null +++ b/src/convoy/models/get_projects_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetProjectsResponse400") + + +@_attrs_define +class GetProjectsResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_projects_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_projects_response_400.additional_properties = d + return get_projects_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_projects_response_401.py b/src/convoy/models/get_projects_response_401.py new file mode 100644 index 0000000..3dc25fc --- /dev/null +++ b/src/convoy/models/get_projects_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetProjectsResponse401") + + +@_attrs_define +class GetProjectsResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_projects_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_projects_response_401.additional_properties = d + return get_projects_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_projects_response_404.py b/src/convoy/models/get_projects_response_404.py new file mode 100644 index 0000000..acdd66c --- /dev/null +++ b/src/convoy/models/get_projects_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetProjectsResponse404") + + +@_attrs_define +class GetProjectsResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_projects_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_projects_response_404.additional_properties = d + return get_projects_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_source_response_200.py b/src/convoy/models/get_source_response_200.py new file mode 100644 index 0000000..9206dd2 --- /dev/null +++ b/src/convoy/models/get_source_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_source_response import ModelsSourceResponse + + +T = TypeVar("T", bound="GetSourceResponse200") + + +@_attrs_define +class GetSourceResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsSourceResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsSourceResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_source_response import ModelsSourceResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsSourceResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsSourceResponse.from_dict(_data) + + get_source_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_source_response_200.additional_properties = d + return get_source_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_source_response_400.py b/src/convoy/models/get_source_response_400.py new file mode 100644 index 0000000..2d8e3b3 --- /dev/null +++ b/src/convoy/models/get_source_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetSourceResponse400") + + +@_attrs_define +class GetSourceResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_source_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_source_response_400.additional_properties = d + return get_source_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_source_response_401.py b/src/convoy/models/get_source_response_401.py new file mode 100644 index 0000000..1000c3b --- /dev/null +++ b/src/convoy/models/get_source_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetSourceResponse401") + + +@_attrs_define +class GetSourceResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_source_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_source_response_401.additional_properties = d + return get_source_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_source_response_404.py b/src/convoy/models/get_source_response_404.py new file mode 100644 index 0000000..63f09aa --- /dev/null +++ b/src/convoy/models/get_source_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetSourceResponse404") + + +@_attrs_define +class GetSourceResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_source_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_source_response_404.additional_properties = d + return get_source_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_subscription_response_200.py b/src/convoy/models/get_subscription_response_200.py new file mode 100644 index 0000000..e447f79 --- /dev/null +++ b/src/convoy/models/get_subscription_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_subscription_response import ModelsSubscriptionResponse + + +T = TypeVar("T", bound="GetSubscriptionResponse200") + + +@_attrs_define +class GetSubscriptionResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsSubscriptionResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsSubscriptionResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_subscription_response import ModelsSubscriptionResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsSubscriptionResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsSubscriptionResponse.from_dict(_data) + + get_subscription_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_subscription_response_200.additional_properties = d + return get_subscription_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_subscription_response_400.py b/src/convoy/models/get_subscription_response_400.py new file mode 100644 index 0000000..6374071 --- /dev/null +++ b/src/convoy/models/get_subscription_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetSubscriptionResponse400") + + +@_attrs_define +class GetSubscriptionResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_subscription_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_subscription_response_400.additional_properties = d + return get_subscription_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_subscription_response_401.py b/src/convoy/models/get_subscription_response_401.py new file mode 100644 index 0000000..eb97335 --- /dev/null +++ b/src/convoy/models/get_subscription_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetSubscriptionResponse401") + + +@_attrs_define +class GetSubscriptionResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_subscription_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_subscription_response_401.additional_properties = d + return get_subscription_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_subscription_response_404.py b/src/convoy/models/get_subscription_response_404.py new file mode 100644 index 0000000..5318bb7 --- /dev/null +++ b/src/convoy/models/get_subscription_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetSubscriptionResponse404") + + +@_attrs_define +class GetSubscriptionResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_subscription_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_subscription_response_404.additional_properties = d + return get_subscription_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_subscriptions_direction.py b/src/convoy/models/get_subscriptions_direction.py new file mode 100644 index 0000000..7c8c9df --- /dev/null +++ b/src/convoy/models/get_subscriptions_direction.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class GetSubscriptionsDirection(str, Enum): + NEXT = "next" + PREV = "prev" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/get_subscriptions_response_200.py b/src/convoy/models/get_subscriptions_response_200.py new file mode 100644 index 0000000..0524bad --- /dev/null +++ b/src/convoy/models/get_subscriptions_response_200.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.get_subscriptions_response_200_data import ( + GetSubscriptionsResponse200Data, + ) + + +T = TypeVar("T", bound="GetSubscriptionsResponse200") + + +@_attrs_define +class GetSubscriptionsResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (GetSubscriptionsResponse200Data | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: GetSubscriptionsResponse200Data | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.get_subscriptions_response_200_data import ( + GetSubscriptionsResponse200Data, + ) + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: GetSubscriptionsResponse200Data | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = GetSubscriptionsResponse200Data.from_dict(_data) + + get_subscriptions_response_200 = cls( + message=message, + status=status, + data=data, + ) + + get_subscriptions_response_200.additional_properties = d + return get_subscriptions_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_subscriptions_response_200_data.py b/src/convoy/models/get_subscriptions_response_200_data.py new file mode 100644 index 0000000..b9bb33a --- /dev/null +++ b/src/convoy/models/get_subscriptions_response_200_data.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.models_subscription_response import ModelsSubscriptionResponse + + +T = TypeVar("T", bound="GetSubscriptionsResponse200Data") + + +@_attrs_define +class GetSubscriptionsResponse200Data: + """ + Attributes: + content (list[ModelsSubscriptionResponse] | Unset): + pagination (DatastorePaginationData | None | Unset): + """ + + content: list[ModelsSubscriptionResponse] | Unset = UNSET + pagination: DatastorePaginationData | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.datastore_pagination_data import DatastorePaginationData + + content: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.content, Unset): + content = [] + for content_item_data in self.content: + content_item = content_item_data.to_dict() + content.append(content_item) + + pagination: dict[str, Any] | None | Unset + if isinstance(self.pagination, Unset): + pagination = UNSET + elif isinstance(self.pagination, DatastorePaginationData): + pagination = self.pagination.to_dict() + else: + pagination = self.pagination + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if content is not UNSET: + field_dict["content"] = content + if pagination is not UNSET: + field_dict["pagination"] = pagination + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.models_subscription_response import ModelsSubscriptionResponse + + d = dict(src_dict) + _content = d.pop("content", UNSET) + content: list[ModelsSubscriptionResponse] | Unset = UNSET + if _content is not UNSET: + content = [] + for content_item_data in _content: + content_item = ModelsSubscriptionResponse.from_dict(content_item_data) + + content.append(content_item) + + def _parse_pagination(data: object) -> DatastorePaginationData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + pagination_type_1 = DatastorePaginationData.from_dict(data) + + return pagination_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DatastorePaginationData | None | Unset, data) + + pagination = _parse_pagination(d.pop("pagination", UNSET)) + + get_subscriptions_response_200_data = cls( + content=content, + pagination=pagination, + ) + + get_subscriptions_response_200_data.additional_properties = d + return get_subscriptions_response_200_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_subscriptions_response_400.py b/src/convoy/models/get_subscriptions_response_400.py new file mode 100644 index 0000000..9474fb2 --- /dev/null +++ b/src/convoy/models/get_subscriptions_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetSubscriptionsResponse400") + + +@_attrs_define +class GetSubscriptionsResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_subscriptions_response_400 = cls( + message=message, + status=status, + data=data, + ) + + get_subscriptions_response_400.additional_properties = d + return get_subscriptions_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_subscriptions_response_401.py b/src/convoy/models/get_subscriptions_response_401.py new file mode 100644 index 0000000..fc98ee8 --- /dev/null +++ b/src/convoy/models/get_subscriptions_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetSubscriptionsResponse401") + + +@_attrs_define +class GetSubscriptionsResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_subscriptions_response_401 = cls( + message=message, + status=status, + data=data, + ) + + get_subscriptions_response_401.additional_properties = d + return get_subscriptions_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/get_subscriptions_response_404.py b/src/convoy/models/get_subscriptions_response_404.py new file mode 100644 index 0000000..d8242d8 --- /dev/null +++ b/src/convoy/models/get_subscriptions_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="GetSubscriptionsResponse404") + + +@_attrs_define +class GetSubscriptionsResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + get_subscriptions_response_404 = cls( + message=message, + status=status, + data=data, + ) + + get_subscriptions_response_404.additional_properties = d + return get_subscriptions_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/handlers_stub.py b/src/convoy/models/handlers_stub.py new file mode 100644 index 0000000..eb54030 --- /dev/null +++ b/src/convoy/models/handlers_stub.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="HandlersStub") + + +@_attrs_define +class HandlersStub: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + handlers_stub = cls() + + handlers_stub.additional_properties = d + return handlers_stub + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/httpheader_http_header.py b/src/convoy/models/httpheader_http_header.py new file mode 100644 index 0000000..943bfc9 --- /dev/null +++ b/src/convoy/models/httpheader_http_header.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="HttpheaderHTTPHeader") + + +@_attrs_define +class HttpheaderHTTPHeader: + """ """ + + additional_properties: dict[str, list[str]] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + httpheader_http_header = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = cast(list[str], prop_dict) + + additional_properties[prop_name] = additional_property + + httpheader_http_header.additional_properties = additional_properties + return httpheader_http_header + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> list[str]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: list[str]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/import_open_api_spec_response_200.py b/src/convoy/models/import_open_api_spec_response_200.py new file mode 100644 index 0000000..5cd6454 --- /dev/null +++ b/src/convoy/models/import_open_api_spec_response_200.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_event_type_response import ModelsEventTypeResponse + + +T = TypeVar("T", bound="ImportOpenApiSpecResponse200") + + +@_attrs_define +class ImportOpenApiSpecResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (list[ModelsEventTypeResponse] | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: list[ModelsEventTypeResponse] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.data, Unset): + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + data.append(data_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_event_type_response import ModelsEventTypeResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: list[ModelsEventTypeResponse] | Unset = UNSET + if _data is not UNSET: + data = [] + for data_item_data in _data: + data_item = ModelsEventTypeResponse.from_dict(data_item_data) + + data.append(data_item) + + import_open_api_spec_response_200 = cls( + message=message, + status=status, + data=data, + ) + + import_open_api_spec_response_200.additional_properties = d + return import_open_api_spec_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/import_open_api_spec_response_400.py b/src/convoy/models/import_open_api_spec_response_400.py new file mode 100644 index 0000000..f3e9288 --- /dev/null +++ b/src/convoy/models/import_open_api_spec_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ImportOpenApiSpecResponse400") + + +@_attrs_define +class ImportOpenApiSpecResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + import_open_api_spec_response_400 = cls( + message=message, + status=status, + data=data, + ) + + import_open_api_spec_response_400.additional_properties = d + return import_open_api_spec_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/import_open_api_spec_response_401.py b/src/convoy/models/import_open_api_spec_response_401.py new file mode 100644 index 0000000..1f04072 --- /dev/null +++ b/src/convoy/models/import_open_api_spec_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ImportOpenApiSpecResponse401") + + +@_attrs_define +class ImportOpenApiSpecResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + import_open_api_spec_response_401 = cls( + message=message, + status=status, + data=data, + ) + + import_open_api_spec_response_401.additional_properties = d + return import_open_api_spec_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/import_open_api_spec_response_404.py b/src/convoy/models/import_open_api_spec_response_404.py new file mode 100644 index 0000000..0038e7e --- /dev/null +++ b/src/convoy/models/import_open_api_spec_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ImportOpenApiSpecResponse404") + + +@_attrs_define +class ImportOpenApiSpecResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + import_open_api_spec_response_404 = cls( + message=message, + status=status, + data=data, + ) + + import_open_api_spec_response_404.additional_properties = d + return import_open_api_spec_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/load_portal_links_paged_direction.py b/src/convoy/models/load_portal_links_paged_direction.py new file mode 100644 index 0000000..0be2089 --- /dev/null +++ b/src/convoy/models/load_portal_links_paged_direction.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class LoadPortalLinksPagedDirection(str, Enum): + NEXT = "next" + PREV = "prev" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/load_portal_links_paged_response_200.py b/src/convoy/models/load_portal_links_paged_response_200.py new file mode 100644 index 0000000..be051a1 --- /dev/null +++ b/src/convoy/models/load_portal_links_paged_response_200.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.load_portal_links_paged_response_200_data import ( + LoadPortalLinksPagedResponse200Data, + ) + + +T = TypeVar("T", bound="LoadPortalLinksPagedResponse200") + + +@_attrs_define +class LoadPortalLinksPagedResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (LoadPortalLinksPagedResponse200Data | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: LoadPortalLinksPagedResponse200Data | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.load_portal_links_paged_response_200_data import ( + LoadPortalLinksPagedResponse200Data, + ) + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: LoadPortalLinksPagedResponse200Data | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = LoadPortalLinksPagedResponse200Data.from_dict(_data) + + load_portal_links_paged_response_200 = cls( + message=message, + status=status, + data=data, + ) + + load_portal_links_paged_response_200.additional_properties = d + return load_portal_links_paged_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/load_portal_links_paged_response_200_data.py b/src/convoy/models/load_portal_links_paged_response_200_data.py new file mode 100644 index 0000000..4a1955f --- /dev/null +++ b/src/convoy/models/load_portal_links_paged_response_200_data.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.datastore_portal_link_response import DatastorePortalLinkResponse + + +T = TypeVar("T", bound="LoadPortalLinksPagedResponse200Data") + + +@_attrs_define +class LoadPortalLinksPagedResponse200Data: + """ + Attributes: + content (list[DatastorePortalLinkResponse] | Unset): + pagination (DatastorePaginationData | None | Unset): + """ + + content: list[DatastorePortalLinkResponse] | Unset = UNSET + pagination: DatastorePaginationData | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.datastore_pagination_data import DatastorePaginationData + + content: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.content, Unset): + content = [] + for content_item_data in self.content: + content_item = content_item_data.to_dict() + content.append(content_item) + + pagination: dict[str, Any] | None | Unset + if isinstance(self.pagination, Unset): + pagination = UNSET + elif isinstance(self.pagination, DatastorePaginationData): + pagination = self.pagination.to_dict() + else: + pagination = self.pagination + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if content is not UNSET: + field_dict["content"] = content + if pagination is not UNSET: + field_dict["pagination"] = pagination + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.datastore_portal_link_response import DatastorePortalLinkResponse + + d = dict(src_dict) + _content = d.pop("content", UNSET) + content: list[DatastorePortalLinkResponse] | Unset = UNSET + if _content is not UNSET: + content = [] + for content_item_data in _content: + content_item = DatastorePortalLinkResponse.from_dict(content_item_data) + + content.append(content_item) + + def _parse_pagination(data: object) -> DatastorePaginationData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + pagination_type_1 = DatastorePaginationData.from_dict(data) + + return pagination_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DatastorePaginationData | None | Unset, data) + + pagination = _parse_pagination(d.pop("pagination", UNSET)) + + load_portal_links_paged_response_200_data = cls( + content=content, + pagination=pagination, + ) + + load_portal_links_paged_response_200_data.additional_properties = d + return load_portal_links_paged_response_200_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/load_portal_links_paged_response_400.py b/src/convoy/models/load_portal_links_paged_response_400.py new file mode 100644 index 0000000..9a6cbc5 --- /dev/null +++ b/src/convoy/models/load_portal_links_paged_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="LoadPortalLinksPagedResponse400") + + +@_attrs_define +class LoadPortalLinksPagedResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + load_portal_links_paged_response_400 = cls( + message=message, + status=status, + data=data, + ) + + load_portal_links_paged_response_400.additional_properties = d + return load_portal_links_paged_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/load_portal_links_paged_response_401.py b/src/convoy/models/load_portal_links_paged_response_401.py new file mode 100644 index 0000000..ce9c800 --- /dev/null +++ b/src/convoy/models/load_portal_links_paged_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="LoadPortalLinksPagedResponse401") + + +@_attrs_define +class LoadPortalLinksPagedResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + load_portal_links_paged_response_401 = cls( + message=message, + status=status, + data=data, + ) + + load_portal_links_paged_response_401.additional_properties = d + return load_portal_links_paged_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/load_portal_links_paged_response_404.py b/src/convoy/models/load_portal_links_paged_response_404.py new file mode 100644 index 0000000..442ac14 --- /dev/null +++ b/src/convoy/models/load_portal_links_paged_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="LoadPortalLinksPagedResponse404") + + +@_attrs_define +class LoadPortalLinksPagedResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + load_portal_links_paged_response_404 = cls( + message=message, + status=status, + data=data, + ) + + load_portal_links_paged_response_404.additional_properties = d + return load_portal_links_paged_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/load_sources_paged_direction.py b/src/convoy/models/load_sources_paged_direction.py new file mode 100644 index 0000000..d47f704 --- /dev/null +++ b/src/convoy/models/load_sources_paged_direction.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class LoadSourcesPagedDirection(str, Enum): + NEXT = "next" + PREV = "prev" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/convoy/models/load_sources_paged_response_200.py b/src/convoy/models/load_sources_paged_response_200.py new file mode 100644 index 0000000..97dd841 --- /dev/null +++ b/src/convoy/models/load_sources_paged_response_200.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.load_sources_paged_response_200_data import ( + LoadSourcesPagedResponse200Data, + ) + + +T = TypeVar("T", bound="LoadSourcesPagedResponse200") + + +@_attrs_define +class LoadSourcesPagedResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (LoadSourcesPagedResponse200Data | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: LoadSourcesPagedResponse200Data | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.load_sources_paged_response_200_data import ( + LoadSourcesPagedResponse200Data, + ) + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: LoadSourcesPagedResponse200Data | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = LoadSourcesPagedResponse200Data.from_dict(_data) + + load_sources_paged_response_200 = cls( + message=message, + status=status, + data=data, + ) + + load_sources_paged_response_200.additional_properties = d + return load_sources_paged_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/load_sources_paged_response_200_data.py b/src/convoy/models/load_sources_paged_response_200_data.py new file mode 100644 index 0000000..13c13a5 --- /dev/null +++ b/src/convoy/models/load_sources_paged_response_200_data.py @@ -0,0 +1,113 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.models_source_response import ModelsSourceResponse + + +T = TypeVar("T", bound="LoadSourcesPagedResponse200Data") + + +@_attrs_define +class LoadSourcesPagedResponse200Data: + """ + Attributes: + content (list[ModelsSourceResponse] | Unset): + pagination (DatastorePaginationData | None | Unset): + """ + + content: list[ModelsSourceResponse] | Unset = UNSET + pagination: DatastorePaginationData | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.datastore_pagination_data import DatastorePaginationData + + content: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.content, Unset): + content = [] + for content_item_data in self.content: + content_item = content_item_data.to_dict() + content.append(content_item) + + pagination: dict[str, Any] | None | Unset + if isinstance(self.pagination, Unset): + pagination = UNSET + elif isinstance(self.pagination, DatastorePaginationData): + pagination = self.pagination.to_dict() + else: + pagination = self.pagination + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if content is not UNSET: + field_dict["content"] = content + if pagination is not UNSET: + field_dict["pagination"] = pagination + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_pagination_data import DatastorePaginationData + from ..models.models_source_response import ModelsSourceResponse + + d = dict(src_dict) + _content = d.pop("content", UNSET) + content: list[ModelsSourceResponse] | Unset = UNSET + if _content is not UNSET: + content = [] + for content_item_data in _content: + content_item = ModelsSourceResponse.from_dict(content_item_data) + + content.append(content_item) + + def _parse_pagination(data: object) -> DatastorePaginationData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + pagination_type_1 = DatastorePaginationData.from_dict(data) + + return pagination_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DatastorePaginationData | None | Unset, data) + + pagination = _parse_pagination(d.pop("pagination", UNSET)) + + load_sources_paged_response_200_data = cls( + content=content, + pagination=pagination, + ) + + load_sources_paged_response_200_data.additional_properties = d + return load_sources_paged_response_200_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/load_sources_paged_response_400.py b/src/convoy/models/load_sources_paged_response_400.py new file mode 100644 index 0000000..0a754ac --- /dev/null +++ b/src/convoy/models/load_sources_paged_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="LoadSourcesPagedResponse400") + + +@_attrs_define +class LoadSourcesPagedResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + load_sources_paged_response_400 = cls( + message=message, + status=status, + data=data, + ) + + load_sources_paged_response_400.additional_properties = d + return load_sources_paged_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/load_sources_paged_response_401.py b/src/convoy/models/load_sources_paged_response_401.py new file mode 100644 index 0000000..5f26ac8 --- /dev/null +++ b/src/convoy/models/load_sources_paged_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="LoadSourcesPagedResponse401") + + +@_attrs_define +class LoadSourcesPagedResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + load_sources_paged_response_401 = cls( + message=message, + status=status, + data=data, + ) + + load_sources_paged_response_401.additional_properties = d + return load_sources_paged_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/load_sources_paged_response_404.py b/src/convoy/models/load_sources_paged_response_404.py new file mode 100644 index 0000000..e09a755 --- /dev/null +++ b/src/convoy/models/load_sources_paged_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="LoadSourcesPagedResponse404") + + +@_attrs_define +class LoadSourcesPagedResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + load_sources_paged_response_404 = cls( + message=message, + status=status, + data=data, + ) + + load_sources_paged_response_404.additional_properties = d + return load_sources_paged_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_alert_configuration.py b/src/convoy/models/models_alert_configuration.py new file mode 100644 index 0000000..aa1331d --- /dev/null +++ b/src/convoy/models/models_alert_configuration.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsAlertConfiguration") + + +@_attrs_define +class ModelsAlertConfiguration: + """ + Attributes: + count (int | Unset): Count + threshold (str | Unset): Threshold + """ + + count: int | Unset = UNSET + threshold: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + threshold = self.threshold + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if count is not UNSET: + field_dict["count"] = count + if threshold is not UNSET: + field_dict["threshold"] = threshold + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + count = d.pop("count", UNSET) + + threshold = d.pop("threshold", UNSET) + + models_alert_configuration = cls( + count=count, + threshold=threshold, + ) + + models_alert_configuration.additional_properties = d + return models_alert_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_amqp_auth.py b/src/convoy/models/models_amqp_auth.py new file mode 100644 index 0000000..b18da00 --- /dev/null +++ b/src/convoy/models/models_amqp_auth.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsAmqpAuth") + + +@_attrs_define +class ModelsAmqpAuth: + """ + Attributes: + password (str | Unset): + user (str | Unset): + """ + + password: str | Unset = UNSET + user: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + password = self.password + + user = self.user + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if password is not UNSET: + field_dict["password"] = password + if user is not UNSET: + field_dict["user"] = user + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + password = d.pop("password", UNSET) + + user = d.pop("user", UNSET) + + models_amqp_auth = cls( + password=password, + user=user, + ) + + models_amqp_auth.additional_properties = d + return models_amqp_auth + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_amqp_exchange.py b/src/convoy/models/models_amqp_exchange.py new file mode 100644 index 0000000..6f0c601 --- /dev/null +++ b/src/convoy/models/models_amqp_exchange.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsAmqpExchange") + + +@_attrs_define +class ModelsAmqpExchange: + """ + Attributes: + exchange (str | Unset): + routing_key (str | Unset): + """ + + exchange: str | Unset = UNSET + routing_key: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + exchange = self.exchange + + routing_key = self.routing_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if exchange is not UNSET: + field_dict["exchange"] = exchange + if routing_key is not UNSET: + field_dict["routingKey"] = routing_key + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + exchange = d.pop("exchange", UNSET) + + routing_key = d.pop("routingKey", UNSET) + + models_amqp_exchange = cls( + exchange=exchange, + routing_key=routing_key, + ) + + models_amqp_exchange.additional_properties = d + return models_amqp_exchange + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_amqp_pub_subconfig.py b/src/convoy/models/models_amqp_pub_subconfig.py new file mode 100644 index 0000000..23de0ec --- /dev/null +++ b/src/convoy/models/models_amqp_pub_subconfig.py @@ -0,0 +1,146 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_amqp_auth import ModelsAmqpAuth + from ..models.models_amqp_exchange import ModelsAmqpExchange + + +T = TypeVar("T", bound="ModelsAmqpPubSubconfig") + + +@_attrs_define +class ModelsAmqpPubSubconfig: + """ + Attributes: + host (str | Unset): + auth (ModelsAmqpAuth | Unset): + bind_exchange (ModelsAmqpExchange | Unset): + dead_letter_exchange (str | Unset): + port (str | Unset): + queue (str | Unset): + schema (str | Unset): + vhost (str | Unset): + """ + + host: str | Unset = UNSET + auth: ModelsAmqpAuth | Unset = UNSET + bind_exchange: ModelsAmqpExchange | Unset = UNSET + dead_letter_exchange: str | Unset = UNSET + port: str | Unset = UNSET + queue: str | Unset = UNSET + schema: str | Unset = UNSET + vhost: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + host = self.host + + auth: dict[str, Any] | Unset = UNSET + if not isinstance(self.auth, Unset): + auth = self.auth.to_dict() + + bind_exchange: dict[str, Any] | Unset = UNSET + if not isinstance(self.bind_exchange, Unset): + bind_exchange = self.bind_exchange.to_dict() + + dead_letter_exchange = self.dead_letter_exchange + + port = self.port + + queue = self.queue + + schema = self.schema + + vhost = self.vhost + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if host is not UNSET: + field_dict["host"] = host + if auth is not UNSET: + field_dict["auth"] = auth + if bind_exchange is not UNSET: + field_dict["bindExchange"] = bind_exchange + if dead_letter_exchange is not UNSET: + field_dict["deadLetterExchange"] = dead_letter_exchange + if port is not UNSET: + field_dict["port"] = port + if queue is not UNSET: + field_dict["queue"] = queue + if schema is not UNSET: + field_dict["schema"] = schema + if vhost is not UNSET: + field_dict["vhost"] = vhost + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_amqp_auth import ModelsAmqpAuth + from ..models.models_amqp_exchange import ModelsAmqpExchange + + d = dict(src_dict) + host = d.pop("host", UNSET) + + _auth = d.pop("auth", UNSET) + auth: ModelsAmqpAuth | Unset + if isinstance(_auth, Unset): + auth = UNSET + else: + auth = ModelsAmqpAuth.from_dict(_auth) + + _bind_exchange = d.pop("bindExchange", UNSET) + bind_exchange: ModelsAmqpExchange | Unset + if isinstance(_bind_exchange, Unset): + bind_exchange = UNSET + else: + bind_exchange = ModelsAmqpExchange.from_dict(_bind_exchange) + + dead_letter_exchange = d.pop("deadLetterExchange", UNSET) + + port = d.pop("port", UNSET) + + queue = d.pop("queue", UNSET) + + schema = d.pop("schema", UNSET) + + vhost = d.pop("vhost", UNSET) + + models_amqp_pub_subconfig = cls( + host=host, + auth=auth, + bind_exchange=bind_exchange, + dead_letter_exchange=dead_letter_exchange, + port=port, + queue=queue, + schema=schema, + vhost=vhost, + ) + + models_amqp_pub_subconfig.additional_properties = d + return models_amqp_pub_subconfig + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_api_key.py b/src/convoy/models/models_api_key.py new file mode 100644 index 0000000..c90306f --- /dev/null +++ b/src/convoy/models/models_api_key.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsApiKey") + + +@_attrs_define +class ModelsApiKey: + """ + Attributes: + header_name (str): + header_value (str): + """ + + header_name: str + header_value: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + header_name = self.header_name + + header_value = self.header_value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "header_name": header_name, + "header_value": header_value, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + header_name = d.pop("header_name") + + header_value = d.pop("header_value") + + models_api_key = cls( + header_name=header_name, + header_value=header_value, + ) + + models_api_key.additional_properties = d + return models_api_key + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_basic_auth.py b/src/convoy/models/models_basic_auth.py new file mode 100644 index 0000000..5549d30 --- /dev/null +++ b/src/convoy/models/models_basic_auth.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsBasicAuth") + + +@_attrs_define +class ModelsBasicAuth: + """ + Attributes: + password (str): + username (str): + """ + + password: str + username: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + password = self.password + + username = self.username + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "password": password, + "username": username, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + password = d.pop("password") + + username = d.pop("username") + + models_basic_auth = cls( + password=password, + username=username, + ) + + models_basic_auth.additional_properties = d + return models_basic_auth + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_broadcast_event.py b/src/convoy/models/models_broadcast_event.py new file mode 100644 index 0000000..fa4626a --- /dev/null +++ b/src/convoy/models/models_broadcast_event.py @@ -0,0 +1,127 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_broadcast_event_custom_headers import ( + ModelsBroadcastEventCustomHeaders, + ) + from ..models.models_broadcast_event_data import ModelsBroadcastEventData + + +T = TypeVar("T", bound="ModelsBroadcastEvent") + + +@_attrs_define +class ModelsBroadcastEvent: + """ + Attributes: + acknowledged_at (str | Unset): + custom_headers (ModelsBroadcastEventCustomHeaders | Unset): Specifies custom headers you want convoy to add when + the event is dispatched to your endpoint + data (ModelsBroadcastEventData | Unset): Data is an arbitrary JSON value that gets sent as the body of the + webhook to the endpoints + event_type (str | Unset): Event Type is used for filtering and debugging e.g invoice.paid + idempotency_key (str | Unset): Specify a key for event deduplication + """ + + acknowledged_at: str | Unset = UNSET + custom_headers: ModelsBroadcastEventCustomHeaders | Unset = UNSET + data: ModelsBroadcastEventData | Unset = UNSET + event_type: str | Unset = UNSET + idempotency_key: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + acknowledged_at = self.acknowledged_at + + custom_headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.custom_headers, Unset): + custom_headers = self.custom_headers.to_dict() + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + event_type = self.event_type + + idempotency_key = self.idempotency_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if acknowledged_at is not UNSET: + field_dict["acknowledged_at"] = acknowledged_at + if custom_headers is not UNSET: + field_dict["custom_headers"] = custom_headers + if data is not UNSET: + field_dict["data"] = data + if event_type is not UNSET: + field_dict["event_type"] = event_type + if idempotency_key is not UNSET: + field_dict["idempotency_key"] = idempotency_key + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_broadcast_event_custom_headers import ( + ModelsBroadcastEventCustomHeaders, + ) + from ..models.models_broadcast_event_data import ModelsBroadcastEventData + + d = dict(src_dict) + acknowledged_at = d.pop("acknowledged_at", UNSET) + + _custom_headers = d.pop("custom_headers", UNSET) + custom_headers: ModelsBroadcastEventCustomHeaders | Unset + if isinstance(_custom_headers, Unset): + custom_headers = UNSET + else: + custom_headers = ModelsBroadcastEventCustomHeaders.from_dict( + _custom_headers + ) + + _data = d.pop("data", UNSET) + data: ModelsBroadcastEventData | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsBroadcastEventData.from_dict(_data) + + event_type = d.pop("event_type", UNSET) + + idempotency_key = d.pop("idempotency_key", UNSET) + + models_broadcast_event = cls( + acknowledged_at=acknowledged_at, + custom_headers=custom_headers, + data=data, + event_type=event_type, + idempotency_key=idempotency_key, + ) + + models_broadcast_event.additional_properties = d + return models_broadcast_event + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_broadcast_event_custom_headers.py b/src/convoy/models/models_broadcast_event_custom_headers.py new file mode 100644 index 0000000..8909131 --- /dev/null +++ b/src/convoy/models/models_broadcast_event_custom_headers.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsBroadcastEventCustomHeaders") + + +@_attrs_define +class ModelsBroadcastEventCustomHeaders: + """Specifies custom headers you want convoy to add when the event is dispatched to your endpoint""" + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_broadcast_event_custom_headers = cls() + + models_broadcast_event_custom_headers.additional_properties = d + return models_broadcast_event_custom_headers + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_broadcast_event_data.py b/src/convoy/models/models_broadcast_event_data.py new file mode 100644 index 0000000..5efe1be --- /dev/null +++ b/src/convoy/models/models_broadcast_event_data.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsBroadcastEventData") + + +@_attrs_define +class ModelsBroadcastEventData: + """Data is an arbitrary JSON value that gets sent as the body of the + webhook to the endpoints + + """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_broadcast_event_data = cls() + + models_broadcast_event_data.additional_properties = d + return models_broadcast_event_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_bulk_onboard_accepted_response.py b/src/convoy/models/models_bulk_onboard_accepted_response.py new file mode 100644 index 0000000..35d0679 --- /dev/null +++ b/src/convoy/models/models_bulk_onboard_accepted_response.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsBulkOnboardAcceptedResponse") + + +@_attrs_define +class ModelsBulkOnboardAcceptedResponse: + """ + Attributes: + batch_count (int | Unset): + message (str | Unset): + total_items (int | Unset): + """ + + batch_count: int | Unset = UNSET + message: str | Unset = UNSET + total_items: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + batch_count = self.batch_count + + message = self.message + + total_items = self.total_items + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if batch_count is not UNSET: + field_dict["batch_count"] = batch_count + if message is not UNSET: + field_dict["message"] = message + if total_items is not UNSET: + field_dict["total_items"] = total_items + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + batch_count = d.pop("batch_count", UNSET) + + message = d.pop("message", UNSET) + + total_items = d.pop("total_items", UNSET) + + models_bulk_onboard_accepted_response = cls( + batch_count=batch_count, + message=message, + total_items=total_items, + ) + + models_bulk_onboard_accepted_response.additional_properties = d + return models_bulk_onboard_accepted_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_bulk_onboard_dry_run_response.py b/src/convoy/models/models_bulk_onboard_dry_run_response.py new file mode 100644 index 0000000..9d13850 --- /dev/null +++ b/src/convoy/models/models_bulk_onboard_dry_run_response.py @@ -0,0 +1,99 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_onboard_validation_error import ModelsOnboardValidationError + + +T = TypeVar("T", bound="ModelsBulkOnboardDryRunResponse") + + +@_attrs_define +class ModelsBulkOnboardDryRunResponse: + """ + Attributes: + errors (list[ModelsOnboardValidationError] | Unset): + total_rows (int | Unset): + valid_count (int | Unset): + """ + + errors: list[ModelsOnboardValidationError] | Unset = UNSET + total_rows: int | Unset = UNSET + valid_count: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + errors: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.errors, Unset): + errors = [] + for errors_item_data in self.errors: + errors_item = errors_item_data.to_dict() + errors.append(errors_item) + + total_rows = self.total_rows + + valid_count = self.valid_count + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if errors is not UNSET: + field_dict["errors"] = errors + if total_rows is not UNSET: + field_dict["total_rows"] = total_rows + if valid_count is not UNSET: + field_dict["valid_count"] = valid_count + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_onboard_validation_error import ( + ModelsOnboardValidationError, + ) + + d = dict(src_dict) + _errors = d.pop("errors", UNSET) + errors: list[ModelsOnboardValidationError] | Unset = UNSET + if _errors is not UNSET: + errors = [] + for errors_item_data in _errors: + errors_item = ModelsOnboardValidationError.from_dict(errors_item_data) + + errors.append(errors_item) + + total_rows = d.pop("total_rows", UNSET) + + valid_count = d.pop("valid_count", UNSET) + + models_bulk_onboard_dry_run_response = cls( + errors=errors, + total_rows=total_rows, + valid_count=valid_count, + ) + + models_bulk_onboard_dry_run_response.additional_properties = d + return models_bulk_onboard_dry_run_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_bulk_onboard_request.py b/src/convoy/models/models_bulk_onboard_request.py new file mode 100644 index 0000000..ebe1af5 --- /dev/null +++ b/src/convoy/models/models_bulk_onboard_request.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_onboard_item import ModelsOnboardItem + + +T = TypeVar("T", bound="ModelsBulkOnboardRequest") + + +@_attrs_define +class ModelsBulkOnboardRequest: + """ + Attributes: + items (list[ModelsOnboardItem] | Unset): + """ + + items: list[ModelsOnboardItem] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + items: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.items, Unset): + items = [] + for items_item_data in self.items: + items_item = items_item_data.to_dict() + items.append(items_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if items is not UNSET: + field_dict["items"] = items + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_onboard_item import ModelsOnboardItem + + d = dict(src_dict) + _items = d.pop("items", UNSET) + items: list[ModelsOnboardItem] | Unset = UNSET + if _items is not UNSET: + items = [] + for items_item_data in _items: + items_item = ModelsOnboardItem.from_dict(items_item_data) + + items.append(items_item) + + models_bulk_onboard_request = cls( + items=items, + ) + + models_bulk_onboard_request.additional_properties = d + return models_bulk_onboard_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_bulk_update_filter_request.py b/src/convoy/models/models_bulk_update_filter_request.py new file mode 100644 index 0000000..9ff57f5 --- /dev/null +++ b/src/convoy/models/models_bulk_update_filter_request.py @@ -0,0 +1,182 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_bulk_update_filter_request_body import ( + ModelsBulkUpdateFilterRequestBody, + ) + from ..models.models_bulk_update_filter_request_headers import ( + ModelsBulkUpdateFilterRequestHeaders, + ) + from ..models.models_bulk_update_filter_request_path import ( + ModelsBulkUpdateFilterRequestPath, + ) + from ..models.models_bulk_update_filter_request_query import ( + ModelsBulkUpdateFilterRequestQuery, + ) + from ..models.models_optional_time import ModelsOptionalTime + + +T = TypeVar("T", bound="ModelsBulkUpdateFilterRequest") + + +@_attrs_define +class ModelsBulkUpdateFilterRequest: + """ + Attributes: + uid (str): + body (ModelsBulkUpdateFilterRequestBody | Unset): + enabled_at (ModelsOptionalTime | Unset): + event_type (str | Unset): + headers (ModelsBulkUpdateFilterRequestHeaders | Unset): + path (ModelsBulkUpdateFilterRequestPath | Unset): + query (ModelsBulkUpdateFilterRequestQuery | Unset): + """ + + uid: str + body: ModelsBulkUpdateFilterRequestBody | Unset = UNSET + enabled_at: ModelsOptionalTime | Unset = UNSET + event_type: str | Unset = UNSET + headers: ModelsBulkUpdateFilterRequestHeaders | Unset = UNSET + path: ModelsBulkUpdateFilterRequestPath | Unset = UNSET + query: ModelsBulkUpdateFilterRequestQuery | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + uid = self.uid + + body: dict[str, Any] | Unset = UNSET + if not isinstance(self.body, Unset): + body = self.body.to_dict() + + enabled_at: dict[str, Any] | Unset = UNSET + if not isinstance(self.enabled_at, Unset): + enabled_at = self.enabled_at.to_dict() + + event_type = self.event_type + + headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.headers, Unset): + headers = self.headers.to_dict() + + path: dict[str, Any] | Unset = UNSET + if not isinstance(self.path, Unset): + path = self.path.to_dict() + + query: dict[str, Any] | Unset = UNSET + if not isinstance(self.query, Unset): + query = self.query.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "uid": uid, + } + ) + if body is not UNSET: + field_dict["body"] = body + if enabled_at is not UNSET: + field_dict["enabled_at"] = enabled_at + if event_type is not UNSET: + field_dict["event_type"] = event_type + if headers is not UNSET: + field_dict["headers"] = headers + if path is not UNSET: + field_dict["path"] = path + if query is not UNSET: + field_dict["query"] = query + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_bulk_update_filter_request_body import ( + ModelsBulkUpdateFilterRequestBody, + ) + from ..models.models_bulk_update_filter_request_headers import ( + ModelsBulkUpdateFilterRequestHeaders, + ) + from ..models.models_bulk_update_filter_request_path import ( + ModelsBulkUpdateFilterRequestPath, + ) + from ..models.models_bulk_update_filter_request_query import ( + ModelsBulkUpdateFilterRequestQuery, + ) + from ..models.models_optional_time import ModelsOptionalTime + + d = dict(src_dict) + uid = d.pop("uid") + + _body = d.pop("body", UNSET) + body: ModelsBulkUpdateFilterRequestBody | Unset + if isinstance(_body, Unset): + body = UNSET + else: + body = ModelsBulkUpdateFilterRequestBody.from_dict(_body) + + _enabled_at = d.pop("enabled_at", UNSET) + enabled_at: ModelsOptionalTime | Unset + if isinstance(_enabled_at, Unset): + enabled_at = UNSET + else: + enabled_at = ModelsOptionalTime.from_dict(_enabled_at) + + event_type = d.pop("event_type", UNSET) + + _headers = d.pop("headers", UNSET) + headers: ModelsBulkUpdateFilterRequestHeaders | Unset + if isinstance(_headers, Unset): + headers = UNSET + else: + headers = ModelsBulkUpdateFilterRequestHeaders.from_dict(_headers) + + _path = d.pop("path", UNSET) + path: ModelsBulkUpdateFilterRequestPath | Unset + if isinstance(_path, Unset): + path = UNSET + else: + path = ModelsBulkUpdateFilterRequestPath.from_dict(_path) + + _query = d.pop("query", UNSET) + query: ModelsBulkUpdateFilterRequestQuery | Unset + if isinstance(_query, Unset): + query = UNSET + else: + query = ModelsBulkUpdateFilterRequestQuery.from_dict(_query) + + models_bulk_update_filter_request = cls( + uid=uid, + body=body, + enabled_at=enabled_at, + event_type=event_type, + headers=headers, + path=path, + query=query, + ) + + models_bulk_update_filter_request.additional_properties = d + return models_bulk_update_filter_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_bulk_update_filter_request_body.py b/src/convoy/models/models_bulk_update_filter_request_body.py new file mode 100644 index 0000000..4cc19b4 --- /dev/null +++ b/src/convoy/models/models_bulk_update_filter_request_body.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsBulkUpdateFilterRequestBody") + + +@_attrs_define +class ModelsBulkUpdateFilterRequestBody: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_bulk_update_filter_request_body = cls() + + models_bulk_update_filter_request_body.additional_properties = d + return models_bulk_update_filter_request_body + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_bulk_update_filter_request_headers.py b/src/convoy/models/models_bulk_update_filter_request_headers.py new file mode 100644 index 0000000..4dbf94f --- /dev/null +++ b/src/convoy/models/models_bulk_update_filter_request_headers.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsBulkUpdateFilterRequestHeaders") + + +@_attrs_define +class ModelsBulkUpdateFilterRequestHeaders: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_bulk_update_filter_request_headers = cls() + + models_bulk_update_filter_request_headers.additional_properties = d + return models_bulk_update_filter_request_headers + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_bulk_update_filter_request_path.py b/src/convoy/models/models_bulk_update_filter_request_path.py new file mode 100644 index 0000000..f06900c --- /dev/null +++ b/src/convoy/models/models_bulk_update_filter_request_path.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsBulkUpdateFilterRequestPath") + + +@_attrs_define +class ModelsBulkUpdateFilterRequestPath: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_bulk_update_filter_request_path = cls() + + models_bulk_update_filter_request_path.additional_properties = d + return models_bulk_update_filter_request_path + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_bulk_update_filter_request_query.py b/src/convoy/models/models_bulk_update_filter_request_query.py new file mode 100644 index 0000000..f5df597 --- /dev/null +++ b/src/convoy/models/models_bulk_update_filter_request_query.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsBulkUpdateFilterRequestQuery") + + +@_attrs_define +class ModelsBulkUpdateFilterRequestQuery: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_bulk_update_filter_request_query = cls() + + models_bulk_update_filter_request_query.additional_properties = d + return models_bulk_update_filter_request_query + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_count_response.py b/src/convoy/models/models_count_response.py new file mode 100644 index 0000000..0b62b02 --- /dev/null +++ b/src/convoy/models/models_count_response.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsCountResponse") + + +@_attrs_define +class ModelsCountResponse: + """ + Attributes: + num (int | Unset): + """ + + num: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + num = self.num + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if num is not UNSET: + field_dict["num"] = num + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + num = d.pop("num", UNSET) + + models_count_response = cls( + num=num, + ) + + models_count_response.additional_properties = d + return models_count_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_create_endpoint.py b/src/convoy/models/models_create_endpoint.py new file mode 100644 index 0000000..684a6ba --- /dev/null +++ b/src/convoy/models/models_create_endpoint.py @@ -0,0 +1,227 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_endpoint_authentication import ModelsEndpointAuthentication + from ..models.models_mtls_client_cert import ModelsMtlsClientCert + + +T = TypeVar("T", bound="ModelsCreateEndpoint") + + +@_attrs_define +class ModelsCreateEndpoint: + """ + Attributes: + advanced_signatures (bool | Unset): Convoy supports two [signature formats](https://getconvoy.io/docs/product- + manual/signatures) + -- simple or advanced. If left unspecified, we default to false. + app_id (str | Unset): Deprecated but necessary for backward compatibility + authentication (ModelsEndpointAuthentication | Unset): + content_type (str | Unset): Content type for the endpoint. Defaults to application/json if not specified. + description (str | Unset): Human-readable description of the endpoint. Think of this as metadata describing + the endpoint + http_timeout (int | Unset): Define endpoint http timeout in seconds. + is_disabled (bool | Unset): This is used to manually enable/disable the endpoint. + mtls_client_cert (ModelsMtlsClientCert | Unset): + name (str | Unset): Endpoint name. + owner_id (str | Unset): The OwnerID is used to group more than one endpoint together to achieve + [fanout](https://getconvoy.io/docs/manual/endpoints#Endpoint%20Owner%20ID) + rate_limit (int | Unset): Rate limit is the total number of requests to be sent to an endpoint in + the time duration specified in RateLimitDuration + rate_limit_duration (int | Unset): Rate limit duration specifies the time range for the rate limit. + secret (str | Unset): Endpoint's webhook secret. If not provided, Convoy autogenerates one for the endpoint. + slack_webhook_url (str | Unset): Slack webhook URL is an alternative method to support email where endpoint + developers + can receive failure notifications on a slack channel. + support_email (str | Unset): Endpoint developers support email. This is used for communicating endpoint state + changes. You should always turn this on when disabling endpoints are enabled. + url (str | Unset): URL is the endpoint's URL prefixed with https. non-https urls are currently + not supported. + """ + + advanced_signatures: bool | Unset = UNSET + app_id: str | Unset = UNSET + authentication: ModelsEndpointAuthentication | Unset = UNSET + content_type: str | Unset = UNSET + description: str | Unset = UNSET + http_timeout: int | Unset = UNSET + is_disabled: bool | Unset = UNSET + mtls_client_cert: ModelsMtlsClientCert | Unset = UNSET + name: str | Unset = UNSET + owner_id: str | Unset = UNSET + rate_limit: int | Unset = UNSET + rate_limit_duration: int | Unset = UNSET + secret: str | Unset = UNSET + slack_webhook_url: str | Unset = UNSET + support_email: str | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + advanced_signatures = self.advanced_signatures + + app_id = self.app_id + + authentication: dict[str, Any] | Unset = UNSET + if not isinstance(self.authentication, Unset): + authentication = self.authentication.to_dict() + + content_type = self.content_type + + description = self.description + + http_timeout = self.http_timeout + + is_disabled = self.is_disabled + + mtls_client_cert: dict[str, Any] | Unset = UNSET + if not isinstance(self.mtls_client_cert, Unset): + mtls_client_cert = self.mtls_client_cert.to_dict() + + name = self.name + + owner_id = self.owner_id + + rate_limit = self.rate_limit + + rate_limit_duration = self.rate_limit_duration + + secret = self.secret + + slack_webhook_url = self.slack_webhook_url + + support_email = self.support_email + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if advanced_signatures is not UNSET: + field_dict["advanced_signatures"] = advanced_signatures + if app_id is not UNSET: + field_dict["appID"] = app_id + if authentication is not UNSET: + field_dict["authentication"] = authentication + if content_type is not UNSET: + field_dict["content_type"] = content_type + if description is not UNSET: + field_dict["description"] = description + if http_timeout is not UNSET: + field_dict["http_timeout"] = http_timeout + if is_disabled is not UNSET: + field_dict["is_disabled"] = is_disabled + if mtls_client_cert is not UNSET: + field_dict["mtls_client_cert"] = mtls_client_cert + if name is not UNSET: + field_dict["name"] = name + if owner_id is not UNSET: + field_dict["owner_id"] = owner_id + if rate_limit is not UNSET: + field_dict["rate_limit"] = rate_limit + if rate_limit_duration is not UNSET: + field_dict["rate_limit_duration"] = rate_limit_duration + if secret is not UNSET: + field_dict["secret"] = secret + if slack_webhook_url is not UNSET: + field_dict["slack_webhook_url"] = slack_webhook_url + if support_email is not UNSET: + field_dict["support_email"] = support_email + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_endpoint_authentication import ModelsEndpointAuthentication + from ..models.models_mtls_client_cert import ModelsMtlsClientCert + + d = dict(src_dict) + advanced_signatures = d.pop("advanced_signatures", UNSET) + + app_id = d.pop("appID", UNSET) + + _authentication = d.pop("authentication", UNSET) + authentication: ModelsEndpointAuthentication | Unset + if isinstance(_authentication, Unset): + authentication = UNSET + else: + authentication = ModelsEndpointAuthentication.from_dict(_authentication) + + content_type = d.pop("content_type", UNSET) + + description = d.pop("description", UNSET) + + http_timeout = d.pop("http_timeout", UNSET) + + is_disabled = d.pop("is_disabled", UNSET) + + _mtls_client_cert = d.pop("mtls_client_cert", UNSET) + mtls_client_cert: ModelsMtlsClientCert | Unset + if isinstance(_mtls_client_cert, Unset): + mtls_client_cert = UNSET + else: + mtls_client_cert = ModelsMtlsClientCert.from_dict(_mtls_client_cert) + + name = d.pop("name", UNSET) + + owner_id = d.pop("owner_id", UNSET) + + rate_limit = d.pop("rate_limit", UNSET) + + rate_limit_duration = d.pop("rate_limit_duration", UNSET) + + secret = d.pop("secret", UNSET) + + slack_webhook_url = d.pop("slack_webhook_url", UNSET) + + support_email = d.pop("support_email", UNSET) + + url = d.pop("url", UNSET) + + models_create_endpoint = cls( + advanced_signatures=advanced_signatures, + app_id=app_id, + authentication=authentication, + content_type=content_type, + description=description, + http_timeout=http_timeout, + is_disabled=is_disabled, + mtls_client_cert=mtls_client_cert, + name=name, + owner_id=owner_id, + rate_limit=rate_limit, + rate_limit_duration=rate_limit_duration, + secret=secret, + slack_webhook_url=slack_webhook_url, + support_email=support_email, + url=url, + ) + + models_create_endpoint.additional_properties = d + return models_create_endpoint + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_create_event.py b/src/convoy/models/models_create_event.py new file mode 100644 index 0000000..f0b2938 --- /dev/null +++ b/src/convoy/models/models_create_event.py @@ -0,0 +1,134 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_create_event_custom_headers import ( + ModelsCreateEventCustomHeaders, + ) + from ..models.models_create_event_data import ModelsCreateEventData + + +T = TypeVar("T", bound="ModelsCreateEvent") + + +@_attrs_define +class ModelsCreateEvent: + """ + Attributes: + app_id (str | Unset): Deprecated but necessary for backward compatibility. + custom_headers (ModelsCreateEventCustomHeaders | Unset): Specifies custom headers you want convoy to add when + the event is dispatched to your endpoint + data (ModelsCreateEventData | Unset): Data is an arbitrary JSON value that gets sent as the body of the + webhook to the endpoints + endpoint_id (str | Unset): Specifies the endpoint to send this event to. + event_type (str | Unset): Event Type is used for filtering and debugging e.g invoice.paid + idempotency_key (str | Unset): Specify a key for event deduplication + """ + + app_id: str | Unset = UNSET + custom_headers: ModelsCreateEventCustomHeaders | Unset = UNSET + data: ModelsCreateEventData | Unset = UNSET + endpoint_id: str | Unset = UNSET + event_type: str | Unset = UNSET + idempotency_key: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + app_id = self.app_id + + custom_headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.custom_headers, Unset): + custom_headers = self.custom_headers.to_dict() + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + endpoint_id = self.endpoint_id + + event_type = self.event_type + + idempotency_key = self.idempotency_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if app_id is not UNSET: + field_dict["app_id"] = app_id + if custom_headers is not UNSET: + field_dict["custom_headers"] = custom_headers + if data is not UNSET: + field_dict["data"] = data + if endpoint_id is not UNSET: + field_dict["endpoint_id"] = endpoint_id + if event_type is not UNSET: + field_dict["event_type"] = event_type + if idempotency_key is not UNSET: + field_dict["idempotency_key"] = idempotency_key + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_create_event_custom_headers import ( + ModelsCreateEventCustomHeaders, + ) + from ..models.models_create_event_data import ModelsCreateEventData + + d = dict(src_dict) + app_id = d.pop("app_id", UNSET) + + _custom_headers = d.pop("custom_headers", UNSET) + custom_headers: ModelsCreateEventCustomHeaders | Unset + if isinstance(_custom_headers, Unset): + custom_headers = UNSET + else: + custom_headers = ModelsCreateEventCustomHeaders.from_dict(_custom_headers) + + _data = d.pop("data", UNSET) + data: ModelsCreateEventData | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsCreateEventData.from_dict(_data) + + endpoint_id = d.pop("endpoint_id", UNSET) + + event_type = d.pop("event_type", UNSET) + + idempotency_key = d.pop("idempotency_key", UNSET) + + models_create_event = cls( + app_id=app_id, + custom_headers=custom_headers, + data=data, + endpoint_id=endpoint_id, + event_type=event_type, + idempotency_key=idempotency_key, + ) + + models_create_event.additional_properties = d + return models_create_event + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_create_event_custom_headers.py b/src/convoy/models/models_create_event_custom_headers.py new file mode 100644 index 0000000..aaef901 --- /dev/null +++ b/src/convoy/models/models_create_event_custom_headers.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsCreateEventCustomHeaders") + + +@_attrs_define +class ModelsCreateEventCustomHeaders: + """Specifies custom headers you want convoy to add when the event is dispatched to your endpoint""" + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_create_event_custom_headers = cls() + + models_create_event_custom_headers.additional_properties = d + return models_create_event_custom_headers + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_create_event_data.py b/src/convoy/models/models_create_event_data.py new file mode 100644 index 0000000..533d815 --- /dev/null +++ b/src/convoy/models/models_create_event_data.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsCreateEventData") + + +@_attrs_define +class ModelsCreateEventData: + """Data is an arbitrary JSON value that gets sent as the body of the + webhook to the endpoints + + """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_create_event_data = cls() + + models_create_event_data.additional_properties = d + return models_create_event_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_create_event_type.py b/src/convoy/models/models_create_event_type.py new file mode 100644 index 0000000..d730b15 --- /dev/null +++ b/src/convoy/models/models_create_event_type.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_create_event_type_json_schema import ( + ModelsCreateEventTypeJsonSchema, + ) + + +T = TypeVar("T", bound="ModelsCreateEventType") + + +@_attrs_define +class ModelsCreateEventType: + """ + Attributes: + category (str | Unset): Category is a product-specific grouping for the event type + description (str | Unset): Description is used to describe what the event type does + json_schema (ModelsCreateEventTypeJsonSchema | Unset): JSONSchema is the JSON structure of the event type + name (str | Unset): Name is the event type name. E.g., invoice.created + """ + + category: str | Unset = UNSET + description: str | Unset = UNSET + json_schema: ModelsCreateEventTypeJsonSchema | Unset = UNSET + name: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + category = self.category + + description = self.description + + json_schema: dict[str, Any] | Unset = UNSET + if not isinstance(self.json_schema, Unset): + json_schema = self.json_schema.to_dict() + + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if category is not UNSET: + field_dict["category"] = category + if description is not UNSET: + field_dict["description"] = description + if json_schema is not UNSET: + field_dict["json_schema"] = json_schema + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_create_event_type_json_schema import ( + ModelsCreateEventTypeJsonSchema, + ) + + d = dict(src_dict) + category = d.pop("category", UNSET) + + description = d.pop("description", UNSET) + + _json_schema = d.pop("json_schema", UNSET) + json_schema: ModelsCreateEventTypeJsonSchema | Unset + if isinstance(_json_schema, Unset): + json_schema = UNSET + else: + json_schema = ModelsCreateEventTypeJsonSchema.from_dict(_json_schema) + + name = d.pop("name", UNSET) + + models_create_event_type = cls( + category=category, + description=description, + json_schema=json_schema, + name=name, + ) + + models_create_event_type.additional_properties = d + return models_create_event_type + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_create_event_type_json_schema.py b/src/convoy/models/models_create_event_type_json_schema.py new file mode 100644 index 0000000..4847dfe --- /dev/null +++ b/src/convoy/models/models_create_event_type_json_schema.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsCreateEventTypeJsonSchema") + + +@_attrs_define +class ModelsCreateEventTypeJsonSchema: + """JSONSchema is the JSON structure of the event type""" + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_create_event_type_json_schema = cls() + + models_create_event_type_json_schema.additional_properties = d + return models_create_event_type_json_schema + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_create_filter_request.py b/src/convoy/models/models_create_filter_request.py new file mode 100644 index 0000000..709dc08 --- /dev/null +++ b/src/convoy/models/models_create_filter_request.py @@ -0,0 +1,151 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_m import DatastoreM + from ..models.models_optional_time import ModelsOptionalTime + + +T = TypeVar("T", bound="ModelsCreateFilterRequest") + + +@_attrs_define +class ModelsCreateFilterRequest: + """ + Attributes: + event_type (str): Type of event this filter applies to (required) + body (DatastoreM | Unset): + enabled_at (ModelsOptionalTime | Unset): + headers (DatastoreM | Unset): + path (DatastoreM | Unset): + query (DatastoreM | Unset): + """ + + event_type: str + body: DatastoreM | Unset = UNSET + enabled_at: ModelsOptionalTime | Unset = UNSET + headers: DatastoreM | Unset = UNSET + path: DatastoreM | Unset = UNSET + query: DatastoreM | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event_type = self.event_type + + body: dict[str, Any] | Unset = UNSET + if not isinstance(self.body, Unset): + body = self.body.to_dict() + + enabled_at: dict[str, Any] | Unset = UNSET + if not isinstance(self.enabled_at, Unset): + enabled_at = self.enabled_at.to_dict() + + headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.headers, Unset): + headers = self.headers.to_dict() + + path: dict[str, Any] | Unset = UNSET + if not isinstance(self.path, Unset): + path = self.path.to_dict() + + query: dict[str, Any] | Unset = UNSET + if not isinstance(self.query, Unset): + query = self.query.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "event_type": event_type, + } + ) + if body is not UNSET: + field_dict["body"] = body + if enabled_at is not UNSET: + field_dict["enabled_at"] = enabled_at + if headers is not UNSET: + field_dict["headers"] = headers + if path is not UNSET: + field_dict["path"] = path + if query is not UNSET: + field_dict["query"] = query + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_m import DatastoreM + from ..models.models_optional_time import ModelsOptionalTime + + d = dict(src_dict) + event_type = d.pop("event_type") + + _body = d.pop("body", UNSET) + body: DatastoreM | Unset + if isinstance(_body, Unset): + body = UNSET + else: + body = DatastoreM.from_dict(_body) + + _enabled_at = d.pop("enabled_at", UNSET) + enabled_at: ModelsOptionalTime | Unset + if isinstance(_enabled_at, Unset): + enabled_at = UNSET + else: + enabled_at = ModelsOptionalTime.from_dict(_enabled_at) + + _headers = d.pop("headers", UNSET) + headers: DatastoreM | Unset + if isinstance(_headers, Unset): + headers = UNSET + else: + headers = DatastoreM.from_dict(_headers) + + _path = d.pop("path", UNSET) + path: DatastoreM | Unset + if isinstance(_path, Unset): + path = UNSET + else: + path = DatastoreM.from_dict(_path) + + _query = d.pop("query", UNSET) + query: DatastoreM | Unset + if isinstance(_query, Unset): + query = UNSET + else: + query = DatastoreM.from_dict(_query) + + models_create_filter_request = cls( + event_type=event_type, + body=body, + enabled_at=enabled_at, + headers=headers, + path=path, + query=query, + ) + + models_create_filter_request.additional_properties = d + return models_create_filter_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_create_project.py b/src/convoy/models/models_create_project.py new file mode 100644 index 0000000..67734e9 --- /dev/null +++ b/src/convoy/models/models_create_project.py @@ -0,0 +1,101 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_project_config import ModelsProjectConfig + + +T = TypeVar("T", bound="ModelsCreateProject") + + +@_attrs_define +class ModelsCreateProject: + """ + Attributes: + config (ModelsProjectConfig | Unset): + logo_url (str | Unset): + name (str | Unset): Project Name + type_ (str | Unset): Project Type, supported values are `outgoing`, `incoming` + """ + + config: ModelsProjectConfig | Unset = UNSET + logo_url: str | Unset = UNSET + name: str | Unset = UNSET + type_: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + config: dict[str, Any] | Unset = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + logo_url = self.logo_url + + name = self.name + + type_ = self.type_ + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if config is not UNSET: + field_dict["config"] = config + if logo_url is not UNSET: + field_dict["logo_url"] = logo_url + if name is not UNSET: + field_dict["name"] = name + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_project_config import ModelsProjectConfig + + d = dict(src_dict) + _config = d.pop("config", UNSET) + config: ModelsProjectConfig | Unset + if isinstance(_config, Unset): + config = UNSET + else: + config = ModelsProjectConfig.from_dict(_config) + + logo_url = d.pop("logo_url", UNSET) + + name = d.pop("name", UNSET) + + type_ = d.pop("type", UNSET) + + models_create_project = cls( + config=config, + logo_url=logo_url, + name=name, + type_=type_, + ) + + models_create_project.additional_properties = d + return models_create_project + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_create_project_response.py b/src/convoy/models/models_create_project_response.py new file mode 100644 index 0000000..59d0443 --- /dev/null +++ b/src/convoy/models/models_create_project_response.py @@ -0,0 +1,124 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_api_key_response import DatastoreAPIKeyResponse + from ..models.models_project_response import ModelsProjectResponse + + +T = TypeVar("T", bound="ModelsCreateProjectResponse") + + +@_attrs_define +class ModelsCreateProjectResponse: + """ + Attributes: + api_key (DatastoreAPIKeyResponse | None | Unset): + project (ModelsProjectResponse | None | Unset): + """ + + api_key: DatastoreAPIKeyResponse | None | Unset = UNSET + project: ModelsProjectResponse | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.datastore_api_key_response import DatastoreAPIKeyResponse + from ..models.models_project_response import ModelsProjectResponse + + api_key: dict[str, Any] | None | Unset + if isinstance(self.api_key, Unset): + api_key = UNSET + elif isinstance(self.api_key, DatastoreAPIKeyResponse): + api_key = self.api_key.to_dict() + else: + api_key = self.api_key + + project: dict[str, Any] | None | Unset + if isinstance(self.project, Unset): + project = UNSET + elif isinstance(self.project, ModelsProjectResponse): + project = self.project.to_dict() + else: + project = self.project + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if api_key is not UNSET: + field_dict["api_key"] = api_key + if project is not UNSET: + field_dict["project"] = project + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_api_key_response import DatastoreAPIKeyResponse + from ..models.models_project_response import ModelsProjectResponse + + d = dict(src_dict) + + def _parse_api_key(data: object) -> DatastoreAPIKeyResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + api_key_type_1 = DatastoreAPIKeyResponse.from_dict(data) + + return api_key_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DatastoreAPIKeyResponse | None | Unset, data) + + api_key = _parse_api_key(d.pop("api_key", UNSET)) + + def _parse_project(data: object) -> ModelsProjectResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + project_type_1 = ModelsProjectResponse.from_dict(data) + + return project_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ModelsProjectResponse | None | Unset, data) + + project = _parse_project(d.pop("project", UNSET)) + + models_create_project_response = cls( + api_key=api_key, + project=project, + ) + + models_create_project_response.additional_properties = d + return models_create_project_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_create_source.py b/src/convoy/models/models_create_source.py new file mode 100644 index 0000000..d104f2c --- /dev/null +++ b/src/convoy/models/models_create_source.py @@ -0,0 +1,195 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_source_provider import DatastoreSourceProvider +from ..models.datastore_source_type import DatastoreSourceType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_custom_response import ModelsCustomResponse + from ..models.models_pub_sub_config import ModelsPubSubConfig + from ..models.models_verifier_config import ModelsVerifierConfig + + +T = TypeVar("T", bound="ModelsCreateSource") + + +@_attrs_define +class ModelsCreateSource: + """ + Attributes: + body_function (str | Unset): Function is a javascript function used to mutate the payload + immediately after ingesting an event + custom_response (ModelsCustomResponse | Unset): + event_type_location (str | Unset): EventTypeLocation is used to specify where Convoy should read the event type + from an incoming webhook request. + header_function (str | Unset): Function is a javascript function used to mutate the headers + immediately after ingesting an event + idempotency_keys (list[str] | Unset): IdempotencyKeys are used to specify parts of a webhook request to uniquely + identify the event in an incoming webhooks project. + name (str | Unset): Source name. + provider (DatastoreSourceProvider | Unset): + pub_sub (ModelsPubSubConfig | Unset): + type_ (DatastoreSourceType | Unset): + verifier (ModelsVerifierConfig | Unset): + """ + + body_function: str | Unset = UNSET + custom_response: ModelsCustomResponse | Unset = UNSET + event_type_location: str | Unset = UNSET + header_function: str | Unset = UNSET + idempotency_keys: list[str] | Unset = UNSET + name: str | Unset = UNSET + provider: DatastoreSourceProvider | Unset = UNSET + pub_sub: ModelsPubSubConfig | Unset = UNSET + type_: DatastoreSourceType | Unset = UNSET + verifier: ModelsVerifierConfig | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + body_function = self.body_function + + custom_response: dict[str, Any] | Unset = UNSET + if not isinstance(self.custom_response, Unset): + custom_response = self.custom_response.to_dict() + + event_type_location = self.event_type_location + + header_function = self.header_function + + idempotency_keys: list[str] | Unset = UNSET + if not isinstance(self.idempotency_keys, Unset): + idempotency_keys = self.idempotency_keys + + name = self.name + + provider: str | Unset = UNSET + if not isinstance(self.provider, Unset): + provider = self.provider.value + + pub_sub: dict[str, Any] | Unset = UNSET + if not isinstance(self.pub_sub, Unset): + pub_sub = self.pub_sub.to_dict() + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + verifier: dict[str, Any] | Unset = UNSET + if not isinstance(self.verifier, Unset): + verifier = self.verifier.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if body_function is not UNSET: + field_dict["body_function"] = body_function + if custom_response is not UNSET: + field_dict["custom_response"] = custom_response + if event_type_location is not UNSET: + field_dict["event_type_location"] = event_type_location + if header_function is not UNSET: + field_dict["header_function"] = header_function + if idempotency_keys is not UNSET: + field_dict["idempotency_keys"] = idempotency_keys + if name is not UNSET: + field_dict["name"] = name + if provider is not UNSET: + field_dict["provider"] = provider + if pub_sub is not UNSET: + field_dict["pub_sub"] = pub_sub + if type_ is not UNSET: + field_dict["type"] = type_ + if verifier is not UNSET: + field_dict["verifier"] = verifier + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_custom_response import ModelsCustomResponse + from ..models.models_pub_sub_config import ModelsPubSubConfig + from ..models.models_verifier_config import ModelsVerifierConfig + + d = dict(src_dict) + body_function = d.pop("body_function", UNSET) + + _custom_response = d.pop("custom_response", UNSET) + custom_response: ModelsCustomResponse | Unset + if isinstance(_custom_response, Unset): + custom_response = UNSET + else: + custom_response = ModelsCustomResponse.from_dict(_custom_response) + + event_type_location = d.pop("event_type_location", UNSET) + + header_function = d.pop("header_function", UNSET) + + idempotency_keys = cast(list[str], d.pop("idempotency_keys", UNSET)) + + name = d.pop("name", UNSET) + + _provider = d.pop("provider", UNSET) + provider: DatastoreSourceProvider | Unset + if isinstance(_provider, Unset): + provider = UNSET + else: + provider = DatastoreSourceProvider(_provider) + + _pub_sub = d.pop("pub_sub", UNSET) + pub_sub: ModelsPubSubConfig | Unset + if isinstance(_pub_sub, Unset): + pub_sub = UNSET + else: + pub_sub = ModelsPubSubConfig.from_dict(_pub_sub) + + _type_ = d.pop("type", UNSET) + type_: DatastoreSourceType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastoreSourceType(_type_) + + _verifier = d.pop("verifier", UNSET) + verifier: ModelsVerifierConfig | Unset + if isinstance(_verifier, Unset): + verifier = UNSET + else: + verifier = ModelsVerifierConfig.from_dict(_verifier) + + models_create_source = cls( + body_function=body_function, + custom_response=custom_response, + event_type_location=event_type_location, + header_function=header_function, + idempotency_keys=idempotency_keys, + name=name, + provider=provider, + pub_sub=pub_sub, + type_=type_, + verifier=verifier, + ) + + models_create_source.additional_properties = d + return models_create_source + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_create_subscription.py b/src/convoy/models/models_create_subscription.py new file mode 100644 index 0000000..bf4bb74 --- /dev/null +++ b/src/convoy/models/models_create_subscription.py @@ -0,0 +1,178 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_delivery_mode import DatastoreDeliveryMode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_alert_configuration import ModelsAlertConfiguration + from ..models.models_filter_configuration import ModelsFilterConfiguration + from ..models.models_rate_limit_configuration import ModelsRateLimitConfiguration + + +T = TypeVar("T", bound="ModelsCreateSubscription") + + +@_attrs_define +class ModelsCreateSubscription: + """ + Attributes: + alert_config (ModelsAlertConfiguration | Unset): + app_id (str | Unset): Deprecated but necessary for backward compatibility + delivery_mode (DatastoreDeliveryMode | Unset): + endpoint_id (str | Unset): Destination endpoint ID + filter_config (ModelsFilterConfiguration | Unset): + function (str | Unset): Convoy supports mutating your request payload using a js function. Use this field + to specify a `transform` function for this purpose. See this[https://docs.getconvoy.io/product- + manual/subscriptions#functions] for more + name (str | Unset): Subscription Nme + rate_limit_config (ModelsRateLimitConfiguration | Unset): + source_id (str | Unset): Source Id + """ + + alert_config: ModelsAlertConfiguration | Unset = UNSET + app_id: str | Unset = UNSET + delivery_mode: DatastoreDeliveryMode | Unset = UNSET + endpoint_id: str | Unset = UNSET + filter_config: ModelsFilterConfiguration | Unset = UNSET + function: str | Unset = UNSET + name: str | Unset = UNSET + rate_limit_config: ModelsRateLimitConfiguration | Unset = UNSET + source_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + alert_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.alert_config, Unset): + alert_config = self.alert_config.to_dict() + + app_id = self.app_id + + delivery_mode: str | Unset = UNSET + if not isinstance(self.delivery_mode, Unset): + delivery_mode = self.delivery_mode.value + + endpoint_id = self.endpoint_id + + filter_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.filter_config, Unset): + filter_config = self.filter_config.to_dict() + + function = self.function + + name = self.name + + rate_limit_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.rate_limit_config, Unset): + rate_limit_config = self.rate_limit_config.to_dict() + + source_id = self.source_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if alert_config is not UNSET: + field_dict["alert_config"] = alert_config + if app_id is not UNSET: + field_dict["app_id"] = app_id + if delivery_mode is not UNSET: + field_dict["delivery_mode"] = delivery_mode + if endpoint_id is not UNSET: + field_dict["endpoint_id"] = endpoint_id + if filter_config is not UNSET: + field_dict["filter_config"] = filter_config + if function is not UNSET: + field_dict["function"] = function + if name is not UNSET: + field_dict["name"] = name + if rate_limit_config is not UNSET: + field_dict["rate_limit_config"] = rate_limit_config + if source_id is not UNSET: + field_dict["source_id"] = source_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_alert_configuration import ModelsAlertConfiguration + from ..models.models_filter_configuration import ModelsFilterConfiguration + from ..models.models_rate_limit_configuration import ( + ModelsRateLimitConfiguration, + ) + + d = dict(src_dict) + _alert_config = d.pop("alert_config", UNSET) + alert_config: ModelsAlertConfiguration | Unset + if isinstance(_alert_config, Unset): + alert_config = UNSET + else: + alert_config = ModelsAlertConfiguration.from_dict(_alert_config) + + app_id = d.pop("app_id", UNSET) + + _delivery_mode = d.pop("delivery_mode", UNSET) + delivery_mode: DatastoreDeliveryMode | Unset + if isinstance(_delivery_mode, Unset): + delivery_mode = UNSET + else: + delivery_mode = DatastoreDeliveryMode(_delivery_mode) + + endpoint_id = d.pop("endpoint_id", UNSET) + + _filter_config = d.pop("filter_config", UNSET) + filter_config: ModelsFilterConfiguration | Unset + if isinstance(_filter_config, Unset): + filter_config = UNSET + else: + filter_config = ModelsFilterConfiguration.from_dict(_filter_config) + + function = d.pop("function", UNSET) + + name = d.pop("name", UNSET) + + _rate_limit_config = d.pop("rate_limit_config", UNSET) + rate_limit_config: ModelsRateLimitConfiguration | Unset + if isinstance(_rate_limit_config, Unset): + rate_limit_config = UNSET + else: + rate_limit_config = ModelsRateLimitConfiguration.from_dict( + _rate_limit_config + ) + + source_id = d.pop("source_id", UNSET) + + models_create_subscription = cls( + alert_config=alert_config, + app_id=app_id, + delivery_mode=delivery_mode, + endpoint_id=endpoint_id, + filter_config=filter_config, + function=function, + name=name, + rate_limit_config=rate_limit_config, + source_id=source_id, + ) + + models_create_subscription.additional_properties = d + return models_create_subscription + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_custom_response.py b/src/convoy/models/models_custom_response.py new file mode 100644 index 0000000..60a7920 --- /dev/null +++ b/src/convoy/models/models_custom_response.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsCustomResponse") + + +@_attrs_define +class ModelsCustomResponse: + """ + Attributes: + body (str | Unset): + content_type (str | Unset): + """ + + body: str | Unset = UNSET + content_type: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + body = self.body + + content_type = self.content_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if body is not UNSET: + field_dict["body"] = body + if content_type is not UNSET: + field_dict["content_type"] = content_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + body = d.pop("body", UNSET) + + content_type = d.pop("content_type", UNSET) + + models_custom_response = cls( + body=body, + content_type=content_type, + ) + + models_custom_response.additional_properties = d + return models_custom_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_dynamic_event.py b/src/convoy/models/models_dynamic_event.py new file mode 100644 index 0000000..2ebad00 --- /dev/null +++ b/src/convoy/models/models_dynamic_event.py @@ -0,0 +1,146 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_dynamic_event_custom_headers import ( + ModelsDynamicEventCustomHeaders, + ) + from ..models.models_dynamic_event_data import ModelsDynamicEventData + + +T = TypeVar("T", bound="ModelsDynamicEvent") + + +@_attrs_define +class ModelsDynamicEvent: + """ + Attributes: + custom_headers (ModelsDynamicEventCustomHeaders | Unset): Specifies custom headers you want convoy to add when + the event is dispatched to your endpoint + data (ModelsDynamicEventData | Unset): Data is an arbitrary JSON value that gets sent as the body of the + webhook to the endpoints + event_type (str | Unset): Event Type is used for filtering and debugging e.g invoice.paid + event_types (list[str] | Unset): A list of event types for the subscription filter config + idempotency_key (str | Unset): Specify a key for event deduplication + secret (str | Unset): Endpoint's webhook secret. If not provided, Convoy autogenerates one for the endpoint. + url (str | Unset): URL is the endpoint's URL prefixed with https. non-https urls are currently + not supported. + """ + + custom_headers: ModelsDynamicEventCustomHeaders | Unset = UNSET + data: ModelsDynamicEventData | Unset = UNSET + event_type: str | Unset = UNSET + event_types: list[str] | Unset = UNSET + idempotency_key: str | Unset = UNSET + secret: str | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + custom_headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.custom_headers, Unset): + custom_headers = self.custom_headers.to_dict() + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + event_type = self.event_type + + event_types: list[str] | Unset = UNSET + if not isinstance(self.event_types, Unset): + event_types = self.event_types + + idempotency_key = self.idempotency_key + + secret = self.secret + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if custom_headers is not UNSET: + field_dict["custom_headers"] = custom_headers + if data is not UNSET: + field_dict["data"] = data + if event_type is not UNSET: + field_dict["event_type"] = event_type + if event_types is not UNSET: + field_dict["event_types"] = event_types + if idempotency_key is not UNSET: + field_dict["idempotency_key"] = idempotency_key + if secret is not UNSET: + field_dict["secret"] = secret + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_dynamic_event_custom_headers import ( + ModelsDynamicEventCustomHeaders, + ) + from ..models.models_dynamic_event_data import ModelsDynamicEventData + + d = dict(src_dict) + _custom_headers = d.pop("custom_headers", UNSET) + custom_headers: ModelsDynamicEventCustomHeaders | Unset + if isinstance(_custom_headers, Unset): + custom_headers = UNSET + else: + custom_headers = ModelsDynamicEventCustomHeaders.from_dict(_custom_headers) + + _data = d.pop("data", UNSET) + data: ModelsDynamicEventData | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsDynamicEventData.from_dict(_data) + + event_type = d.pop("event_type", UNSET) + + event_types = cast(list[str], d.pop("event_types", UNSET)) + + idempotency_key = d.pop("idempotency_key", UNSET) + + secret = d.pop("secret", UNSET) + + url = d.pop("url", UNSET) + + models_dynamic_event = cls( + custom_headers=custom_headers, + data=data, + event_type=event_type, + event_types=event_types, + idempotency_key=idempotency_key, + secret=secret, + url=url, + ) + + models_dynamic_event.additional_properties = d + return models_dynamic_event + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_dynamic_event_custom_headers.py b/src/convoy/models/models_dynamic_event_custom_headers.py new file mode 100644 index 0000000..7e6985c --- /dev/null +++ b/src/convoy/models/models_dynamic_event_custom_headers.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsDynamicEventCustomHeaders") + + +@_attrs_define +class ModelsDynamicEventCustomHeaders: + """Specifies custom headers you want convoy to add when the event is dispatched to your endpoint""" + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_dynamic_event_custom_headers = cls() + + models_dynamic_event_custom_headers.additional_properties = d + return models_dynamic_event_custom_headers + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_dynamic_event_data.py b/src/convoy/models/models_dynamic_event_data.py new file mode 100644 index 0000000..0ca3ca1 --- /dev/null +++ b/src/convoy/models/models_dynamic_event_data.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsDynamicEventData") + + +@_attrs_define +class ModelsDynamicEventData: + """Data is an arbitrary JSON value that gets sent as the body of the + webhook to the endpoints + + """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_dynamic_event_data = cls() + + models_dynamic_event_data.additional_properties = d + return models_dynamic_event_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_endpoint_authentication.py b/src/convoy/models/models_endpoint_authentication.py new file mode 100644 index 0000000..a2f1c84 --- /dev/null +++ b/src/convoy/models/models_endpoint_authentication.py @@ -0,0 +1,129 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_endpoint_authentication_type import ( + DatastoreEndpointAuthenticationType, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_api_key import ModelsApiKey + from ..models.models_basic_auth import ModelsBasicAuth + from ..models.models_o_auth_2 import ModelsOAuth2 + + +T = TypeVar("T", bound="ModelsEndpointAuthentication") + + +@_attrs_define +class ModelsEndpointAuthentication: + """ + Attributes: + api_key (ModelsApiKey | Unset): + basic_auth (ModelsBasicAuth | Unset): + oauth2 (ModelsOAuth2 | Unset): + type_ (DatastoreEndpointAuthenticationType | Unset): + """ + + api_key: ModelsApiKey | Unset = UNSET + basic_auth: ModelsBasicAuth | Unset = UNSET + oauth2: ModelsOAuth2 | Unset = UNSET + type_: DatastoreEndpointAuthenticationType | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + api_key: dict[str, Any] | Unset = UNSET + if not isinstance(self.api_key, Unset): + api_key = self.api_key.to_dict() + + basic_auth: dict[str, Any] | Unset = UNSET + if not isinstance(self.basic_auth, Unset): + basic_auth = self.basic_auth.to_dict() + + oauth2: dict[str, Any] | Unset = UNSET + if not isinstance(self.oauth2, Unset): + oauth2 = self.oauth2.to_dict() + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if api_key is not UNSET: + field_dict["api_key"] = api_key + if basic_auth is not UNSET: + field_dict["basic_auth"] = basic_auth + if oauth2 is not UNSET: + field_dict["oauth2"] = oauth2 + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_api_key import ModelsApiKey + from ..models.models_basic_auth import ModelsBasicAuth + from ..models.models_o_auth_2 import ModelsOAuth2 + + d = dict(src_dict) + _api_key = d.pop("api_key", UNSET) + api_key: ModelsApiKey | Unset + if isinstance(_api_key, Unset): + api_key = UNSET + else: + api_key = ModelsApiKey.from_dict(_api_key) + + _basic_auth = d.pop("basic_auth", UNSET) + basic_auth: ModelsBasicAuth | Unset + if isinstance(_basic_auth, Unset): + basic_auth = UNSET + else: + basic_auth = ModelsBasicAuth.from_dict(_basic_auth) + + _oauth2 = d.pop("oauth2", UNSET) + oauth2: ModelsOAuth2 | Unset + if isinstance(_oauth2, Unset): + oauth2 = UNSET + else: + oauth2 = ModelsOAuth2.from_dict(_oauth2) + + _type_ = d.pop("type", UNSET) + type_: DatastoreEndpointAuthenticationType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastoreEndpointAuthenticationType(_type_) + + models_endpoint_authentication = cls( + api_key=api_key, + basic_auth=basic_auth, + oauth2=oauth2, + type_=type_, + ) + + models_endpoint_authentication.additional_properties = d + return models_endpoint_authentication + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_endpoint_response.py b/src/convoy/models/models_endpoint_response.py new file mode 100644 index 0000000..0251f98 --- /dev/null +++ b/src/convoy/models/models_endpoint_response.py @@ -0,0 +1,349 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_endpoint_status import DatastoreEndpointStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_endpoint_authentication import ( + DatastoreEndpointAuthentication, + ) + from ..models.datastore_mtls_client_cert import DatastoreMtlsClientCert + from ..models.datastore_secret import DatastoreSecret + + +T = TypeVar("T", bound="ModelsEndpointResponse") + + +@_attrs_define +class ModelsEndpointResponse: + """ + Attributes: + advanced_signatures (bool | Unset): + authentication (DatastoreEndpointAuthentication | Unset): + cb_state (str | Unset): CBState is the circuit breaker state ("open", "half-open", "closed") so the UI + can reflect a tripped breaker on the endpoint status. Nil when CB is + off/unlicensed or has no sample for this endpoint. + content_type (str | Unset): + created_at (str | Unset): + deleted_at (str | Unset): + description (str | Unset): + events (int | Unset): + failure_count (int | Unset): + failure_rate (float | Unset): FailureRate is the circuit breaker's rolling failure rate for this endpoint. + It is a pointer so the API can return null when no rate was computed (circuit + breaker feature off, or sampler not running), distinct from a genuine 0%. + http_timeout (int | Unset): + mtls_client_cert (DatastoreMtlsClientCert | Unset): + name (str | Unset): + owner_id (str | Unset): + period_failure_rate (float | Unset): PeriodFailureRate is the period failure rate from event_deliveries, + (Failure+Retry)/(Success+Failure+Retry). Retry counts as failed-so-far. + Nil when the range has no counted deliveries; sibling counts are transient. + project_id (str | Unset): + rate_limit (int | Unset): + rate_limit_duration (int | Unset): + retry_count (int | Unset): + secrets (list[DatastoreSecret] | Unset): + slack_webhook_url (str | Unset): + status (DatastoreEndpointStatus | Unset): + success_count (int | Unset): + support_email (str | Unset): + uid (str | Unset): + updated_at (str | Unset): + url (str | Unset): + """ + + advanced_signatures: bool | Unset = UNSET + authentication: DatastoreEndpointAuthentication | Unset = UNSET + cb_state: str | Unset = UNSET + content_type: str | Unset = UNSET + created_at: str | Unset = UNSET + deleted_at: str | Unset = UNSET + description: str | Unset = UNSET + events: int | Unset = UNSET + failure_count: int | Unset = UNSET + failure_rate: float | Unset = UNSET + http_timeout: int | Unset = UNSET + mtls_client_cert: DatastoreMtlsClientCert | Unset = UNSET + name: str | Unset = UNSET + owner_id: str | Unset = UNSET + period_failure_rate: float | Unset = UNSET + project_id: str | Unset = UNSET + rate_limit: int | Unset = UNSET + rate_limit_duration: int | Unset = UNSET + retry_count: int | Unset = UNSET + secrets: list[DatastoreSecret] | Unset = UNSET + slack_webhook_url: str | Unset = UNSET + status: DatastoreEndpointStatus | Unset = UNSET + success_count: int | Unset = UNSET + support_email: str | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + advanced_signatures = self.advanced_signatures + + authentication: dict[str, Any] | Unset = UNSET + if not isinstance(self.authentication, Unset): + authentication = self.authentication.to_dict() + + cb_state = self.cb_state + + content_type = self.content_type + + created_at = self.created_at + + deleted_at = self.deleted_at + + description = self.description + + events = self.events + + failure_count = self.failure_count + + failure_rate = self.failure_rate + + http_timeout = self.http_timeout + + mtls_client_cert: dict[str, Any] | Unset = UNSET + if not isinstance(self.mtls_client_cert, Unset): + mtls_client_cert = self.mtls_client_cert.to_dict() + + name = self.name + + owner_id = self.owner_id + + period_failure_rate = self.period_failure_rate + + project_id = self.project_id + + rate_limit = self.rate_limit + + rate_limit_duration = self.rate_limit_duration + + retry_count = self.retry_count + + secrets: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.secrets, Unset): + secrets = [] + for secrets_item_data in self.secrets: + secrets_item = secrets_item_data.to_dict() + secrets.append(secrets_item) + + slack_webhook_url = self.slack_webhook_url + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + success_count = self.success_count + + support_email = self.support_email + + uid = self.uid + + updated_at = self.updated_at + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if advanced_signatures is not UNSET: + field_dict["advanced_signatures"] = advanced_signatures + if authentication is not UNSET: + field_dict["authentication"] = authentication + if cb_state is not UNSET: + field_dict["cb_state"] = cb_state + if content_type is not UNSET: + field_dict["content_type"] = content_type + if created_at is not UNSET: + field_dict["created_at"] = created_at + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if description is not UNSET: + field_dict["description"] = description + if events is not UNSET: + field_dict["events"] = events + if failure_count is not UNSET: + field_dict["failure_count"] = failure_count + if failure_rate is not UNSET: + field_dict["failure_rate"] = failure_rate + if http_timeout is not UNSET: + field_dict["http_timeout"] = http_timeout + if mtls_client_cert is not UNSET: + field_dict["mtls_client_cert"] = mtls_client_cert + if name is not UNSET: + field_dict["name"] = name + if owner_id is not UNSET: + field_dict["owner_id"] = owner_id + if period_failure_rate is not UNSET: + field_dict["period_failure_rate"] = period_failure_rate + if project_id is not UNSET: + field_dict["project_id"] = project_id + if rate_limit is not UNSET: + field_dict["rate_limit"] = rate_limit + if rate_limit_duration is not UNSET: + field_dict["rate_limit_duration"] = rate_limit_duration + if retry_count is not UNSET: + field_dict["retry_count"] = retry_count + if secrets is not UNSET: + field_dict["secrets"] = secrets + if slack_webhook_url is not UNSET: + field_dict["slack_webhook_url"] = slack_webhook_url + if status is not UNSET: + field_dict["status"] = status + if success_count is not UNSET: + field_dict["success_count"] = success_count + if support_email is not UNSET: + field_dict["support_email"] = support_email + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_endpoint_authentication import ( + DatastoreEndpointAuthentication, + ) + from ..models.datastore_mtls_client_cert import DatastoreMtlsClientCert + from ..models.datastore_secret import DatastoreSecret + + d = dict(src_dict) + advanced_signatures = d.pop("advanced_signatures", UNSET) + + _authentication = d.pop("authentication", UNSET) + authentication: DatastoreEndpointAuthentication | Unset + if isinstance(_authentication, Unset): + authentication = UNSET + else: + authentication = DatastoreEndpointAuthentication.from_dict(_authentication) + + cb_state = d.pop("cb_state", UNSET) + + content_type = d.pop("content_type", UNSET) + + created_at = d.pop("created_at", UNSET) + + deleted_at = d.pop("deleted_at", UNSET) + + description = d.pop("description", UNSET) + + events = d.pop("events", UNSET) + + failure_count = d.pop("failure_count", UNSET) + + failure_rate = d.pop("failure_rate", UNSET) + + http_timeout = d.pop("http_timeout", UNSET) + + _mtls_client_cert = d.pop("mtls_client_cert", UNSET) + mtls_client_cert: DatastoreMtlsClientCert | Unset + if isinstance(_mtls_client_cert, Unset): + mtls_client_cert = UNSET + else: + mtls_client_cert = DatastoreMtlsClientCert.from_dict(_mtls_client_cert) + + name = d.pop("name", UNSET) + + owner_id = d.pop("owner_id", UNSET) + + period_failure_rate = d.pop("period_failure_rate", UNSET) + + project_id = d.pop("project_id", UNSET) + + rate_limit = d.pop("rate_limit", UNSET) + + rate_limit_duration = d.pop("rate_limit_duration", UNSET) + + retry_count = d.pop("retry_count", UNSET) + + _secrets = d.pop("secrets", UNSET) + secrets: list[DatastoreSecret] | Unset = UNSET + if _secrets is not UNSET: + secrets = [] + for secrets_item_data in _secrets: + secrets_item = DatastoreSecret.from_dict(secrets_item_data) + + secrets.append(secrets_item) + + slack_webhook_url = d.pop("slack_webhook_url", UNSET) + + _status = d.pop("status", UNSET) + status: DatastoreEndpointStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = DatastoreEndpointStatus(_status) + + success_count = d.pop("success_count", UNSET) + + support_email = d.pop("support_email", UNSET) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + url = d.pop("url", UNSET) + + models_endpoint_response = cls( + advanced_signatures=advanced_signatures, + authentication=authentication, + cb_state=cb_state, + content_type=content_type, + created_at=created_at, + deleted_at=deleted_at, + description=description, + events=events, + failure_count=failure_count, + failure_rate=failure_rate, + http_timeout=http_timeout, + mtls_client_cert=mtls_client_cert, + name=name, + owner_id=owner_id, + period_failure_rate=period_failure_rate, + project_id=project_id, + rate_limit=rate_limit, + rate_limit_duration=rate_limit_duration, + retry_count=retry_count, + secrets=secrets, + slack_webhook_url=slack_webhook_url, + status=status, + success_count=success_count, + support_email=support_email, + uid=uid, + updated_at=updated_at, + url=url, + ) + + models_endpoint_response.additional_properties = d + return models_endpoint_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_event_delivery_response.py b/src/convoy/models/models_event_delivery_response.py new file mode 100644 index 0000000..5468802 --- /dev/null +++ b/src/convoy/models/models_event_delivery_response.py @@ -0,0 +1,369 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_delivery_mode import DatastoreDeliveryMode +from ..models.datastore_event_delivery_status import DatastoreEventDeliveryStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_cli_metadata import DatastoreCLIMetadata + from ..models.datastore_device import DatastoreDevice + from ..models.datastore_endpoint import DatastoreEndpoint + from ..models.datastore_event import DatastoreEvent + from ..models.datastore_metadata import DatastoreMetadata + from ..models.datastore_source import DatastoreSource + from ..models.httpheader_http_header import HttpheaderHTTPHeader + + +T = TypeVar("T", bound="ModelsEventDeliveryResponse") + + +@_attrs_define +class ModelsEventDeliveryResponse: + """ + Attributes: + acknowledged_at (str | Unset): + cli_metadata (DatastoreCLIMetadata | Unset): + created_at (str | Unset): + deleted_at (str | Unset): + delivery_mode (DatastoreDeliveryMode | Unset): + description (str | Unset): + device_id (str | Unset): + device_metadata (DatastoreDevice | Unset): + endpoint_id (str | Unset): + endpoint_metadata (DatastoreEndpoint | Unset): + event_id (str | Unset): + event_metadata (DatastoreEvent | Unset): + event_type (str | Unset): + headers (HttpheaderHTTPHeader | Unset): + idempotency_key (str | Unset): + latency (str | Unset): Deprecated: Latency is deprecated. + latency_seconds (float | Unset): + metadata (DatastoreMetadata | Unset): + project_id (str | Unset): + source_metadata (DatastoreSource | Unset): + status (DatastoreEventDeliveryStatus | Unset): + subscription_id (str | Unset): + target_url (str | Unset): + uid (str | Unset): + updated_at (str | Unset): + url_query_params (str | Unset): + """ + + acknowledged_at: str | Unset = UNSET + cli_metadata: DatastoreCLIMetadata | Unset = UNSET + created_at: str | Unset = UNSET + deleted_at: str | Unset = UNSET + delivery_mode: DatastoreDeliveryMode | Unset = UNSET + description: str | Unset = UNSET + device_id: str | Unset = UNSET + device_metadata: DatastoreDevice | Unset = UNSET + endpoint_id: str | Unset = UNSET + endpoint_metadata: DatastoreEndpoint | Unset = UNSET + event_id: str | Unset = UNSET + event_metadata: DatastoreEvent | Unset = UNSET + event_type: str | Unset = UNSET + headers: HttpheaderHTTPHeader | Unset = UNSET + idempotency_key: str | Unset = UNSET + latency: str | Unset = UNSET + latency_seconds: float | Unset = UNSET + metadata: DatastoreMetadata | Unset = UNSET + project_id: str | Unset = UNSET + source_metadata: DatastoreSource | Unset = UNSET + status: DatastoreEventDeliveryStatus | Unset = UNSET + subscription_id: str | Unset = UNSET + target_url: str | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + url_query_params: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + acknowledged_at = self.acknowledged_at + + cli_metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.cli_metadata, Unset): + cli_metadata = self.cli_metadata.to_dict() + + created_at = self.created_at + + deleted_at = self.deleted_at + + delivery_mode: str | Unset = UNSET + if not isinstance(self.delivery_mode, Unset): + delivery_mode = self.delivery_mode.value + + description = self.description + + device_id = self.device_id + + device_metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.device_metadata, Unset): + device_metadata = self.device_metadata.to_dict() + + endpoint_id = self.endpoint_id + + endpoint_metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.endpoint_metadata, Unset): + endpoint_metadata = self.endpoint_metadata.to_dict() + + event_id = self.event_id + + event_metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.event_metadata, Unset): + event_metadata = self.event_metadata.to_dict() + + event_type = self.event_type + + headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.headers, Unset): + headers = self.headers.to_dict() + + idempotency_key = self.idempotency_key + + latency = self.latency + + latency_seconds = self.latency_seconds + + metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + project_id = self.project_id + + source_metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.source_metadata, Unset): + source_metadata = self.source_metadata.to_dict() + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + subscription_id = self.subscription_id + + target_url = self.target_url + + uid = self.uid + + updated_at = self.updated_at + + url_query_params = self.url_query_params + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if acknowledged_at is not UNSET: + field_dict["acknowledged_at"] = acknowledged_at + if cli_metadata is not UNSET: + field_dict["cli_metadata"] = cli_metadata + if created_at is not UNSET: + field_dict["created_at"] = created_at + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if delivery_mode is not UNSET: + field_dict["delivery_mode"] = delivery_mode + if description is not UNSET: + field_dict["description"] = description + if device_id is not UNSET: + field_dict["device_id"] = device_id + if device_metadata is not UNSET: + field_dict["device_metadata"] = device_metadata + if endpoint_id is not UNSET: + field_dict["endpoint_id"] = endpoint_id + if endpoint_metadata is not UNSET: + field_dict["endpoint_metadata"] = endpoint_metadata + if event_id is not UNSET: + field_dict["event_id"] = event_id + if event_metadata is not UNSET: + field_dict["event_metadata"] = event_metadata + if event_type is not UNSET: + field_dict["event_type"] = event_type + if headers is not UNSET: + field_dict["headers"] = headers + if idempotency_key is not UNSET: + field_dict["idempotency_key"] = idempotency_key + if latency is not UNSET: + field_dict["latency"] = latency + if latency_seconds is not UNSET: + field_dict["latency_seconds"] = latency_seconds + if metadata is not UNSET: + field_dict["metadata"] = metadata + if project_id is not UNSET: + field_dict["project_id"] = project_id + if source_metadata is not UNSET: + field_dict["source_metadata"] = source_metadata + if status is not UNSET: + field_dict["status"] = status + if subscription_id is not UNSET: + field_dict["subscription_id"] = subscription_id + if target_url is not UNSET: + field_dict["target_url"] = target_url + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if url_query_params is not UNSET: + field_dict["url_query_params"] = url_query_params + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_cli_metadata import DatastoreCLIMetadata + from ..models.datastore_device import DatastoreDevice + from ..models.datastore_endpoint import DatastoreEndpoint + from ..models.datastore_event import DatastoreEvent + from ..models.datastore_metadata import DatastoreMetadata + from ..models.datastore_source import DatastoreSource + from ..models.httpheader_http_header import HttpheaderHTTPHeader + + d = dict(src_dict) + acknowledged_at = d.pop("acknowledged_at", UNSET) + + _cli_metadata = d.pop("cli_metadata", UNSET) + cli_metadata: DatastoreCLIMetadata | Unset + if isinstance(_cli_metadata, Unset): + cli_metadata = UNSET + else: + cli_metadata = DatastoreCLIMetadata.from_dict(_cli_metadata) + + created_at = d.pop("created_at", UNSET) + + deleted_at = d.pop("deleted_at", UNSET) + + _delivery_mode = d.pop("delivery_mode", UNSET) + delivery_mode: DatastoreDeliveryMode | Unset + if isinstance(_delivery_mode, Unset): + delivery_mode = UNSET + else: + delivery_mode = DatastoreDeliveryMode(_delivery_mode) + + description = d.pop("description", UNSET) + + device_id = d.pop("device_id", UNSET) + + _device_metadata = d.pop("device_metadata", UNSET) + device_metadata: DatastoreDevice | Unset + if isinstance(_device_metadata, Unset): + device_metadata = UNSET + else: + device_metadata = DatastoreDevice.from_dict(_device_metadata) + + endpoint_id = d.pop("endpoint_id", UNSET) + + _endpoint_metadata = d.pop("endpoint_metadata", UNSET) + endpoint_metadata: DatastoreEndpoint | Unset + if isinstance(_endpoint_metadata, Unset): + endpoint_metadata = UNSET + else: + endpoint_metadata = DatastoreEndpoint.from_dict(_endpoint_metadata) + + event_id = d.pop("event_id", UNSET) + + _event_metadata = d.pop("event_metadata", UNSET) + event_metadata: DatastoreEvent | Unset + if isinstance(_event_metadata, Unset): + event_metadata = UNSET + else: + event_metadata = DatastoreEvent.from_dict(_event_metadata) + + event_type = d.pop("event_type", UNSET) + + _headers = d.pop("headers", UNSET) + headers: HttpheaderHTTPHeader | Unset + if isinstance(_headers, Unset): + headers = UNSET + else: + headers = HttpheaderHTTPHeader.from_dict(_headers) + + idempotency_key = d.pop("idempotency_key", UNSET) + + latency = d.pop("latency", UNSET) + + latency_seconds = d.pop("latency_seconds", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: DatastoreMetadata | Unset + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = DatastoreMetadata.from_dict(_metadata) + + project_id = d.pop("project_id", UNSET) + + _source_metadata = d.pop("source_metadata", UNSET) + source_metadata: DatastoreSource | Unset + if isinstance(_source_metadata, Unset): + source_metadata = UNSET + else: + source_metadata = DatastoreSource.from_dict(_source_metadata) + + _status = d.pop("status", UNSET) + status: DatastoreEventDeliveryStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = DatastoreEventDeliveryStatus(_status) + + subscription_id = d.pop("subscription_id", UNSET) + + target_url = d.pop("target_url", UNSET) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + url_query_params = d.pop("url_query_params", UNSET) + + models_event_delivery_response = cls( + acknowledged_at=acknowledged_at, + cli_metadata=cli_metadata, + created_at=created_at, + deleted_at=deleted_at, + delivery_mode=delivery_mode, + description=description, + device_id=device_id, + device_metadata=device_metadata, + endpoint_id=endpoint_id, + endpoint_metadata=endpoint_metadata, + event_id=event_id, + event_metadata=event_metadata, + event_type=event_type, + headers=headers, + idempotency_key=idempotency_key, + latency=latency, + latency_seconds=latency_seconds, + metadata=metadata, + project_id=project_id, + source_metadata=source_metadata, + status=status, + subscription_id=subscription_id, + target_url=target_url, + uid=uid, + updated_at=updated_at, + url_query_params=url_query_params, + ) + + models_event_delivery_response.additional_properties = d + return models_event_delivery_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_event_response.py b/src/convoy/models/models_event_response.py new file mode 100644 index 0000000..e2832dc --- /dev/null +++ b/src/convoy/models/models_event_response.py @@ -0,0 +1,292 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_event_status import DatastoreEventStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_endpoint import DatastoreEndpoint + from ..models.datastore_source import DatastoreSource + from ..models.httpheader_http_header import HttpheaderHTTPHeader + + +T = TypeVar("T", bound="ModelsEventResponse") + + +@_attrs_define +class ModelsEventResponse: + """ + Attributes: + acknowledged_at (str | Unset): + app_id (str | Unset): Deprecated + created_at (str | Unset): + data (list[int] | Unset): Data is an arbitrary JSON value that gets sent as the body of the + webhook to the endpoints + deleted_at (str | Unset): + endpoint_metadata (list[DatastoreEndpoint] | Unset): + endpoints (list[str] | Unset): + event_type (str | Unset): + headers (HttpheaderHTTPHeader | Unset): + idempotency_key (str | Unset): + is_duplicate_event (bool | Unset): + metadata (str | Unset): + project_id (str | Unset): + raw (str | Unset): + source_id (str | Unset): + source_metadata (DatastoreSource | Unset): + status (DatastoreEventStatus | Unset): + uid (str | Unset): + updated_at (str | Unset): + url_path (str | Unset): + url_query_params (str | Unset): + """ + + acknowledged_at: str | Unset = UNSET + app_id: str | Unset = UNSET + created_at: str | Unset = UNSET + data: list[int] | Unset = UNSET + deleted_at: str | Unset = UNSET + endpoint_metadata: list[DatastoreEndpoint] | Unset = UNSET + endpoints: list[str] | Unset = UNSET + event_type: str | Unset = UNSET + headers: HttpheaderHTTPHeader | Unset = UNSET + idempotency_key: str | Unset = UNSET + is_duplicate_event: bool | Unset = UNSET + metadata: str | Unset = UNSET + project_id: str | Unset = UNSET + raw: str | Unset = UNSET + source_id: str | Unset = UNSET + source_metadata: DatastoreSource | Unset = UNSET + status: DatastoreEventStatus | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + url_path: str | Unset = UNSET + url_query_params: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + acknowledged_at = self.acknowledged_at + + app_id = self.app_id + + created_at = self.created_at + + data: list[int] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data + + deleted_at = self.deleted_at + + endpoint_metadata: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.endpoint_metadata, Unset): + endpoint_metadata = [] + for endpoint_metadata_item_data in self.endpoint_metadata: + endpoint_metadata_item = endpoint_metadata_item_data.to_dict() + endpoint_metadata.append(endpoint_metadata_item) + + endpoints: list[str] | Unset = UNSET + if not isinstance(self.endpoints, Unset): + endpoints = self.endpoints + + event_type = self.event_type + + headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.headers, Unset): + headers = self.headers.to_dict() + + idempotency_key = self.idempotency_key + + is_duplicate_event = self.is_duplicate_event + + metadata = self.metadata + + project_id = self.project_id + + raw = self.raw + + source_id = self.source_id + + source_metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.source_metadata, Unset): + source_metadata = self.source_metadata.to_dict() + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + uid = self.uid + + updated_at = self.updated_at + + url_path = self.url_path + + url_query_params = self.url_query_params + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if acknowledged_at is not UNSET: + field_dict["acknowledged_at"] = acknowledged_at + if app_id is not UNSET: + field_dict["app_id"] = app_id + if created_at is not UNSET: + field_dict["created_at"] = created_at + if data is not UNSET: + field_dict["data"] = data + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if endpoint_metadata is not UNSET: + field_dict["endpoint_metadata"] = endpoint_metadata + if endpoints is not UNSET: + field_dict["endpoints"] = endpoints + if event_type is not UNSET: + field_dict["event_type"] = event_type + if headers is not UNSET: + field_dict["headers"] = headers + if idempotency_key is not UNSET: + field_dict["idempotency_key"] = idempotency_key + if is_duplicate_event is not UNSET: + field_dict["is_duplicate_event"] = is_duplicate_event + if metadata is not UNSET: + field_dict["metadata"] = metadata + if project_id is not UNSET: + field_dict["project_id"] = project_id + if raw is not UNSET: + field_dict["raw"] = raw + if source_id is not UNSET: + field_dict["source_id"] = source_id + if source_metadata is not UNSET: + field_dict["source_metadata"] = source_metadata + if status is not UNSET: + field_dict["status"] = status + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if url_path is not UNSET: + field_dict["url_path"] = url_path + if url_query_params is not UNSET: + field_dict["url_query_params"] = url_query_params + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_endpoint import DatastoreEndpoint + from ..models.datastore_source import DatastoreSource + from ..models.httpheader_http_header import HttpheaderHTTPHeader + + d = dict(src_dict) + acknowledged_at = d.pop("acknowledged_at", UNSET) + + app_id = d.pop("app_id", UNSET) + + created_at = d.pop("created_at", UNSET) + + data = cast(list[int], d.pop("data", UNSET)) + + deleted_at = d.pop("deleted_at", UNSET) + + _endpoint_metadata = d.pop("endpoint_metadata", UNSET) + endpoint_metadata: list[DatastoreEndpoint] | Unset = UNSET + if _endpoint_metadata is not UNSET: + endpoint_metadata = [] + for endpoint_metadata_item_data in _endpoint_metadata: + endpoint_metadata_item = DatastoreEndpoint.from_dict( + endpoint_metadata_item_data + ) + + endpoint_metadata.append(endpoint_metadata_item) + + endpoints = cast(list[str], d.pop("endpoints", UNSET)) + + event_type = d.pop("event_type", UNSET) + + _headers = d.pop("headers", UNSET) + headers: HttpheaderHTTPHeader | Unset + if isinstance(_headers, Unset): + headers = UNSET + else: + headers = HttpheaderHTTPHeader.from_dict(_headers) + + idempotency_key = d.pop("idempotency_key", UNSET) + + is_duplicate_event = d.pop("is_duplicate_event", UNSET) + + metadata = d.pop("metadata", UNSET) + + project_id = d.pop("project_id", UNSET) + + raw = d.pop("raw", UNSET) + + source_id = d.pop("source_id", UNSET) + + _source_metadata = d.pop("source_metadata", UNSET) + source_metadata: DatastoreSource | Unset + if isinstance(_source_metadata, Unset): + source_metadata = UNSET + else: + source_metadata = DatastoreSource.from_dict(_source_metadata) + + _status = d.pop("status", UNSET) + status: DatastoreEventStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = DatastoreEventStatus(_status) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + url_path = d.pop("url_path", UNSET) + + url_query_params = d.pop("url_query_params", UNSET) + + models_event_response = cls( + acknowledged_at=acknowledged_at, + app_id=app_id, + created_at=created_at, + data=data, + deleted_at=deleted_at, + endpoint_metadata=endpoint_metadata, + endpoints=endpoints, + event_type=event_type, + headers=headers, + idempotency_key=idempotency_key, + is_duplicate_event=is_duplicate_event, + metadata=metadata, + project_id=project_id, + raw=raw, + source_id=source_id, + source_metadata=source_metadata, + status=status, + uid=uid, + updated_at=updated_at, + url_path=url_path, + url_query_params=url_query_params, + ) + + models_event_response.additional_properties = d + return models_event_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_event_type_response.py b/src/convoy/models/models_event_type_response.py new file mode 100644 index 0000000..01ccd78 --- /dev/null +++ b/src/convoy/models/models_event_type_response.py @@ -0,0 +1,108 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsEventTypeResponse") + + +@_attrs_define +class ModelsEventTypeResponse: + """ + Attributes: + category (str | Unset): + deprecated_at (str | Unset): + description (str | Unset): + json_schema (list[int] | Unset): + name (str | Unset): + uid (str | Unset): + """ + + category: str | Unset = UNSET + deprecated_at: str | Unset = UNSET + description: str | Unset = UNSET + json_schema: list[int] | Unset = UNSET + name: str | Unset = UNSET + uid: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + category = self.category + + deprecated_at = self.deprecated_at + + description = self.description + + json_schema: list[int] | Unset = UNSET + if not isinstance(self.json_schema, Unset): + json_schema = self.json_schema + + name = self.name + + uid = self.uid + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if category is not UNSET: + field_dict["category"] = category + if deprecated_at is not UNSET: + field_dict["deprecated_at"] = deprecated_at + if description is not UNSET: + field_dict["description"] = description + if json_schema is not UNSET: + field_dict["json_schema"] = json_schema + if name is not UNSET: + field_dict["name"] = name + if uid is not UNSET: + field_dict["uid"] = uid + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + category = d.pop("category", UNSET) + + deprecated_at = d.pop("deprecated_at", UNSET) + + description = d.pop("description", UNSET) + + json_schema = cast(list[int], d.pop("json_schema", UNSET)) + + name = d.pop("name", UNSET) + + uid = d.pop("uid", UNSET) + + models_event_type_response = cls( + category=category, + deprecated_at=deprecated_at, + description=description, + json_schema=json_schema, + name=name, + uid=uid, + ) + + models_event_type_response.additional_properties = d + return models_event_type_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_expire_secret.py b/src/convoy/models/models_expire_secret.py new file mode 100644 index 0000000..0dcdab5 --- /dev/null +++ b/src/convoy/models/models_expire_secret.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsExpireSecret") + + +@_attrs_define +class ModelsExpireSecret: + """ + Attributes: + expiration (int | Unset): Amount of time to wait before expiring the old endpoint secret. + If AdvancedSignatures is turned on for the project, signatures for both secrets will be generated up until + the old signature is expired. + secret (str | Unset): New Endpoint secret value. + """ + + expiration: int | Unset = UNSET + secret: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + expiration = self.expiration + + secret = self.secret + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if expiration is not UNSET: + field_dict["expiration"] = expiration + if secret is not UNSET: + field_dict["secret"] = secret + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + expiration = d.pop("expiration", UNSET) + + secret = d.pop("secret", UNSET) + + models_expire_secret = cls( + expiration=expiration, + secret=secret, + ) + + models_expire_secret.additional_properties = d + return models_expire_secret + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_fanout_event.py b/src/convoy/models/models_fanout_event.py new file mode 100644 index 0000000..a069b13 --- /dev/null +++ b/src/convoy/models/models_fanout_event.py @@ -0,0 +1,125 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_fanout_event_custom_headers import ( + ModelsFanoutEventCustomHeaders, + ) + from ..models.models_fanout_event_data import ModelsFanoutEventData + + +T = TypeVar("T", bound="ModelsFanoutEvent") + + +@_attrs_define +class ModelsFanoutEvent: + """ + Attributes: + custom_headers (ModelsFanoutEventCustomHeaders | Unset): Specifies custom headers you want convoy to add when + the event is dispatched to your endpoint + data (ModelsFanoutEventData | Unset): Data is an arbitrary JSON value that gets sent as the body of the + webhook to the endpoints + event_type (str | Unset): Event Type is used for filtering and debugging e.g invoice.paid + idempotency_key (str | Unset): Specify a key for event deduplication + owner_id (str | Unset): Used for fanout, sends this event to all endpoints with this OwnerID. + """ + + custom_headers: ModelsFanoutEventCustomHeaders | Unset = UNSET + data: ModelsFanoutEventData | Unset = UNSET + event_type: str | Unset = UNSET + idempotency_key: str | Unset = UNSET + owner_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + custom_headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.custom_headers, Unset): + custom_headers = self.custom_headers.to_dict() + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + event_type = self.event_type + + idempotency_key = self.idempotency_key + + owner_id = self.owner_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if custom_headers is not UNSET: + field_dict["custom_headers"] = custom_headers + if data is not UNSET: + field_dict["data"] = data + if event_type is not UNSET: + field_dict["event_type"] = event_type + if idempotency_key is not UNSET: + field_dict["idempotency_key"] = idempotency_key + if owner_id is not UNSET: + field_dict["owner_id"] = owner_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_fanout_event_custom_headers import ( + ModelsFanoutEventCustomHeaders, + ) + from ..models.models_fanout_event_data import ModelsFanoutEventData + + d = dict(src_dict) + _custom_headers = d.pop("custom_headers", UNSET) + custom_headers: ModelsFanoutEventCustomHeaders | Unset + if isinstance(_custom_headers, Unset): + custom_headers = UNSET + else: + custom_headers = ModelsFanoutEventCustomHeaders.from_dict(_custom_headers) + + _data = d.pop("data", UNSET) + data: ModelsFanoutEventData | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsFanoutEventData.from_dict(_data) + + event_type = d.pop("event_type", UNSET) + + idempotency_key = d.pop("idempotency_key", UNSET) + + owner_id = d.pop("owner_id", UNSET) + + models_fanout_event = cls( + custom_headers=custom_headers, + data=data, + event_type=event_type, + idempotency_key=idempotency_key, + owner_id=owner_id, + ) + + models_fanout_event.additional_properties = d + return models_fanout_event + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_fanout_event_custom_headers.py b/src/convoy/models/models_fanout_event_custom_headers.py new file mode 100644 index 0000000..7b14d8b --- /dev/null +++ b/src/convoy/models/models_fanout_event_custom_headers.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsFanoutEventCustomHeaders") + + +@_attrs_define +class ModelsFanoutEventCustomHeaders: + """Specifies custom headers you want convoy to add when the event is dispatched to your endpoint""" + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_fanout_event_custom_headers = cls() + + models_fanout_event_custom_headers.additional_properties = d + return models_fanout_event_custom_headers + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_fanout_event_data.py b/src/convoy/models/models_fanout_event_data.py new file mode 100644 index 0000000..21e44c9 --- /dev/null +++ b/src/convoy/models/models_fanout_event_data.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsFanoutEventData") + + +@_attrs_define +class ModelsFanoutEventData: + """Data is an arbitrary JSON value that gets sent as the body of the + webhook to the endpoints + + """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_fanout_event_data = cls() + + models_fanout_event_data.additional_properties = d + return models_fanout_event_data + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_filter_configuration.py b/src/convoy/models/models_filter_configuration.py new file mode 100644 index 0000000..99c7b57 --- /dev/null +++ b/src/convoy/models/models_filter_configuration.py @@ -0,0 +1,85 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_fs import ModelsFS + + +T = TypeVar("T", bound="ModelsFilterConfiguration") + + +@_attrs_define +class ModelsFilterConfiguration: + """ + Attributes: + event_types (list[str] | Unset): List of event types that the subscription should match + filter_ (ModelsFS | Unset): + """ + + event_types: list[str] | Unset = UNSET + filter_: ModelsFS | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event_types: list[str] | Unset = UNSET + if not isinstance(self.event_types, Unset): + event_types = self.event_types + + filter_: dict[str, Any] | Unset = UNSET + if not isinstance(self.filter_, Unset): + filter_ = self.filter_.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if event_types is not UNSET: + field_dict["event_types"] = event_types + if filter_ is not UNSET: + field_dict["filter"] = filter_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_fs import ModelsFS + + d = dict(src_dict) + event_types = cast(list[str], d.pop("event_types", UNSET)) + + _filter_ = d.pop("filter", UNSET) + filter_: ModelsFS | Unset + if isinstance(_filter_, Unset): + filter_ = UNSET + else: + filter_ = ModelsFS.from_dict(_filter_) + + models_filter_configuration = cls( + event_types=event_types, + filter_=filter_, + ) + + models_filter_configuration.additional_properties = d + return models_filter_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_filter_response.py b/src/convoy/models/models_filter_response.py new file mode 100644 index 0000000..9c9e5ba --- /dev/null +++ b/src/convoy/models/models_filter_response.py @@ -0,0 +1,222 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_m import DatastoreM + + +T = TypeVar("T", bound="ModelsFilterResponse") + + +@_attrs_define +class ModelsFilterResponse: + """ + Attributes: + body (DatastoreM | Unset): + enabled_at (str | Unset): + event_type (str | Unset): + headers (DatastoreM | Unset): + path (DatastoreM | Unset): + query (DatastoreM | Unset): + raw_body (DatastoreM | Unset): + raw_headers (DatastoreM | Unset): + raw_path (DatastoreM | Unset): + raw_query (DatastoreM | Unset): + subscription_id (str | Unset): + uid (str | Unset): + """ + + body: DatastoreM | Unset = UNSET + enabled_at: str | Unset = UNSET + event_type: str | Unset = UNSET + headers: DatastoreM | Unset = UNSET + path: DatastoreM | Unset = UNSET + query: DatastoreM | Unset = UNSET + raw_body: DatastoreM | Unset = UNSET + raw_headers: DatastoreM | Unset = UNSET + raw_path: DatastoreM | Unset = UNSET + raw_query: DatastoreM | Unset = UNSET + subscription_id: str | Unset = UNSET + uid: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + body: dict[str, Any] | Unset = UNSET + if not isinstance(self.body, Unset): + body = self.body.to_dict() + + enabled_at = self.enabled_at + + event_type = self.event_type + + headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.headers, Unset): + headers = self.headers.to_dict() + + path: dict[str, Any] | Unset = UNSET + if not isinstance(self.path, Unset): + path = self.path.to_dict() + + query: dict[str, Any] | Unset = UNSET + if not isinstance(self.query, Unset): + query = self.query.to_dict() + + raw_body: dict[str, Any] | Unset = UNSET + if not isinstance(self.raw_body, Unset): + raw_body = self.raw_body.to_dict() + + raw_headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.raw_headers, Unset): + raw_headers = self.raw_headers.to_dict() + + raw_path: dict[str, Any] | Unset = UNSET + if not isinstance(self.raw_path, Unset): + raw_path = self.raw_path.to_dict() + + raw_query: dict[str, Any] | Unset = UNSET + if not isinstance(self.raw_query, Unset): + raw_query = self.raw_query.to_dict() + + subscription_id = self.subscription_id + + uid = self.uid + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if body is not UNSET: + field_dict["body"] = body + if enabled_at is not UNSET: + field_dict["enabled_at"] = enabled_at + if event_type is not UNSET: + field_dict["event_type"] = event_type + if headers is not UNSET: + field_dict["headers"] = headers + if path is not UNSET: + field_dict["path"] = path + if query is not UNSET: + field_dict["query"] = query + if raw_body is not UNSET: + field_dict["raw_body"] = raw_body + if raw_headers is not UNSET: + field_dict["raw_headers"] = raw_headers + if raw_path is not UNSET: + field_dict["raw_path"] = raw_path + if raw_query is not UNSET: + field_dict["raw_query"] = raw_query + if subscription_id is not UNSET: + field_dict["subscription_id"] = subscription_id + if uid is not UNSET: + field_dict["uid"] = uid + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_m import DatastoreM + + d = dict(src_dict) + _body = d.pop("body", UNSET) + body: DatastoreM | Unset + if isinstance(_body, Unset): + body = UNSET + else: + body = DatastoreM.from_dict(_body) + + enabled_at = d.pop("enabled_at", UNSET) + + event_type = d.pop("event_type", UNSET) + + _headers = d.pop("headers", UNSET) + headers: DatastoreM | Unset + if isinstance(_headers, Unset): + headers = UNSET + else: + headers = DatastoreM.from_dict(_headers) + + _path = d.pop("path", UNSET) + path: DatastoreM | Unset + if isinstance(_path, Unset): + path = UNSET + else: + path = DatastoreM.from_dict(_path) + + _query = d.pop("query", UNSET) + query: DatastoreM | Unset + if isinstance(_query, Unset): + query = UNSET + else: + query = DatastoreM.from_dict(_query) + + _raw_body = d.pop("raw_body", UNSET) + raw_body: DatastoreM | Unset + if isinstance(_raw_body, Unset): + raw_body = UNSET + else: + raw_body = DatastoreM.from_dict(_raw_body) + + _raw_headers = d.pop("raw_headers", UNSET) + raw_headers: DatastoreM | Unset + if isinstance(_raw_headers, Unset): + raw_headers = UNSET + else: + raw_headers = DatastoreM.from_dict(_raw_headers) + + _raw_path = d.pop("raw_path", UNSET) + raw_path: DatastoreM | Unset + if isinstance(_raw_path, Unset): + raw_path = UNSET + else: + raw_path = DatastoreM.from_dict(_raw_path) + + _raw_query = d.pop("raw_query", UNSET) + raw_query: DatastoreM | Unset + if isinstance(_raw_query, Unset): + raw_query = UNSET + else: + raw_query = DatastoreM.from_dict(_raw_query) + + subscription_id = d.pop("subscription_id", UNSET) + + uid = d.pop("uid", UNSET) + + models_filter_response = cls( + body=body, + enabled_at=enabled_at, + event_type=event_type, + headers=headers, + path=path, + query=query, + raw_body=raw_body, + raw_headers=raw_headers, + raw_path=raw_path, + raw_query=raw_query, + subscription_id=subscription_id, + uid=uid, + ) + + models_filter_response.additional_properties = d + return models_filter_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_filter_schema.py b/src/convoy/models/models_filter_schema.py new file mode 100644 index 0000000..ece2a14 --- /dev/null +++ b/src/convoy/models/models_filter_schema.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsFilterSchema") + + +@_attrs_define +class ModelsFilterSchema: + """ + Attributes: + body (Any | Unset): + header (Any | Unset): + path (Any | Unset): + query (Any | Unset): + """ + + body: Any | Unset = UNSET + header: Any | Unset = UNSET + path: Any | Unset = UNSET + query: Any | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + body = self.body + + header = self.header + + path = self.path + + query = self.query + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if body is not UNSET: + field_dict["body"] = body + if header is not UNSET: + field_dict["header"] = header + if path is not UNSET: + field_dict["path"] = path + if query is not UNSET: + field_dict["query"] = query + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + body = d.pop("body", UNSET) + + header = d.pop("header", UNSET) + + path = d.pop("path", UNSET) + + query = d.pop("query", UNSET) + + models_filter_schema = cls( + body=body, + header=header, + path=path, + query=query, + ) + + models_filter_schema.additional_properties = d + return models_filter_schema + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_fs.py b/src/convoy/models/models_fs.py new file mode 100644 index 0000000..b646e79 --- /dev/null +++ b/src/convoy/models/models_fs.py @@ -0,0 +1,122 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_m import DatastoreM + + +T = TypeVar("T", bound="ModelsFS") + + +@_attrs_define +class ModelsFS: + """ + Attributes: + body (DatastoreM | Unset): + headers (DatastoreM | Unset): + path (DatastoreM | Unset): + query (DatastoreM | Unset): + """ + + body: DatastoreM | Unset = UNSET + headers: DatastoreM | Unset = UNSET + path: DatastoreM | Unset = UNSET + query: DatastoreM | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + body: dict[str, Any] | Unset = UNSET + if not isinstance(self.body, Unset): + body = self.body.to_dict() + + headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.headers, Unset): + headers = self.headers.to_dict() + + path: dict[str, Any] | Unset = UNSET + if not isinstance(self.path, Unset): + path = self.path.to_dict() + + query: dict[str, Any] | Unset = UNSET + if not isinstance(self.query, Unset): + query = self.query.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if body is not UNSET: + field_dict["body"] = body + if headers is not UNSET: + field_dict["headers"] = headers + if path is not UNSET: + field_dict["path"] = path + if query is not UNSET: + field_dict["query"] = query + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_m import DatastoreM + + d = dict(src_dict) + _body = d.pop("body", UNSET) + body: DatastoreM | Unset + if isinstance(_body, Unset): + body = UNSET + else: + body = DatastoreM.from_dict(_body) + + _headers = d.pop("headers", UNSET) + headers: DatastoreM | Unset + if isinstance(_headers, Unset): + headers = UNSET + else: + headers = DatastoreM.from_dict(_headers) + + _path = d.pop("path", UNSET) + path: DatastoreM | Unset + if isinstance(_path, Unset): + path = UNSET + else: + path = DatastoreM.from_dict(_path) + + _query = d.pop("query", UNSET) + query: DatastoreM | Unset + if isinstance(_query, Unset): + query = UNSET + else: + query = DatastoreM.from_dict(_query) + + models_fs = cls( + body=body, + headers=headers, + path=path, + query=query, + ) + + models_fs.additional_properties = d + return models_fs + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_function_request.py b/src/convoy/models/models_function_request.py new file mode 100644 index 0000000..e120e29 --- /dev/null +++ b/src/convoy/models/models_function_request.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_function_request_payload import ModelsFunctionRequestPayload + + +T = TypeVar("T", bound="ModelsFunctionRequest") + + +@_attrs_define +class ModelsFunctionRequest: + """ + Attributes: + function (str | Unset): + payload (ModelsFunctionRequestPayload | Unset): + type_ (str | Unset): + """ + + function: str | Unset = UNSET + payload: ModelsFunctionRequestPayload | Unset = UNSET + type_: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + function = self.function + + payload: dict[str, Any] | Unset = UNSET + if not isinstance(self.payload, Unset): + payload = self.payload.to_dict() + + type_ = self.type_ + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if function is not UNSET: + field_dict["function"] = function + if payload is not UNSET: + field_dict["payload"] = payload + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_function_request_payload import ( + ModelsFunctionRequestPayload, + ) + + d = dict(src_dict) + function = d.pop("function", UNSET) + + _payload = d.pop("payload", UNSET) + payload: ModelsFunctionRequestPayload | Unset + if isinstance(_payload, Unset): + payload = UNSET + else: + payload = ModelsFunctionRequestPayload.from_dict(_payload) + + type_ = d.pop("type", UNSET) + + models_function_request = cls( + function=function, + payload=payload, + type_=type_, + ) + + models_function_request.additional_properties = d + return models_function_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_function_request_payload.py b/src/convoy/models/models_function_request_payload.py new file mode 100644 index 0000000..c81458b --- /dev/null +++ b/src/convoy/models/models_function_request_payload.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsFunctionRequestPayload") + + +@_attrs_define +class ModelsFunctionRequestPayload: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_function_request_payload = cls() + + models_function_request_payload.additional_properties = d + return models_function_request_payload + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_function_response.py b/src/convoy/models/models_function_response.py new file mode 100644 index 0000000..6157945 --- /dev/null +++ b/src/convoy/models/models_function_response.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsFunctionResponse") + + +@_attrs_define +class ModelsFunctionResponse: + """ + Attributes: + log (list[str] | Unset): + payload (Any | Unset): + """ + + log: list[str] | Unset = UNSET + payload: Any | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + log: list[str] | Unset = UNSET + if not isinstance(self.log, Unset): + log = self.log + + payload = self.payload + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if log is not UNSET: + field_dict["log"] = log + if payload is not UNSET: + field_dict["payload"] = payload + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + log = cast(list[str], d.pop("log", UNSET)) + + payload = d.pop("payload", UNSET) + + models_function_response = cls( + log=log, + payload=payload, + ) + + models_function_response.additional_properties = d + return models_function_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_google_pub_sub_config.py b/src/convoy/models/models_google_pub_sub_config.py new file mode 100644 index 0000000..9ede8e4 --- /dev/null +++ b/src/convoy/models/models_google_pub_sub_config.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsGooglePubSubConfig") + + +@_attrs_define +class ModelsGooglePubSubConfig: + """ + Attributes: + project_id (str | Unset): + service_account (list[int] | Unset): + subscription_id (str | Unset): + """ + + project_id: str | Unset = UNSET + service_account: list[int] | Unset = UNSET + subscription_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + project_id = self.project_id + + service_account: list[int] | Unset = UNSET + if not isinstance(self.service_account, Unset): + service_account = self.service_account + + subscription_id = self.subscription_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if project_id is not UNSET: + field_dict["project_id"] = project_id + if service_account is not UNSET: + field_dict["service_account"] = service_account + if subscription_id is not UNSET: + field_dict["subscription_id"] = subscription_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + project_id = d.pop("project_id", UNSET) + + service_account = cast(list[int], d.pop("service_account", UNSET)) + + subscription_id = d.pop("subscription_id", UNSET) + + models_google_pub_sub_config = cls( + project_id=project_id, + service_account=service_account, + subscription_id=subscription_id, + ) + + models_google_pub_sub_config.additional_properties = d + return models_google_pub_sub_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_h_mac.py b/src/convoy/models/models_h_mac.py new file mode 100644 index 0000000..0d71d18 --- /dev/null +++ b/src/convoy/models/models_h_mac.py @@ -0,0 +1,87 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_encoding_type import DatastoreEncodingType + +T = TypeVar("T", bound="ModelsHMac") + + +@_attrs_define +class ModelsHMac: + """ + Attributes: + encoding (DatastoreEncodingType): + hash_ (str): + header (str): + secret (str): + """ + + encoding: DatastoreEncodingType + hash_: str + header: str + secret: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + encoding = self.encoding.value + + hash_ = self.hash_ + + header = self.header + + secret = self.secret + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "encoding": encoding, + "hash": hash_, + "header": header, + "secret": secret, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + encoding = DatastoreEncodingType(d.pop("encoding")) + + hash_ = d.pop("hash") + + header = d.pop("header") + + secret = d.pop("secret") + + models_h_mac = cls( + encoding=encoding, + hash_=hash_, + header=header, + secret=secret, + ) + + models_h_mac.additional_properties = d + return models_h_mac + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_i_ds.py b/src/convoy/models/models_i_ds.py new file mode 100644 index 0000000..d8b88ad --- /dev/null +++ b/src/convoy/models/models_i_ds.py @@ -0,0 +1,63 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsIDs") + + +@_attrs_define +class ModelsIDs: + """ + Attributes: + ids (list[str] | Unset): A list of event delivery IDs to forcefully resend. + """ + + ids: list[str] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + ids: list[str] | Unset = UNSET + if not isinstance(self.ids, Unset): + ids = self.ids + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if ids is not UNSET: + field_dict["ids"] = ids + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + ids = cast(list[str], d.pop("ids", UNSET)) + + models_i_ds = cls( + ids=ids, + ) + + models_i_ds.additional_properties = d + return models_i_ds + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_import_open_api_spec.py b/src/convoy/models/models_import_open_api_spec.py new file mode 100644 index 0000000..8b224ab --- /dev/null +++ b/src/convoy/models/models_import_open_api_spec.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsImportOpenAPISpec") + + +@_attrs_define +class ModelsImportOpenAPISpec: + """ + Attributes: + spec (str | Unset): + """ + + spec: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + spec = self.spec + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if spec is not UNSET: + field_dict["spec"] = spec + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + spec = d.pop("spec", UNSET) + + models_import_open_api_spec = cls( + spec=spec, + ) + + models_import_open_api_spec.additional_properties = d + return models_import_open_api_spec + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_kafka_auth.py b/src/convoy/models/models_kafka_auth.py new file mode 100644 index 0000000..3713584 --- /dev/null +++ b/src/convoy/models/models_kafka_auth.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsKafkaAuth") + + +@_attrs_define +class ModelsKafkaAuth: + """ + Attributes: + hash_ (str | Unset): + password (str | Unset): + tls (bool | Unset): + type_ (str | Unset): + username (str | Unset): + """ + + hash_: str | Unset = UNSET + password: str | Unset = UNSET + tls: bool | Unset = UNSET + type_: str | Unset = UNSET + username: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + hash_ = self.hash_ + + password = self.password + + tls = self.tls + + type_ = self.type_ + + username = self.username + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if hash_ is not UNSET: + field_dict["hash"] = hash_ + if password is not UNSET: + field_dict["password"] = password + if tls is not UNSET: + field_dict["tls"] = tls + if type_ is not UNSET: + field_dict["type"] = type_ + if username is not UNSET: + field_dict["username"] = username + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + hash_ = d.pop("hash", UNSET) + + password = d.pop("password", UNSET) + + tls = d.pop("tls", UNSET) + + type_ = d.pop("type", UNSET) + + username = d.pop("username", UNSET) + + models_kafka_auth = cls( + hash_=hash_, + password=password, + tls=tls, + type_=type_, + username=username, + ) + + models_kafka_auth.additional_properties = d + return models_kafka_auth + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_kafka_pub_sub_config.py b/src/convoy/models/models_kafka_pub_sub_config.py new file mode 100644 index 0000000..0bf020c --- /dev/null +++ b/src/convoy/models/models_kafka_pub_sub_config.py @@ -0,0 +1,103 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_kafka_auth import ModelsKafkaAuth + + +T = TypeVar("T", bound="ModelsKafkaPubSubConfig") + + +@_attrs_define +class ModelsKafkaPubSubConfig: + """ + Attributes: + auth (ModelsKafkaAuth | Unset): + brokers (list[str] | Unset): + consumer_group_id (str | Unset): + topic_name (str | Unset): + """ + + auth: ModelsKafkaAuth | Unset = UNSET + brokers: list[str] | Unset = UNSET + consumer_group_id: str | Unset = UNSET + topic_name: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + auth: dict[str, Any] | Unset = UNSET + if not isinstance(self.auth, Unset): + auth = self.auth.to_dict() + + brokers: list[str] | Unset = UNSET + if not isinstance(self.brokers, Unset): + brokers = self.brokers + + consumer_group_id = self.consumer_group_id + + topic_name = self.topic_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if auth is not UNSET: + field_dict["auth"] = auth + if brokers is not UNSET: + field_dict["brokers"] = brokers + if consumer_group_id is not UNSET: + field_dict["consumer_group_id"] = consumer_group_id + if topic_name is not UNSET: + field_dict["topic_name"] = topic_name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_kafka_auth import ModelsKafkaAuth + + d = dict(src_dict) + _auth = d.pop("auth", UNSET) + auth: ModelsKafkaAuth | Unset + if isinstance(_auth, Unset): + auth = UNSET + else: + auth = ModelsKafkaAuth.from_dict(_auth) + + brokers = cast(list[str], d.pop("brokers", UNSET)) + + consumer_group_id = d.pop("consumer_group_id", UNSET) + + topic_name = d.pop("topic_name", UNSET) + + models_kafka_pub_sub_config = cls( + auth=auth, + brokers=brokers, + consumer_group_id=consumer_group_id, + topic_name=topic_name, + ) + + models_kafka_pub_sub_config.additional_properties = d + return models_kafka_pub_sub_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_meta_event_configuration.py b/src/convoy/models/models_meta_event_configuration.py new file mode 100644 index 0000000..998f206 --- /dev/null +++ b/src/convoy/models/models_meta_event_configuration.py @@ -0,0 +1,99 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsMetaEventConfiguration") + + +@_attrs_define +class ModelsMetaEventConfiguration: + """ + Attributes: + event_type (list[str] | Unset): + is_enabled (bool | Unset): + secret (str | Unset): + type_ (str | Unset): + url (str | Unset): + """ + + event_type: list[str] | Unset = UNSET + is_enabled: bool | Unset = UNSET + secret: str | Unset = UNSET + type_: str | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + event_type: list[str] | Unset = UNSET + if not isinstance(self.event_type, Unset): + event_type = self.event_type + + is_enabled = self.is_enabled + + secret = self.secret + + type_ = self.type_ + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if event_type is not UNSET: + field_dict["event_type"] = event_type + if is_enabled is not UNSET: + field_dict["is_enabled"] = is_enabled + if secret is not UNSET: + field_dict["secret"] = secret + if type_ is not UNSET: + field_dict["type"] = type_ + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event_type = cast(list[str], d.pop("event_type", UNSET)) + + is_enabled = d.pop("is_enabled", UNSET) + + secret = d.pop("secret", UNSET) + + type_ = d.pop("type", UNSET) + + url = d.pop("url", UNSET) + + models_meta_event_configuration = cls( + event_type=event_type, + is_enabled=is_enabled, + secret=secret, + type_=type_, + url=url, + ) + + models_meta_event_configuration.additional_properties = d + return models_meta_event_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_meta_event_response.py b/src/convoy/models/models_meta_event_response.py new file mode 100644 index 0000000..f243057 --- /dev/null +++ b/src/convoy/models/models_meta_event_response.py @@ -0,0 +1,163 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_event_delivery_status import DatastoreEventDeliveryStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_meta_event_attempt import DatastoreMetaEventAttempt + from ..models.datastore_metadata import DatastoreMetadata + + +T = TypeVar("T", bound="ModelsMetaEventResponse") + + +@_attrs_define +class ModelsMetaEventResponse: + """ + Attributes: + attempt (DatastoreMetaEventAttempt | Unset): + created_at (str | Unset): + deleted_at (str | Unset): + event_type (str | Unset): + metadata (DatastoreMetadata | Unset): + project_id (str | Unset): + status (DatastoreEventDeliveryStatus | Unset): + uid (str | Unset): + updated_at (str | Unset): + """ + + attempt: DatastoreMetaEventAttempt | Unset = UNSET + created_at: str | Unset = UNSET + deleted_at: str | Unset = UNSET + event_type: str | Unset = UNSET + metadata: DatastoreMetadata | Unset = UNSET + project_id: str | Unset = UNSET + status: DatastoreEventDeliveryStatus | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + attempt: dict[str, Any] | Unset = UNSET + if not isinstance(self.attempt, Unset): + attempt = self.attempt.to_dict() + + created_at = self.created_at + + deleted_at = self.deleted_at + + event_type = self.event_type + + metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.metadata, Unset): + metadata = self.metadata.to_dict() + + project_id = self.project_id + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + uid = self.uid + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if attempt is not UNSET: + field_dict["attempt"] = attempt + if created_at is not UNSET: + field_dict["created_at"] = created_at + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if event_type is not UNSET: + field_dict["event_type"] = event_type + if metadata is not UNSET: + field_dict["metadata"] = metadata + if project_id is not UNSET: + field_dict["project_id"] = project_id + if status is not UNSET: + field_dict["status"] = status + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_meta_event_attempt import DatastoreMetaEventAttempt + from ..models.datastore_metadata import DatastoreMetadata + + d = dict(src_dict) + _attempt = d.pop("attempt", UNSET) + attempt: DatastoreMetaEventAttempt | Unset + if isinstance(_attempt, Unset): + attempt = UNSET + else: + attempt = DatastoreMetaEventAttempt.from_dict(_attempt) + + created_at = d.pop("created_at", UNSET) + + deleted_at = d.pop("deleted_at", UNSET) + + event_type = d.pop("event_type", UNSET) + + _metadata = d.pop("metadata", UNSET) + metadata: DatastoreMetadata | Unset + if isinstance(_metadata, Unset): + metadata = UNSET + else: + metadata = DatastoreMetadata.from_dict(_metadata) + + project_id = d.pop("project_id", UNSET) + + _status = d.pop("status", UNSET) + status: DatastoreEventDeliveryStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = DatastoreEventDeliveryStatus(_status) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + models_meta_event_response = cls( + attempt=attempt, + created_at=created_at, + deleted_at=deleted_at, + event_type=event_type, + metadata=metadata, + project_id=project_id, + status=status, + uid=uid, + updated_at=updated_at, + ) + + models_meta_event_response.additional_properties = d + return models_meta_event_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_mtls_client_cert.py b/src/convoy/models/models_mtls_client_cert.py new file mode 100644 index 0000000..834fe08 --- /dev/null +++ b/src/convoy/models/models_mtls_client_cert.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsMtlsClientCert") + + +@_attrs_define +class ModelsMtlsClientCert: + """ + Attributes: + client_cert (str | Unset): ClientCert is the client certificate PEM string + client_key (str | Unset): ClientKey is the client private key PEM string + """ + + client_cert: str | Unset = UNSET + client_key: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + client_cert = self.client_cert + + client_key = self.client_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if client_cert is not UNSET: + field_dict["client_cert"] = client_cert + if client_key is not UNSET: + field_dict["client_key"] = client_key + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + client_cert = d.pop("client_cert", UNSET) + + client_key = d.pop("client_key", UNSET) + + models_mtls_client_cert = cls( + client_cert=client_cert, + client_key=client_key, + ) + + models_mtls_client_cert.additional_properties = d + return models_mtls_client_cert + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_o_auth_2.py b/src/convoy/models/models_o_auth_2.py new file mode 100644 index 0000000..bbcea62 --- /dev/null +++ b/src/convoy/models/models_o_auth_2.py @@ -0,0 +1,191 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_o_auth_2_field_mapping import ModelsOAuth2FieldMapping + from ..models.models_o_auth_2_signing_key import ModelsOAuth2SigningKey + + +T = TypeVar("T", bound="ModelsOAuth2") + + +@_attrs_define +class ModelsOAuth2: + """ + Attributes: + audience (str | Unset): + authentication_type (str | Unset): + client_id (str | Unset): + client_secret (str | Unset): + expiry_time_unit (str | Unset): Expiry time unit (seconds, milliseconds, minutes, hours) + field_mapping (ModelsOAuth2FieldMapping | Unset): + grant_type (str | Unset): + issuer (str | Unset): + scope (str | Unset): + signing_algorithm (str | Unset): + signing_key (ModelsOAuth2SigningKey | Unset): + subject (str | Unset): + url (str | Unset): + """ + + audience: str | Unset = UNSET + authentication_type: str | Unset = UNSET + client_id: str | Unset = UNSET + client_secret: str | Unset = UNSET + expiry_time_unit: str | Unset = UNSET + field_mapping: ModelsOAuth2FieldMapping | Unset = UNSET + grant_type: str | Unset = UNSET + issuer: str | Unset = UNSET + scope: str | Unset = UNSET + signing_algorithm: str | Unset = UNSET + signing_key: ModelsOAuth2SigningKey | Unset = UNSET + subject: str | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + audience = self.audience + + authentication_type = self.authentication_type + + client_id = self.client_id + + client_secret = self.client_secret + + expiry_time_unit = self.expiry_time_unit + + field_mapping: dict[str, Any] | Unset = UNSET + if not isinstance(self.field_mapping, Unset): + field_mapping = self.field_mapping.to_dict() + + grant_type = self.grant_type + + issuer = self.issuer + + scope = self.scope + + signing_algorithm = self.signing_algorithm + + signing_key: dict[str, Any] | Unset = UNSET + if not isinstance(self.signing_key, Unset): + signing_key = self.signing_key.to_dict() + + subject = self.subject + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if audience is not UNSET: + field_dict["audience"] = audience + if authentication_type is not UNSET: + field_dict["authentication_type"] = authentication_type + if client_id is not UNSET: + field_dict["client_id"] = client_id + if client_secret is not UNSET: + field_dict["client_secret"] = client_secret + if expiry_time_unit is not UNSET: + field_dict["expiry_time_unit"] = expiry_time_unit + if field_mapping is not UNSET: + field_dict["field_mapping"] = field_mapping + if grant_type is not UNSET: + field_dict["grant_type"] = grant_type + if issuer is not UNSET: + field_dict["issuer"] = issuer + if scope is not UNSET: + field_dict["scope"] = scope + if signing_algorithm is not UNSET: + field_dict["signing_algorithm"] = signing_algorithm + if signing_key is not UNSET: + field_dict["signing_key"] = signing_key + if subject is not UNSET: + field_dict["subject"] = subject + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_o_auth_2_field_mapping import ModelsOAuth2FieldMapping + from ..models.models_o_auth_2_signing_key import ModelsOAuth2SigningKey + + d = dict(src_dict) + audience = d.pop("audience", UNSET) + + authentication_type = d.pop("authentication_type", UNSET) + + client_id = d.pop("client_id", UNSET) + + client_secret = d.pop("client_secret", UNSET) + + expiry_time_unit = d.pop("expiry_time_unit", UNSET) + + _field_mapping = d.pop("field_mapping", UNSET) + field_mapping: ModelsOAuth2FieldMapping | Unset + if isinstance(_field_mapping, Unset): + field_mapping = UNSET + else: + field_mapping = ModelsOAuth2FieldMapping.from_dict(_field_mapping) + + grant_type = d.pop("grant_type", UNSET) + + issuer = d.pop("issuer", UNSET) + + scope = d.pop("scope", UNSET) + + signing_algorithm = d.pop("signing_algorithm", UNSET) + + _signing_key = d.pop("signing_key", UNSET) + signing_key: ModelsOAuth2SigningKey | Unset + if isinstance(_signing_key, Unset): + signing_key = UNSET + else: + signing_key = ModelsOAuth2SigningKey.from_dict(_signing_key) + + subject = d.pop("subject", UNSET) + + url = d.pop("url", UNSET) + + models_o_auth_2 = cls( + audience=audience, + authentication_type=authentication_type, + client_id=client_id, + client_secret=client_secret, + expiry_time_unit=expiry_time_unit, + field_mapping=field_mapping, + grant_type=grant_type, + issuer=issuer, + scope=scope, + signing_algorithm=signing_algorithm, + signing_key=signing_key, + subject=subject, + url=url, + ) + + models_o_auth_2.additional_properties = d + return models_o_auth_2 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_o_auth_2_field_mapping.py b/src/convoy/models/models_o_auth_2_field_mapping.py new file mode 100644 index 0000000..058be2d --- /dev/null +++ b/src/convoy/models/models_o_auth_2_field_mapping.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsOAuth2FieldMapping") + + +@_attrs_define +class ModelsOAuth2FieldMapping: + """ + Attributes: + access_token (str | Unset): Field name for access token (e.g., "accessToken", "access_token", "token") + expires_in (str | Unset): Field name for expiry time (e.g., "expiresIn", "expires_in", "expiresAt") + token_type (str | Unset): Field name for token type (e.g., "tokenType", "token_type") + """ + + access_token: str | Unset = UNSET + expires_in: str | Unset = UNSET + token_type: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + access_token = self.access_token + + expires_in = self.expires_in + + token_type = self.token_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if access_token is not UNSET: + field_dict["access_token"] = access_token + if expires_in is not UNSET: + field_dict["expires_in"] = expires_in + if token_type is not UNSET: + field_dict["token_type"] = token_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + access_token = d.pop("access_token", UNSET) + + expires_in = d.pop("expires_in", UNSET) + + token_type = d.pop("token_type", UNSET) + + models_o_auth_2_field_mapping = cls( + access_token=access_token, + expires_in=expires_in, + token_type=token_type, + ) + + models_o_auth_2_field_mapping.additional_properties = d + return models_o_auth_2_field_mapping + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_o_auth_2_signing_key.py b/src/convoy/models/models_o_auth_2_signing_key.py new file mode 100644 index 0000000..9899afd --- /dev/null +++ b/src/convoy/models/models_o_auth_2_signing_key.py @@ -0,0 +1,169 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsOAuth2SigningKey") + + +@_attrs_define +class ModelsOAuth2SigningKey: + """ + Attributes: + crv (str | Unset): EC (Elliptic Curve) key fields + d (str | Unset): Private key (EC) or private exponent (RSA) + dp (str | Unset): RSA first factor CRT exponent (RSA private key only) + dq (str | Unset): RSA second factor CRT exponent (RSA private key only) + e (str | Unset): RSA public exponent (RSA only) + kid (str | Unset): Key ID + kty (str | Unset): Key type: "EC" or "RSA" + n (str | Unset): RSA key fields + p (str | Unset): RSA first prime factor (RSA private key only) + q (str | Unset): RSA second prime factor (RSA private key only) + qi (str | Unset): RSA first CRT coefficient (RSA private key only) + x (str | Unset): X coordinate (EC only) + y (str | Unset): Y coordinate (EC only) + """ + + crv: str | Unset = UNSET + d: str | Unset = UNSET + dp: str | Unset = UNSET + dq: str | Unset = UNSET + e: str | Unset = UNSET + kid: str | Unset = UNSET + kty: str | Unset = UNSET + n: str | Unset = UNSET + p: str | Unset = UNSET + q: str | Unset = UNSET + qi: str | Unset = UNSET + x: str | Unset = UNSET + y: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + crv = self.crv + + d = self.d + + dp = self.dp + + dq = self.dq + + e = self.e + + kid = self.kid + + kty = self.kty + + n = self.n + + p = self.p + + q = self.q + + qi = self.qi + + x = self.x + + y = self.y + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if crv is not UNSET: + field_dict["crv"] = crv + if d is not UNSET: + field_dict["d"] = d + if dp is not UNSET: + field_dict["dp"] = dp + if dq is not UNSET: + field_dict["dq"] = dq + if e is not UNSET: + field_dict["e"] = e + if kid is not UNSET: + field_dict["kid"] = kid + if kty is not UNSET: + field_dict["kty"] = kty + if n is not UNSET: + field_dict["n"] = n + if p is not UNSET: + field_dict["p"] = p + if q is not UNSET: + field_dict["q"] = q + if qi is not UNSET: + field_dict["qi"] = qi + if x is not UNSET: + field_dict["x"] = x + if y is not UNSET: + field_dict["y"] = y + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + crv = d.pop("crv", UNSET) + + d = d.pop("d", UNSET) + + dp = d.pop("dp", UNSET) + + dq = d.pop("dq", UNSET) + + e = d.pop("e", UNSET) + + kid = d.pop("kid", UNSET) + + kty = d.pop("kty", UNSET) + + n = d.pop("n", UNSET) + + p = d.pop("p", UNSET) + + q = d.pop("q", UNSET) + + qi = d.pop("qi", UNSET) + + x = d.pop("x", UNSET) + + y = d.pop("y", UNSET) + + models_o_auth_2_signing_key = cls( + crv=crv, + d=d, + dp=dp, + dq=dq, + e=e, + kid=kid, + kty=kty, + n=n, + p=p, + q=q, + qi=qi, + x=x, + y=y, + ) + + models_o_auth_2_signing_key.additional_properties = d + return models_o_auth_2_signing_key + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_onboard_item.py b/src/convoy/models/models_onboard_item.py new file mode 100644 index 0000000..4f3af76 --- /dev/null +++ b/src/convoy/models/models_onboard_item.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsOnboardItem") + + +@_attrs_define +class ModelsOnboardItem: + """ + Attributes: + auth_password (str | Unset): + auth_username (str | Unset): + event_type (str | Unset): + name (str | Unset): + url (str | Unset): + """ + + auth_password: str | Unset = UNSET + auth_username: str | Unset = UNSET + event_type: str | Unset = UNSET + name: str | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + auth_password = self.auth_password + + auth_username = self.auth_username + + event_type = self.event_type + + name = self.name + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if auth_password is not UNSET: + field_dict["auth_password"] = auth_password + if auth_username is not UNSET: + field_dict["auth_username"] = auth_username + if event_type is not UNSET: + field_dict["event_type"] = event_type + if name is not UNSET: + field_dict["name"] = name + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + auth_password = d.pop("auth_password", UNSET) + + auth_username = d.pop("auth_username", UNSET) + + event_type = d.pop("event_type", UNSET) + + name = d.pop("name", UNSET) + + url = d.pop("url", UNSET) + + models_onboard_item = cls( + auth_password=auth_password, + auth_username=auth_username, + event_type=event_type, + name=name, + url=url, + ) + + models_onboard_item.additional_properties = d + return models_onboard_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_onboard_validation_error.py b/src/convoy/models/models_onboard_validation_error.py new file mode 100644 index 0000000..0fa7a52 --- /dev/null +++ b/src/convoy/models/models_onboard_validation_error.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsOnboardValidationError") + + +@_attrs_define +class ModelsOnboardValidationError: + """ + Attributes: + field (str | Unset): + message (str | Unset): + row (int | Unset): + """ + + field: str | Unset = UNSET + message: str | Unset = UNSET + row: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + field = self.field + + message = self.message + + row = self.row + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if field is not UNSET: + field_dict["field"] = field + if message is not UNSET: + field_dict["message"] = message + if row is not UNSET: + field_dict["row"] = row + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + field = d.pop("field", UNSET) + + message = d.pop("message", UNSET) + + row = d.pop("row", UNSET) + + models_onboard_validation_error = cls( + field=field, + message=message, + row=row, + ) + + models_onboard_validation_error.additional_properties = d + return models_onboard_validation_error + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_optional_time.py b/src/convoy/models/models_optional_time.py new file mode 100644 index 0000000..9771917 --- /dev/null +++ b/src/convoy/models/models_optional_time.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsOptionalTime") + + +@_attrs_define +class ModelsOptionalTime: + """ + Attributes: + set_ (bool | Unset): + time (str | Unset): + """ + + set_: bool | Unset = UNSET + time: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + set_ = self.set_ + + time = self.time + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if set_ is not UNSET: + field_dict["set"] = set_ + if time is not UNSET: + field_dict["time"] = time + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + set_ = d.pop("set", UNSET) + + time = d.pop("time", UNSET) + + models_optional_time = cls( + set_=set_, + time=time, + ) + + models_optional_time.additional_properties = d + return models_optional_time + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_paged_response.py b/src/convoy/models/models_paged_response.py new file mode 100644 index 0000000..f07f065 --- /dev/null +++ b/src/convoy/models/models_paged_response.py @@ -0,0 +1,99 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_pagination_data import DatastorePaginationData + + +T = TypeVar("T", bound="ModelsPagedResponse") + + +@_attrs_define +class ModelsPagedResponse: + """ + Attributes: + content (Any | Unset): + pagination (DatastorePaginationData | None | Unset): + """ + + content: Any | Unset = UNSET + pagination: DatastorePaginationData | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.datastore_pagination_data import DatastorePaginationData + + content = self.content + + pagination: dict[str, Any] | None | Unset + if isinstance(self.pagination, Unset): + pagination = UNSET + elif isinstance(self.pagination, DatastorePaginationData): + pagination = self.pagination.to_dict() + else: + pagination = self.pagination + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if content is not UNSET: + field_dict["content"] = content + if pagination is not UNSET: + field_dict["pagination"] = pagination + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_pagination_data import DatastorePaginationData + + d = dict(src_dict) + content = d.pop("content", UNSET) + + def _parse_pagination(data: object) -> DatastorePaginationData | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + pagination_type_1 = DatastorePaginationData.from_dict(data) + + return pagination_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DatastorePaginationData | None | Unset, data) + + pagination = _parse_pagination(d.pop("pagination", UNSET)) + + models_paged_response = cls( + content=content, + pagination=pagination, + ) + + models_paged_response.additional_properties = d + return models_paged_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_project_config.py b/src/convoy/models/models_project_config.py new file mode 100644 index 0000000..99568fd --- /dev/null +++ b/src/convoy/models/models_project_config.py @@ -0,0 +1,261 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.config_request_id_header_provider import ConfigRequestIDHeaderProvider +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_circuit_breaker_configuration import ( + DatastoreCircuitBreakerConfiguration, + ) + from ..models.models_meta_event_configuration import ModelsMetaEventConfiguration + from ..models.models_rate_limit_configuration import ModelsRateLimitConfiguration + from ..models.models_signature_configuration import ModelsSignatureConfiguration + from ..models.models_ssl_configuration import ModelsSSLConfiguration + from ..models.models_strategy_configuration import ModelsStrategyConfiguration + + +T = TypeVar("T", bound="ModelsProjectConfig") + + +@_attrs_define +class ModelsProjectConfig: + """ + Attributes: + add_event_id_trace_headers (bool | Unset): Controls of the Event ID and Event Delivery ID Headers are added to + the request when events are dispatched to endpoints + circuit_breaker (DatastoreCircuitBreakerConfiguration | Unset): + disable_endpoint (bool | Unset): Controls if the project will disable and endpoint after the retry threshold for + an event is reached + max_payload_read_size (int | Unset): Specifies how many bytes and incoming project should read from the ingest + request, and how many bytes an outgoing project should from the response of your endpoints + Defaults to 50KB. + meta_event (ModelsMetaEventConfiguration | Unset): + multiple_endpoint_subscriptions (bool | Unset): MultipleEndpointSubscriptions is used to configure if multiple + subscriptions + can be created for the endpoint in a project + ratelimit (ModelsRateLimitConfiguration | Unset): + replay_attacks_prevention_enabled (bool | Unset): Controls if your project will add a timestamp to it's webhook + signature header to prevent a replay attack, See this blog post[https://getconvoy.io/blog/generating-stripe- + like-webhook-signatures] for more] + request_id_header (ConfigRequestIDHeaderProvider | Unset): + search_policy (str | Unset): Specify the interval in hours for which the event tokenizer runs + signature (ModelsSignatureConfiguration | Unset): + ssl (ModelsSSLConfiguration | Unset): + strategy (ModelsStrategyConfiguration | Unset): + """ + + add_event_id_trace_headers: bool | Unset = UNSET + circuit_breaker: DatastoreCircuitBreakerConfiguration | Unset = UNSET + disable_endpoint: bool | Unset = UNSET + max_payload_read_size: int | Unset = UNSET + meta_event: ModelsMetaEventConfiguration | Unset = UNSET + multiple_endpoint_subscriptions: bool | Unset = UNSET + ratelimit: ModelsRateLimitConfiguration | Unset = UNSET + replay_attacks_prevention_enabled: bool | Unset = UNSET + request_id_header: ConfigRequestIDHeaderProvider | Unset = UNSET + search_policy: str | Unset = UNSET + signature: ModelsSignatureConfiguration | Unset = UNSET + ssl: ModelsSSLConfiguration | Unset = UNSET + strategy: ModelsStrategyConfiguration | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + add_event_id_trace_headers = self.add_event_id_trace_headers + + circuit_breaker: dict[str, Any] | Unset = UNSET + if not isinstance(self.circuit_breaker, Unset): + circuit_breaker = self.circuit_breaker.to_dict() + + disable_endpoint = self.disable_endpoint + + max_payload_read_size = self.max_payload_read_size + + meta_event: dict[str, Any] | Unset = UNSET + if not isinstance(self.meta_event, Unset): + meta_event = self.meta_event.to_dict() + + multiple_endpoint_subscriptions = self.multiple_endpoint_subscriptions + + ratelimit: dict[str, Any] | Unset = UNSET + if not isinstance(self.ratelimit, Unset): + ratelimit = self.ratelimit.to_dict() + + replay_attacks_prevention_enabled = self.replay_attacks_prevention_enabled + + request_id_header: str | Unset = UNSET + if not isinstance(self.request_id_header, Unset): + request_id_header = self.request_id_header.value + + search_policy = self.search_policy + + signature: dict[str, Any] | Unset = UNSET + if not isinstance(self.signature, Unset): + signature = self.signature.to_dict() + + ssl: dict[str, Any] | Unset = UNSET + if not isinstance(self.ssl, Unset): + ssl = self.ssl.to_dict() + + strategy: dict[str, Any] | Unset = UNSET + if not isinstance(self.strategy, Unset): + strategy = self.strategy.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if add_event_id_trace_headers is not UNSET: + field_dict["add_event_id_trace_headers"] = add_event_id_trace_headers + if circuit_breaker is not UNSET: + field_dict["circuit_breaker"] = circuit_breaker + if disable_endpoint is not UNSET: + field_dict["disable_endpoint"] = disable_endpoint + if max_payload_read_size is not UNSET: + field_dict["max_payload_read_size"] = max_payload_read_size + if meta_event is not UNSET: + field_dict["meta_event"] = meta_event + if multiple_endpoint_subscriptions is not UNSET: + field_dict["multiple_endpoint_subscriptions"] = ( + multiple_endpoint_subscriptions + ) + if ratelimit is not UNSET: + field_dict["ratelimit"] = ratelimit + if replay_attacks_prevention_enabled is not UNSET: + field_dict["replay_attacks_prevention_enabled"] = ( + replay_attacks_prevention_enabled + ) + if request_id_header is not UNSET: + field_dict["request_id_header"] = request_id_header + if search_policy is not UNSET: + field_dict["search_policy"] = search_policy + if signature is not UNSET: + field_dict["signature"] = signature + if ssl is not UNSET: + field_dict["ssl"] = ssl + if strategy is not UNSET: + field_dict["strategy"] = strategy + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_circuit_breaker_configuration import ( + DatastoreCircuitBreakerConfiguration, + ) + from ..models.models_meta_event_configuration import ( + ModelsMetaEventConfiguration, + ) + from ..models.models_rate_limit_configuration import ( + ModelsRateLimitConfiguration, + ) + from ..models.models_signature_configuration import ModelsSignatureConfiguration + from ..models.models_ssl_configuration import ModelsSSLConfiguration + from ..models.models_strategy_configuration import ModelsStrategyConfiguration + + d = dict(src_dict) + add_event_id_trace_headers = d.pop("add_event_id_trace_headers", UNSET) + + _circuit_breaker = d.pop("circuit_breaker", UNSET) + circuit_breaker: DatastoreCircuitBreakerConfiguration | Unset + if isinstance(_circuit_breaker, Unset): + circuit_breaker = UNSET + else: + circuit_breaker = DatastoreCircuitBreakerConfiguration.from_dict( + _circuit_breaker + ) + + disable_endpoint = d.pop("disable_endpoint", UNSET) + + max_payload_read_size = d.pop("max_payload_read_size", UNSET) + + _meta_event = d.pop("meta_event", UNSET) + meta_event: ModelsMetaEventConfiguration | Unset + if isinstance(_meta_event, Unset): + meta_event = UNSET + else: + meta_event = ModelsMetaEventConfiguration.from_dict(_meta_event) + + multiple_endpoint_subscriptions = d.pop( + "multiple_endpoint_subscriptions", UNSET + ) + + _ratelimit = d.pop("ratelimit", UNSET) + ratelimit: ModelsRateLimitConfiguration | Unset + if isinstance(_ratelimit, Unset): + ratelimit = UNSET + else: + ratelimit = ModelsRateLimitConfiguration.from_dict(_ratelimit) + + replay_attacks_prevention_enabled = d.pop( + "replay_attacks_prevention_enabled", UNSET + ) + + _request_id_header = d.pop("request_id_header", UNSET) + request_id_header: ConfigRequestIDHeaderProvider | Unset + if isinstance(_request_id_header, Unset): + request_id_header = UNSET + else: + request_id_header = ConfigRequestIDHeaderProvider(_request_id_header) + + search_policy = d.pop("search_policy", UNSET) + + _signature = d.pop("signature", UNSET) + signature: ModelsSignatureConfiguration | Unset + if isinstance(_signature, Unset): + signature = UNSET + else: + signature = ModelsSignatureConfiguration.from_dict(_signature) + + _ssl = d.pop("ssl", UNSET) + ssl: ModelsSSLConfiguration | Unset + if isinstance(_ssl, Unset): + ssl = UNSET + else: + ssl = ModelsSSLConfiguration.from_dict(_ssl) + + _strategy = d.pop("strategy", UNSET) + strategy: ModelsStrategyConfiguration | Unset + if isinstance(_strategy, Unset): + strategy = UNSET + else: + strategy = ModelsStrategyConfiguration.from_dict(_strategy) + + models_project_config = cls( + add_event_id_trace_headers=add_event_id_trace_headers, + circuit_breaker=circuit_breaker, + disable_endpoint=disable_endpoint, + max_payload_read_size=max_payload_read_size, + meta_event=meta_event, + multiple_endpoint_subscriptions=multiple_endpoint_subscriptions, + ratelimit=ratelimit, + replay_attacks_prevention_enabled=replay_attacks_prevention_enabled, + request_id_header=request_id_header, + search_policy=search_policy, + signature=signature, + ssl=ssl, + strategy=strategy, + ) + + models_project_config.additional_properties = d + return models_project_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_project_response.py b/src/convoy/models/models_project_response.py new file mode 100644 index 0000000..0363eab --- /dev/null +++ b/src/convoy/models/models_project_response.py @@ -0,0 +1,181 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_project_type import DatastoreProjectType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_project_config import DatastoreProjectConfig + from ..models.datastore_project_statistics import DatastoreProjectStatistics + + +T = TypeVar("T", bound="ModelsProjectResponse") + + +@_attrs_define +class ModelsProjectResponse: + """ + Attributes: + config (DatastoreProjectConfig | Unset): + created_at (str | Unset): + deleted_at (str | Unset): + logo_url (str | Unset): + name (str | Unset): + organisation_id (str | Unset): + retained_events (int | Unset): + statistics (DatastoreProjectStatistics | Unset): + type_ (DatastoreProjectType | Unset): + uid (str | Unset): + updated_at (str | Unset): + """ + + config: DatastoreProjectConfig | Unset = UNSET + created_at: str | Unset = UNSET + deleted_at: str | Unset = UNSET + logo_url: str | Unset = UNSET + name: str | Unset = UNSET + organisation_id: str | Unset = UNSET + retained_events: int | Unset = UNSET + statistics: DatastoreProjectStatistics | Unset = UNSET + type_: DatastoreProjectType | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + config: dict[str, Any] | Unset = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + created_at = self.created_at + + deleted_at = self.deleted_at + + logo_url = self.logo_url + + name = self.name + + organisation_id = self.organisation_id + + retained_events = self.retained_events + + statistics: dict[str, Any] | Unset = UNSET + if not isinstance(self.statistics, Unset): + statistics = self.statistics.to_dict() + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + uid = self.uid + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if config is not UNSET: + field_dict["config"] = config + if created_at is not UNSET: + field_dict["created_at"] = created_at + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if logo_url is not UNSET: + field_dict["logo_url"] = logo_url + if name is not UNSET: + field_dict["name"] = name + if organisation_id is not UNSET: + field_dict["organisation_id"] = organisation_id + if retained_events is not UNSET: + field_dict["retained_events"] = retained_events + if statistics is not UNSET: + field_dict["statistics"] = statistics + if type_ is not UNSET: + field_dict["type"] = type_ + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_project_config import DatastoreProjectConfig + from ..models.datastore_project_statistics import DatastoreProjectStatistics + + d = dict(src_dict) + _config = d.pop("config", UNSET) + config: DatastoreProjectConfig | Unset + if isinstance(_config, Unset): + config = UNSET + else: + config = DatastoreProjectConfig.from_dict(_config) + + created_at = d.pop("created_at", UNSET) + + deleted_at = d.pop("deleted_at", UNSET) + + logo_url = d.pop("logo_url", UNSET) + + name = d.pop("name", UNSET) + + organisation_id = d.pop("organisation_id", UNSET) + + retained_events = d.pop("retained_events", UNSET) + + _statistics = d.pop("statistics", UNSET) + statistics: DatastoreProjectStatistics | Unset + if isinstance(_statistics, Unset): + statistics = UNSET + else: + statistics = DatastoreProjectStatistics.from_dict(_statistics) + + _type_ = d.pop("type", UNSET) + type_: DatastoreProjectType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastoreProjectType(_type_) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + models_project_response = cls( + config=config, + created_at=created_at, + deleted_at=deleted_at, + logo_url=logo_url, + name=name, + organisation_id=organisation_id, + retained_events=retained_events, + statistics=statistics, + type_=type_, + uid=uid, + updated_at=updated_at, + ) + + models_project_response.additional_properties = d + return models_project_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_pub_sub_config.py b/src/convoy/models/models_pub_sub_config.py new file mode 100644 index 0000000..91dd01f --- /dev/null +++ b/src/convoy/models/models_pub_sub_config.py @@ -0,0 +1,154 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_pub_sub_type import DatastorePubSubType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_amqp_pub_subconfig import ModelsAmqpPubSubconfig + from ..models.models_google_pub_sub_config import ModelsGooglePubSubConfig + from ..models.models_kafka_pub_sub_config import ModelsKafkaPubSubConfig + from ..models.models_sqs_pub_sub_config import ModelsSQSPubSubConfig + + +T = TypeVar("T", bound="ModelsPubSubConfig") + + +@_attrs_define +class ModelsPubSubConfig: + """ + Attributes: + amqp (ModelsAmqpPubSubconfig | Unset): + google (ModelsGooglePubSubConfig | Unset): + kafka (ModelsKafkaPubSubConfig | Unset): + sqs (ModelsSQSPubSubConfig | Unset): + type_ (DatastorePubSubType | Unset): + workers (int | Unset): + """ + + amqp: ModelsAmqpPubSubconfig | Unset = UNSET + google: ModelsGooglePubSubConfig | Unset = UNSET + kafka: ModelsKafkaPubSubConfig | Unset = UNSET + sqs: ModelsSQSPubSubConfig | Unset = UNSET + type_: DatastorePubSubType | Unset = UNSET + workers: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + amqp: dict[str, Any] | Unset = UNSET + if not isinstance(self.amqp, Unset): + amqp = self.amqp.to_dict() + + google: dict[str, Any] | Unset = UNSET + if not isinstance(self.google, Unset): + google = self.google.to_dict() + + kafka: dict[str, Any] | Unset = UNSET + if not isinstance(self.kafka, Unset): + kafka = self.kafka.to_dict() + + sqs: dict[str, Any] | Unset = UNSET + if not isinstance(self.sqs, Unset): + sqs = self.sqs.to_dict() + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + workers = self.workers + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if amqp is not UNSET: + field_dict["amqp"] = amqp + if google is not UNSET: + field_dict["google"] = google + if kafka is not UNSET: + field_dict["kafka"] = kafka + if sqs is not UNSET: + field_dict["sqs"] = sqs + if type_ is not UNSET: + field_dict["type"] = type_ + if workers is not UNSET: + field_dict["workers"] = workers + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_amqp_pub_subconfig import ModelsAmqpPubSubconfig + from ..models.models_google_pub_sub_config import ModelsGooglePubSubConfig + from ..models.models_kafka_pub_sub_config import ModelsKafkaPubSubConfig + from ..models.models_sqs_pub_sub_config import ModelsSQSPubSubConfig + + d = dict(src_dict) + _amqp = d.pop("amqp", UNSET) + amqp: ModelsAmqpPubSubconfig | Unset + if isinstance(_amqp, Unset): + amqp = UNSET + else: + amqp = ModelsAmqpPubSubconfig.from_dict(_amqp) + + _google = d.pop("google", UNSET) + google: ModelsGooglePubSubConfig | Unset + if isinstance(_google, Unset): + google = UNSET + else: + google = ModelsGooglePubSubConfig.from_dict(_google) + + _kafka = d.pop("kafka", UNSET) + kafka: ModelsKafkaPubSubConfig | Unset + if isinstance(_kafka, Unset): + kafka = UNSET + else: + kafka = ModelsKafkaPubSubConfig.from_dict(_kafka) + + _sqs = d.pop("sqs", UNSET) + sqs: ModelsSQSPubSubConfig | Unset + if isinstance(_sqs, Unset): + sqs = UNSET + else: + sqs = ModelsSQSPubSubConfig.from_dict(_sqs) + + _type_ = d.pop("type", UNSET) + type_: DatastorePubSubType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastorePubSubType(_type_) + + workers = d.pop("workers", UNSET) + + models_pub_sub_config = cls( + amqp=amqp, + google=google, + kafka=kafka, + sqs=sqs, + type_=type_, + workers=workers, + ) + + models_pub_sub_config.additional_properties = d + return models_pub_sub_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_rate_limit_configuration.py b/src/convoy/models/models_rate_limit_configuration.py new file mode 100644 index 0000000..7c50e28 --- /dev/null +++ b/src/convoy/models/models_rate_limit_configuration.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsRateLimitConfiguration") + + +@_attrs_define +class ModelsRateLimitConfiguration: + """ + Attributes: + count (int | Unset): + duration (int | Unset): + """ + + count: int | Unset = UNSET + duration: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + count = self.count + + duration = self.duration + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if count is not UNSET: + field_dict["count"] = count + if duration is not UNSET: + field_dict["duration"] = duration + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + count = d.pop("count", UNSET) + + duration = d.pop("duration", UNSET) + + models_rate_limit_configuration = cls( + count=count, + duration=duration, + ) + + models_rate_limit_configuration.additional_properties = d + return models_rate_limit_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_retry_configuration.py b/src/convoy/models/models_retry_configuration.py new file mode 100644 index 0000000..8eeec34 --- /dev/null +++ b/src/convoy/models/models_retry_configuration.py @@ -0,0 +1,98 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_strategy_provider import DatastoreStrategyProvider +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsRetryConfiguration") + + +@_attrs_define +class ModelsRetryConfiguration: + """ + Attributes: + duration (str | Unset): Used to specify a valid Go time duration e.g 10s, 1h3m for how long to wait between + event delivery retries + interval_seconds (int | Unset): Used to specify a time in seconds for how long to wait between event delivery + retries, + retry_count (int | Unset): Used to specify the max number of retries + type_ (DatastoreStrategyProvider | Unset): + """ + + duration: str | Unset = UNSET + interval_seconds: int | Unset = UNSET + retry_count: int | Unset = UNSET + type_: DatastoreStrategyProvider | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + duration = self.duration + + interval_seconds = self.interval_seconds + + retry_count = self.retry_count + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if duration is not UNSET: + field_dict["duration"] = duration + if interval_seconds is not UNSET: + field_dict["interval_seconds"] = interval_seconds + if retry_count is not UNSET: + field_dict["retry_count"] = retry_count + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + duration = d.pop("duration", UNSET) + + interval_seconds = d.pop("interval_seconds", UNSET) + + retry_count = d.pop("retry_count", UNSET) + + _type_ = d.pop("type", UNSET) + type_: DatastoreStrategyProvider | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastoreStrategyProvider(_type_) + + models_retry_configuration = cls( + duration=duration, + interval_seconds=interval_seconds, + retry_count=retry_count, + type_=type_, + ) + + models_retry_configuration.additional_properties = d + return models_retry_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_signature_configuration.py b/src/convoy/models/models_signature_configuration.py new file mode 100644 index 0000000..a3cd288 --- /dev/null +++ b/src/convoy/models/models_signature_configuration.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.config_signature_header_provider import ConfigSignatureHeaderProvider +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_signature_version import ModelsSignatureVersion + + +T = TypeVar("T", bound="ModelsSignatureConfiguration") + + +@_attrs_define +class ModelsSignatureConfiguration: + """ + Attributes: + header (ConfigSignatureHeaderProvider | Unset): + versions (list[ModelsSignatureVersion] | Unset): + """ + + header: ConfigSignatureHeaderProvider | Unset = UNSET + versions: list[ModelsSignatureVersion] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + header: str | Unset = UNSET + if not isinstance(self.header, Unset): + header = self.header.value + + versions: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.versions, Unset): + versions = [] + for versions_item_data in self.versions: + versions_item = versions_item_data.to_dict() + versions.append(versions_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if header is not UNSET: + field_dict["header"] = header + if versions is not UNSET: + field_dict["versions"] = versions + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_signature_version import ModelsSignatureVersion + + d = dict(src_dict) + _header = d.pop("header", UNSET) + header: ConfigSignatureHeaderProvider | Unset + if isinstance(_header, Unset): + header = UNSET + else: + header = ConfigSignatureHeaderProvider(_header) + + _versions = d.pop("versions", UNSET) + versions: list[ModelsSignatureVersion] | Unset = UNSET + if _versions is not UNSET: + versions = [] + for versions_item_data in _versions: + versions_item = ModelsSignatureVersion.from_dict(versions_item_data) + + versions.append(versions_item) + + models_signature_configuration = cls( + header=header, + versions=versions, + ) + + models_signature_configuration.additional_properties = d + return models_signature_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_signature_version.py b/src/convoy/models/models_signature_version.py new file mode 100644 index 0000000..3fcad8e --- /dev/null +++ b/src/convoy/models/models_signature_version.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsSignatureVersion") + + +@_attrs_define +class ModelsSignatureVersion: + """ + Attributes: + created_at (str | Unset): + encoding (str | Unset): + hash_ (str | Unset): + uid (str | Unset): + """ + + created_at: str | Unset = UNSET + encoding: str | Unset = UNSET + hash_: str | Unset = UNSET + uid: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + created_at = self.created_at + + encoding = self.encoding + + hash_ = self.hash_ + + uid = self.uid + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if created_at is not UNSET: + field_dict["created_at"] = created_at + if encoding is not UNSET: + field_dict["encoding"] = encoding + if hash_ is not UNSET: + field_dict["hash"] = hash_ + if uid is not UNSET: + field_dict["uid"] = uid + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + created_at = d.pop("created_at", UNSET) + + encoding = d.pop("encoding", UNSET) + + hash_ = d.pop("hash", UNSET) + + uid = d.pop("uid", UNSET) + + models_signature_version = cls( + created_at=created_at, + encoding=encoding, + hash_=hash_, + uid=uid, + ) + + models_signature_version.additional_properties = d + return models_signature_version + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_source_response.py b/src/convoy/models/models_source_response.py new file mode 100644 index 0000000..0a261fc --- /dev/null +++ b/src/convoy/models/models_source_response.py @@ -0,0 +1,292 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_source_provider import DatastoreSourceProvider +from ..models.datastore_source_type import DatastoreSourceType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_custom_response import DatastoreCustomResponse + from ..models.datastore_provider_config import DatastoreProviderConfig + from ..models.datastore_pub_sub_config import DatastorePubSubConfig + from ..models.datastore_verifier_config import DatastoreVerifierConfig + + +T = TypeVar("T", bound="ModelsSourceResponse") + + +@_attrs_define +class ModelsSourceResponse: + """ + Attributes: + body_function (str | Unset): + created_at (str | Unset): + custom_response (DatastoreCustomResponse | Unset): + deleted_at (str | Unset): + event_type_location (str | Unset): + forward_headers (list[str] | Unset): + header_function (str | Unset): + idempotency_keys (list[str] | Unset): + is_disabled (bool | Unset): + mask_id (str | Unset): + name (str | Unset): + project_id (str | Unset): + provider (DatastoreSourceProvider | Unset): + provider_config (DatastoreProviderConfig | Unset): + pub_sub (DatastorePubSubConfig | Unset): + type_ (DatastoreSourceType | Unset): + uid (str | Unset): + updated_at (str | Unset): + url (str | Unset): + verifier (DatastoreVerifierConfig | Unset): + """ + + body_function: str | Unset = UNSET + created_at: str | Unset = UNSET + custom_response: DatastoreCustomResponse | Unset = UNSET + deleted_at: str | Unset = UNSET + event_type_location: str | Unset = UNSET + forward_headers: list[str] | Unset = UNSET + header_function: str | Unset = UNSET + idempotency_keys: list[str] | Unset = UNSET + is_disabled: bool | Unset = UNSET + mask_id: str | Unset = UNSET + name: str | Unset = UNSET + project_id: str | Unset = UNSET + provider: DatastoreSourceProvider | Unset = UNSET + provider_config: DatastoreProviderConfig | Unset = UNSET + pub_sub: DatastorePubSubConfig | Unset = UNSET + type_: DatastoreSourceType | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + url: str | Unset = UNSET + verifier: DatastoreVerifierConfig | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + body_function = self.body_function + + created_at = self.created_at + + custom_response: dict[str, Any] | Unset = UNSET + if not isinstance(self.custom_response, Unset): + custom_response = self.custom_response.to_dict() + + deleted_at = self.deleted_at + + event_type_location = self.event_type_location + + forward_headers: list[str] | Unset = UNSET + if not isinstance(self.forward_headers, Unset): + forward_headers = self.forward_headers + + header_function = self.header_function + + idempotency_keys: list[str] | Unset = UNSET + if not isinstance(self.idempotency_keys, Unset): + idempotency_keys = self.idempotency_keys + + is_disabled = self.is_disabled + + mask_id = self.mask_id + + name = self.name + + project_id = self.project_id + + provider: str | Unset = UNSET + if not isinstance(self.provider, Unset): + provider = self.provider.value + + provider_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.provider_config, Unset): + provider_config = self.provider_config.to_dict() + + pub_sub: dict[str, Any] | Unset = UNSET + if not isinstance(self.pub_sub, Unset): + pub_sub = self.pub_sub.to_dict() + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + uid = self.uid + + updated_at = self.updated_at + + url = self.url + + verifier: dict[str, Any] | Unset = UNSET + if not isinstance(self.verifier, Unset): + verifier = self.verifier.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if body_function is not UNSET: + field_dict["body_function"] = body_function + if created_at is not UNSET: + field_dict["created_at"] = created_at + if custom_response is not UNSET: + field_dict["custom_response"] = custom_response + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if event_type_location is not UNSET: + field_dict["event_type_location"] = event_type_location + if forward_headers is not UNSET: + field_dict["forward_headers"] = forward_headers + if header_function is not UNSET: + field_dict["header_function"] = header_function + if idempotency_keys is not UNSET: + field_dict["idempotency_keys"] = idempotency_keys + if is_disabled is not UNSET: + field_dict["is_disabled"] = is_disabled + if mask_id is not UNSET: + field_dict["mask_id"] = mask_id + if name is not UNSET: + field_dict["name"] = name + if project_id is not UNSET: + field_dict["project_id"] = project_id + if provider is not UNSET: + field_dict["provider"] = provider + if provider_config is not UNSET: + field_dict["provider_config"] = provider_config + if pub_sub is not UNSET: + field_dict["pub_sub"] = pub_sub + if type_ is not UNSET: + field_dict["type"] = type_ + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if url is not UNSET: + field_dict["url"] = url + if verifier is not UNSET: + field_dict["verifier"] = verifier + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_custom_response import DatastoreCustomResponse + from ..models.datastore_provider_config import DatastoreProviderConfig + from ..models.datastore_pub_sub_config import DatastorePubSubConfig + from ..models.datastore_verifier_config import DatastoreVerifierConfig + + d = dict(src_dict) + body_function = d.pop("body_function", UNSET) + + created_at = d.pop("created_at", UNSET) + + _custom_response = d.pop("custom_response", UNSET) + custom_response: DatastoreCustomResponse | Unset + if isinstance(_custom_response, Unset): + custom_response = UNSET + else: + custom_response = DatastoreCustomResponse.from_dict(_custom_response) + + deleted_at = d.pop("deleted_at", UNSET) + + event_type_location = d.pop("event_type_location", UNSET) + + forward_headers = cast(list[str], d.pop("forward_headers", UNSET)) + + header_function = d.pop("header_function", UNSET) + + idempotency_keys = cast(list[str], d.pop("idempotency_keys", UNSET)) + + is_disabled = d.pop("is_disabled", UNSET) + + mask_id = d.pop("mask_id", UNSET) + + name = d.pop("name", UNSET) + + project_id = d.pop("project_id", UNSET) + + _provider = d.pop("provider", UNSET) + provider: DatastoreSourceProvider | Unset + if isinstance(_provider, Unset): + provider = UNSET + else: + provider = DatastoreSourceProvider(_provider) + + _provider_config = d.pop("provider_config", UNSET) + provider_config: DatastoreProviderConfig | Unset + if isinstance(_provider_config, Unset): + provider_config = UNSET + else: + provider_config = DatastoreProviderConfig.from_dict(_provider_config) + + _pub_sub = d.pop("pub_sub", UNSET) + pub_sub: DatastorePubSubConfig | Unset + if isinstance(_pub_sub, Unset): + pub_sub = UNSET + else: + pub_sub = DatastorePubSubConfig.from_dict(_pub_sub) + + _type_ = d.pop("type", UNSET) + type_: DatastoreSourceType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastoreSourceType(_type_) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + url = d.pop("url", UNSET) + + _verifier = d.pop("verifier", UNSET) + verifier: DatastoreVerifierConfig | Unset + if isinstance(_verifier, Unset): + verifier = UNSET + else: + verifier = DatastoreVerifierConfig.from_dict(_verifier) + + models_source_response = cls( + body_function=body_function, + created_at=created_at, + custom_response=custom_response, + deleted_at=deleted_at, + event_type_location=event_type_location, + forward_headers=forward_headers, + header_function=header_function, + idempotency_keys=idempotency_keys, + is_disabled=is_disabled, + mask_id=mask_id, + name=name, + project_id=project_id, + provider=provider, + provider_config=provider_config, + pub_sub=pub_sub, + type_=type_, + uid=uid, + updated_at=updated_at, + url=url, + verifier=verifier, + ) + + models_source_response.additional_properties = d + return models_source_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_sqs_pub_sub_config.py b/src/convoy/models/models_sqs_pub_sub_config.py new file mode 100644 index 0000000..c27afba --- /dev/null +++ b/src/convoy/models/models_sqs_pub_sub_config.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsSQSPubSubConfig") + + +@_attrs_define +class ModelsSQSPubSubConfig: + """ + Attributes: + access_key_id (str | Unset): + default_region (str | Unset): + queue_name (str | Unset): + secret_key (str | Unset): + """ + + access_key_id: str | Unset = UNSET + default_region: str | Unset = UNSET + queue_name: str | Unset = UNSET + secret_key: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + access_key_id = self.access_key_id + + default_region = self.default_region + + queue_name = self.queue_name + + secret_key = self.secret_key + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if access_key_id is not UNSET: + field_dict["access_key_id"] = access_key_id + if default_region is not UNSET: + field_dict["default_region"] = default_region + if queue_name is not UNSET: + field_dict["queue_name"] = queue_name + if secret_key is not UNSET: + field_dict["secret_key"] = secret_key + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + access_key_id = d.pop("access_key_id", UNSET) + + default_region = d.pop("default_region", UNSET) + + queue_name = d.pop("queue_name", UNSET) + + secret_key = d.pop("secret_key", UNSET) + + models_sqs_pub_sub_config = cls( + access_key_id=access_key_id, + default_region=default_region, + queue_name=queue_name, + secret_key=secret_key, + ) + + models_sqs_pub_sub_config.additional_properties = d + return models_sqs_pub_sub_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_ssl_configuration.py b/src/convoy/models/models_ssl_configuration.py new file mode 100644 index 0000000..8b124e9 --- /dev/null +++ b/src/convoy/models/models_ssl_configuration.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsSSLConfiguration") + + +@_attrs_define +class ModelsSSLConfiguration: + """ + Attributes: + enforce_secure_endpoints (bool | Unset): + """ + + enforce_secure_endpoints: bool | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + enforce_secure_endpoints = self.enforce_secure_endpoints + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if enforce_secure_endpoints is not UNSET: + field_dict["enforce_secure_endpoints"] = enforce_secure_endpoints + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + enforce_secure_endpoints = d.pop("enforce_secure_endpoints", UNSET) + + models_ssl_configuration = cls( + enforce_secure_endpoints=enforce_secure_endpoints, + ) + + models_ssl_configuration.additional_properties = d + return models_ssl_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_strategy_configuration.py b/src/convoy/models/models_strategy_configuration.py new file mode 100644 index 0000000..abc852d --- /dev/null +++ b/src/convoy/models/models_strategy_configuration.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsStrategyConfiguration") + + +@_attrs_define +class ModelsStrategyConfiguration: + """ + Attributes: + duration (int | Unset): + retry_count (int | Unset): + type_ (str | Unset): + """ + + duration: int | Unset = UNSET + retry_count: int | Unset = UNSET + type_: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + duration = self.duration + + retry_count = self.retry_count + + type_ = self.type_ + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if duration is not UNSET: + field_dict["duration"] = duration + if retry_count is not UNSET: + field_dict["retry_count"] = retry_count + if type_ is not UNSET: + field_dict["type"] = type_ + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + duration = d.pop("duration", UNSET) + + retry_count = d.pop("retry_count", UNSET) + + type_ = d.pop("type", UNSET) + + models_strategy_configuration = cls( + duration=duration, + retry_count=retry_count, + type_=type_, + ) + + models_strategy_configuration.additional_properties = d + return models_strategy_configuration + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_subscription_response.py b/src/convoy/models/models_subscription_response.py new file mode 100644 index 0000000..4fb54b0 --- /dev/null +++ b/src/convoy/models/models_subscription_response.py @@ -0,0 +1,285 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_delivery_mode import DatastoreDeliveryMode +from ..models.datastore_subscription_type import DatastoreSubscriptionType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_alert_configuration import DatastoreAlertConfiguration + from ..models.datastore_device import DatastoreDevice + from ..models.datastore_endpoint import DatastoreEndpoint + from ..models.datastore_filter_configuration import DatastoreFilterConfiguration + from ..models.datastore_rate_limit_configuration import ( + DatastoreRateLimitConfiguration, + ) + from ..models.datastore_retry_configuration import DatastoreRetryConfiguration + from ..models.datastore_source import DatastoreSource + + +T = TypeVar("T", bound="ModelsSubscriptionResponse") + + +@_attrs_define +class ModelsSubscriptionResponse: + """ + Attributes: + alert_config (DatastoreAlertConfiguration | Unset): + created_at (str | Unset): + deleted_at (str | Unset): + delivery_mode (DatastoreDeliveryMode | Unset): + device_metadata (DatastoreDevice | Unset): + endpoint_metadata (DatastoreEndpoint | Unset): + filter_config (DatastoreFilterConfiguration | Unset): + function (str | Unset): + name (str | Unset): + project_id (str | Unset): + rate_limit_config (DatastoreRateLimitConfiguration | Unset): + retry_config (DatastoreRetryConfiguration | Unset): + source_metadata (DatastoreSource | Unset): + type_ (DatastoreSubscriptionType | Unset): + uid (str | Unset): + updated_at (str | Unset): + """ + + alert_config: DatastoreAlertConfiguration | Unset = UNSET + created_at: str | Unset = UNSET + deleted_at: str | Unset = UNSET + delivery_mode: DatastoreDeliveryMode | Unset = UNSET + device_metadata: DatastoreDevice | Unset = UNSET + endpoint_metadata: DatastoreEndpoint | Unset = UNSET + filter_config: DatastoreFilterConfiguration | Unset = UNSET + function: str | Unset = UNSET + name: str | Unset = UNSET + project_id: str | Unset = UNSET + rate_limit_config: DatastoreRateLimitConfiguration | Unset = UNSET + retry_config: DatastoreRetryConfiguration | Unset = UNSET + source_metadata: DatastoreSource | Unset = UNSET + type_: DatastoreSubscriptionType | Unset = UNSET + uid: str | Unset = UNSET + updated_at: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + alert_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.alert_config, Unset): + alert_config = self.alert_config.to_dict() + + created_at = self.created_at + + deleted_at = self.deleted_at + + delivery_mode: str | Unset = UNSET + if not isinstance(self.delivery_mode, Unset): + delivery_mode = self.delivery_mode.value + + device_metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.device_metadata, Unset): + device_metadata = self.device_metadata.to_dict() + + endpoint_metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.endpoint_metadata, Unset): + endpoint_metadata = self.endpoint_metadata.to_dict() + + filter_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.filter_config, Unset): + filter_config = self.filter_config.to_dict() + + function = self.function + + name = self.name + + project_id = self.project_id + + rate_limit_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.rate_limit_config, Unset): + rate_limit_config = self.rate_limit_config.to_dict() + + retry_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.retry_config, Unset): + retry_config = self.retry_config.to_dict() + + source_metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.source_metadata, Unset): + source_metadata = self.source_metadata.to_dict() + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + uid = self.uid + + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if alert_config is not UNSET: + field_dict["alert_config"] = alert_config + if created_at is not UNSET: + field_dict["created_at"] = created_at + if deleted_at is not UNSET: + field_dict["deleted_at"] = deleted_at + if delivery_mode is not UNSET: + field_dict["delivery_mode"] = delivery_mode + if device_metadata is not UNSET: + field_dict["device_metadata"] = device_metadata + if endpoint_metadata is not UNSET: + field_dict["endpoint_metadata"] = endpoint_metadata + if filter_config is not UNSET: + field_dict["filter_config"] = filter_config + if function is not UNSET: + field_dict["function"] = function + if name is not UNSET: + field_dict["name"] = name + if project_id is not UNSET: + field_dict["project_id"] = project_id + if rate_limit_config is not UNSET: + field_dict["rate_limit_config"] = rate_limit_config + if retry_config is not UNSET: + field_dict["retry_config"] = retry_config + if source_metadata is not UNSET: + field_dict["source_metadata"] = source_metadata + if type_ is not UNSET: + field_dict["type"] = type_ + if uid is not UNSET: + field_dict["uid"] = uid + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_alert_configuration import DatastoreAlertConfiguration + from ..models.datastore_device import DatastoreDevice + from ..models.datastore_endpoint import DatastoreEndpoint + from ..models.datastore_filter_configuration import DatastoreFilterConfiguration + from ..models.datastore_rate_limit_configuration import ( + DatastoreRateLimitConfiguration, + ) + from ..models.datastore_retry_configuration import DatastoreRetryConfiguration + from ..models.datastore_source import DatastoreSource + + d = dict(src_dict) + _alert_config = d.pop("alert_config", UNSET) + alert_config: DatastoreAlertConfiguration | Unset + if isinstance(_alert_config, Unset): + alert_config = UNSET + else: + alert_config = DatastoreAlertConfiguration.from_dict(_alert_config) + + created_at = d.pop("created_at", UNSET) + + deleted_at = d.pop("deleted_at", UNSET) + + _delivery_mode = d.pop("delivery_mode", UNSET) + delivery_mode: DatastoreDeliveryMode | Unset + if isinstance(_delivery_mode, Unset): + delivery_mode = UNSET + else: + delivery_mode = DatastoreDeliveryMode(_delivery_mode) + + _device_metadata = d.pop("device_metadata", UNSET) + device_metadata: DatastoreDevice | Unset + if isinstance(_device_metadata, Unset): + device_metadata = UNSET + else: + device_metadata = DatastoreDevice.from_dict(_device_metadata) + + _endpoint_metadata = d.pop("endpoint_metadata", UNSET) + endpoint_metadata: DatastoreEndpoint | Unset + if isinstance(_endpoint_metadata, Unset): + endpoint_metadata = UNSET + else: + endpoint_metadata = DatastoreEndpoint.from_dict(_endpoint_metadata) + + _filter_config = d.pop("filter_config", UNSET) + filter_config: DatastoreFilterConfiguration | Unset + if isinstance(_filter_config, Unset): + filter_config = UNSET + else: + filter_config = DatastoreFilterConfiguration.from_dict(_filter_config) + + function = d.pop("function", UNSET) + + name = d.pop("name", UNSET) + + project_id = d.pop("project_id", UNSET) + + _rate_limit_config = d.pop("rate_limit_config", UNSET) + rate_limit_config: DatastoreRateLimitConfiguration | Unset + if isinstance(_rate_limit_config, Unset): + rate_limit_config = UNSET + else: + rate_limit_config = DatastoreRateLimitConfiguration.from_dict( + _rate_limit_config + ) + + _retry_config = d.pop("retry_config", UNSET) + retry_config: DatastoreRetryConfiguration | Unset + if isinstance(_retry_config, Unset): + retry_config = UNSET + else: + retry_config = DatastoreRetryConfiguration.from_dict(_retry_config) + + _source_metadata = d.pop("source_metadata", UNSET) + source_metadata: DatastoreSource | Unset + if isinstance(_source_metadata, Unset): + source_metadata = UNSET + else: + source_metadata = DatastoreSource.from_dict(_source_metadata) + + _type_ = d.pop("type", UNSET) + type_: DatastoreSubscriptionType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastoreSubscriptionType(_type_) + + uid = d.pop("uid", UNSET) + + updated_at = d.pop("updated_at", UNSET) + + models_subscription_response = cls( + alert_config=alert_config, + created_at=created_at, + deleted_at=deleted_at, + delivery_mode=delivery_mode, + device_metadata=device_metadata, + endpoint_metadata=endpoint_metadata, + filter_config=filter_config, + function=function, + name=name, + project_id=project_id, + rate_limit_config=rate_limit_config, + retry_config=retry_config, + source_metadata=source_metadata, + type_=type_, + uid=uid, + updated_at=updated_at, + ) + + models_subscription_response.additional_properties = d + return models_subscription_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_test_filter.py b/src/convoy/models/models_test_filter.py new file mode 100644 index 0000000..7043bfc --- /dev/null +++ b/src/convoy/models/models_test_filter.py @@ -0,0 +1,90 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_filter_schema import ModelsFilterSchema + + +T = TypeVar("T", bound="ModelsTestFilter") + + +@_attrs_define +class ModelsTestFilter: + """ + Attributes: + request (ModelsFilterSchema | Unset): + schema (ModelsFilterSchema | Unset): + """ + + request: ModelsFilterSchema | Unset = UNSET + schema: ModelsFilterSchema | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + request: dict[str, Any] | Unset = UNSET + if not isinstance(self.request, Unset): + request = self.request.to_dict() + + schema: dict[str, Any] | Unset = UNSET + if not isinstance(self.schema, Unset): + schema = self.schema.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if request is not UNSET: + field_dict["request"] = request + if schema is not UNSET: + field_dict["schema"] = schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_filter_schema import ModelsFilterSchema + + d = dict(src_dict) + _request = d.pop("request", UNSET) + request: ModelsFilterSchema | Unset + if isinstance(_request, Unset): + request = UNSET + else: + request = ModelsFilterSchema.from_dict(_request) + + _schema = d.pop("schema", UNSET) + schema: ModelsFilterSchema | Unset + if isinstance(_schema, Unset): + schema = UNSET + else: + schema = ModelsFilterSchema.from_dict(_schema) + + models_test_filter = cls( + request=request, + schema=schema, + ) + + models_test_filter.additional_properties = d + return models_test_filter + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_test_filter_request.py b/src/convoy/models/models_test_filter_request.py new file mode 100644 index 0000000..6512012 --- /dev/null +++ b/src/convoy/models/models_test_filter_request.py @@ -0,0 +1,86 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_test_filter_request_scopes import ModelsTestFilterRequestScopes + + +T = TypeVar("T", bound="ModelsTestFilterRequest") + + +@_attrs_define +class ModelsTestFilterRequest: + """ + Attributes: + payload (Any | Unset): Sample payload to test against body filter rules. Optional when request scopes are + supplied. + request (ModelsTestFilterRequestScopes | Unset): + """ + + payload: Any | Unset = UNSET + request: ModelsTestFilterRequestScopes | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + payload = self.payload + + request: dict[str, Any] | Unset = UNSET + if not isinstance(self.request, Unset): + request = self.request.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if payload is not UNSET: + field_dict["payload"] = payload + if request is not UNSET: + field_dict["request"] = request + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_test_filter_request_scopes import ( + ModelsTestFilterRequestScopes, + ) + + d = dict(src_dict) + payload = d.pop("payload", UNSET) + + _request = d.pop("request", UNSET) + request: ModelsTestFilterRequestScopes | Unset + if isinstance(_request, Unset): + request = UNSET + else: + request = ModelsTestFilterRequestScopes.from_dict(_request) + + models_test_filter_request = cls( + payload=payload, + request=request, + ) + + models_test_filter_request.additional_properties = d + return models_test_filter_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_test_filter_request_scopes.py b/src/convoy/models/models_test_filter_request_scopes.py new file mode 100644 index 0000000..2b3260b --- /dev/null +++ b/src/convoy/models/models_test_filter_request_scopes.py @@ -0,0 +1,131 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_m import DatastoreM + + +T = TypeVar("T", bound="ModelsTestFilterRequestScopes") + + +@_attrs_define +class ModelsTestFilterRequestScopes: + """ + Attributes: + body (Any | Unset): + header (DatastoreM | Unset): + headers (DatastoreM | Unset): + path (DatastoreM | Unset): + query (DatastoreM | Unset): + """ + + body: Any | Unset = UNSET + header: DatastoreM | Unset = UNSET + headers: DatastoreM | Unset = UNSET + path: DatastoreM | Unset = UNSET + query: DatastoreM | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + body = self.body + + header: dict[str, Any] | Unset = UNSET + if not isinstance(self.header, Unset): + header = self.header.to_dict() + + headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.headers, Unset): + headers = self.headers.to_dict() + + path: dict[str, Any] | Unset = UNSET + if not isinstance(self.path, Unset): + path = self.path.to_dict() + + query: dict[str, Any] | Unset = UNSET + if not isinstance(self.query, Unset): + query = self.query.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if body is not UNSET: + field_dict["body"] = body + if header is not UNSET: + field_dict["header"] = header + if headers is not UNSET: + field_dict["headers"] = headers + if path is not UNSET: + field_dict["path"] = path + if query is not UNSET: + field_dict["query"] = query + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_m import DatastoreM + + d = dict(src_dict) + body = d.pop("body", UNSET) + + _header = d.pop("header", UNSET) + header: DatastoreM | Unset + if isinstance(_header, Unset): + header = UNSET + else: + header = DatastoreM.from_dict(_header) + + _headers = d.pop("headers", UNSET) + headers: DatastoreM | Unset + if isinstance(_headers, Unset): + headers = UNSET + else: + headers = DatastoreM.from_dict(_headers) + + _path = d.pop("path", UNSET) + path: DatastoreM | Unset + if isinstance(_path, Unset): + path = UNSET + else: + path = DatastoreM.from_dict(_path) + + _query = d.pop("query", UNSET) + query: DatastoreM | Unset + if isinstance(_query, Unset): + query = UNSET + else: + query = DatastoreM.from_dict(_query) + + models_test_filter_request_scopes = cls( + body=body, + header=header, + headers=headers, + path=path, + query=query, + ) + + models_test_filter_request_scopes.additional_properties = d + return models_test_filter_request_scopes + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_test_filter_response.py b/src/convoy/models/models_test_filter_response.py new file mode 100644 index 0000000..ec13a25 --- /dev/null +++ b/src/convoy/models/models_test_filter_response.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsTestFilterResponse") + + +@_attrs_define +class ModelsTestFilterResponse: + """ + Attributes: + is_match (bool | Unset): Whether the payload matches the filter criteria + """ + + is_match: bool | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + is_match = self.is_match + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if is_match is not UNSET: + field_dict["is_match"] = is_match + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + is_match = d.pop("is_match", UNSET) + + models_test_filter_response = cls( + is_match=is_match, + ) + + models_test_filter_response.additional_properties = d + return models_test_filter_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_test_o_auth_2_request.py b/src/convoy/models/models_test_o_auth_2_request.py new file mode 100644 index 0000000..d2f0527 --- /dev/null +++ b/src/convoy/models/models_test_o_auth_2_request.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_o_auth_2 import ModelsOAuth2 + + +T = TypeVar("T", bound="ModelsTestOAuth2Request") + + +@_attrs_define +class ModelsTestOAuth2Request: + """ + Attributes: + oauth2 (ModelsOAuth2 | Unset): + """ + + oauth2: ModelsOAuth2 | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + oauth2: dict[str, Any] | Unset = UNSET + if not isinstance(self.oauth2, Unset): + oauth2 = self.oauth2.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if oauth2 is not UNSET: + field_dict["oauth2"] = oauth2 + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_o_auth_2 import ModelsOAuth2 + + d = dict(src_dict) + _oauth2 = d.pop("oauth2", UNSET) + oauth2: ModelsOAuth2 | Unset + if isinstance(_oauth2, Unset): + oauth2 = UNSET + else: + oauth2 = ModelsOAuth2.from_dict(_oauth2) + + models_test_o_auth_2_request = cls( + oauth2=oauth2, + ) + + models_test_o_auth_2_request.additional_properties = d + return models_test_o_auth_2_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_test_o_auth_2_response.py b/src/convoy/models/models_test_o_auth_2_response.py new file mode 100644 index 0000000..5781994 --- /dev/null +++ b/src/convoy/models/models_test_o_auth_2_response.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsTestOAuth2Response") + + +@_attrs_define +class ModelsTestOAuth2Response: + """ + Attributes: + access_token (str | Unset): + error (str | Unset): + expires_at (str | Unset): + message (str | Unset): + success (bool | Unset): + token_type (str | Unset): + """ + + access_token: str | Unset = UNSET + error: str | Unset = UNSET + expires_at: str | Unset = UNSET + message: str | Unset = UNSET + success: bool | Unset = UNSET + token_type: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + access_token = self.access_token + + error = self.error + + expires_at = self.expires_at + + message = self.message + + success = self.success + + token_type = self.token_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if access_token is not UNSET: + field_dict["access_token"] = access_token + if error is not UNSET: + field_dict["error"] = error + if expires_at is not UNSET: + field_dict["expires_at"] = expires_at + if message is not UNSET: + field_dict["message"] = message + if success is not UNSET: + field_dict["success"] = success + if token_type is not UNSET: + field_dict["token_type"] = token_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + access_token = d.pop("access_token", UNSET) + + error = d.pop("error", UNSET) + + expires_at = d.pop("expires_at", UNSET) + + message = d.pop("message", UNSET) + + success = d.pop("success", UNSET) + + token_type = d.pop("token_type", UNSET) + + models_test_o_auth_2_response = cls( + access_token=access_token, + error=error, + expires_at=expires_at, + message=message, + success=success, + token_type=token_type, + ) + + models_test_o_auth_2_response.additional_properties = d + return models_test_o_auth_2_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_update_custom_response.py b/src/convoy/models/models_update_custom_response.py new file mode 100644 index 0000000..7d9cc6a --- /dev/null +++ b/src/convoy/models/models_update_custom_response.py @@ -0,0 +1,93 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ModelsUpdateCustomResponse") + + +@_attrs_define +class ModelsUpdateCustomResponse: + """ + Attributes: + body (None | str | Unset): + content_type (None | str | Unset): + """ + + body: None | str | Unset = UNSET + content_type: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + body: None | str | Unset + if isinstance(self.body, Unset): + body = UNSET + else: + body = self.body + + content_type: None | str | Unset + if isinstance(self.content_type, Unset): + content_type = UNSET + else: + content_type = self.content_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if body is not UNSET: + field_dict["body"] = body + if content_type is not UNSET: + field_dict["content_type"] = content_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_body(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + body = _parse_body(d.pop("body", UNSET)) + + def _parse_content_type(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + content_type = _parse_content_type(d.pop("content_type", UNSET)) + + models_update_custom_response = cls( + body=body, + content_type=content_type, + ) + + models_update_custom_response.additional_properties = d + return models_update_custom_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_update_endpoint.py b/src/convoy/models/models_update_endpoint.py new file mode 100644 index 0000000..f02ef92 --- /dev/null +++ b/src/convoy/models/models_update_endpoint.py @@ -0,0 +1,218 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_endpoint_authentication import ModelsEndpointAuthentication + from ..models.models_mtls_client_cert import ModelsMtlsClientCert + + +T = TypeVar("T", bound="ModelsUpdateEndpoint") + + +@_attrs_define +class ModelsUpdateEndpoint: + """ + Attributes: + advanced_signatures (bool | Unset): Convoy supports two [signature formats](https://getconvoy.io/docs/product- + manual/signatures) + -- simple or advanced. If left unspecified, we default to false. + authentication (ModelsEndpointAuthentication | Unset): + content_type (str | Unset): Content type for the endpoint. Defaults to application/json if not specified. + description (str | Unset): Human-readable description of the endpoint. Think of this as metadata describing + the endpoint + http_timeout (int | Unset): Define endpoint http timeout in seconds. + is_disabled (bool | Unset): This is used to manually enable/disable the endpoint. + mtls_client_cert (ModelsMtlsClientCert | Unset): + name (str | Unset): + owner_id (str | Unset): The OwnerID is used to group more than one endpoint together to achieve + [fanout](https://getconvoy.io/docs/manual/endpoints#Endpoint%20Owner%20ID) + rate_limit (int | Unset): Rate limit is the total number of requests to be sent to an endpoint in + the time duration specified in RateLimitDuration + rate_limit_duration (int | Unset): Rate limit duration specifies the time range for the rate limit. + secret (str | Unset): Endpoint's webhook secret. If not provided, Convoy autogenerates one for the endpoint. + slack_webhook_url (str | Unset): Slack webhook URL is an alternative method to support email where endpoint + developers + can receive failure notifications on a slack channel. + support_email (str | Unset): Endpoint developers support email. This is used for communicating endpoint state + changes. You should always turn this on when disabling endpoints are enabled. + url (str | Unset): URL is the endpoint's URL prefixed with https. non-https urls are currently + not supported. + """ + + advanced_signatures: bool | Unset = UNSET + authentication: ModelsEndpointAuthentication | Unset = UNSET + content_type: str | Unset = UNSET + description: str | Unset = UNSET + http_timeout: int | Unset = UNSET + is_disabled: bool | Unset = UNSET + mtls_client_cert: ModelsMtlsClientCert | Unset = UNSET + name: str | Unset = UNSET + owner_id: str | Unset = UNSET + rate_limit: int | Unset = UNSET + rate_limit_duration: int | Unset = UNSET + secret: str | Unset = UNSET + slack_webhook_url: str | Unset = UNSET + support_email: str | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + advanced_signatures = self.advanced_signatures + + authentication: dict[str, Any] | Unset = UNSET + if not isinstance(self.authentication, Unset): + authentication = self.authentication.to_dict() + + content_type = self.content_type + + description = self.description + + http_timeout = self.http_timeout + + is_disabled = self.is_disabled + + mtls_client_cert: dict[str, Any] | Unset = UNSET + if not isinstance(self.mtls_client_cert, Unset): + mtls_client_cert = self.mtls_client_cert.to_dict() + + name = self.name + + owner_id = self.owner_id + + rate_limit = self.rate_limit + + rate_limit_duration = self.rate_limit_duration + + secret = self.secret + + slack_webhook_url = self.slack_webhook_url + + support_email = self.support_email + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if advanced_signatures is not UNSET: + field_dict["advanced_signatures"] = advanced_signatures + if authentication is not UNSET: + field_dict["authentication"] = authentication + if content_type is not UNSET: + field_dict["content_type"] = content_type + if description is not UNSET: + field_dict["description"] = description + if http_timeout is not UNSET: + field_dict["http_timeout"] = http_timeout + if is_disabled is not UNSET: + field_dict["is_disabled"] = is_disabled + if mtls_client_cert is not UNSET: + field_dict["mtls_client_cert"] = mtls_client_cert + if name is not UNSET: + field_dict["name"] = name + if owner_id is not UNSET: + field_dict["owner_id"] = owner_id + if rate_limit is not UNSET: + field_dict["rate_limit"] = rate_limit + if rate_limit_duration is not UNSET: + field_dict["rate_limit_duration"] = rate_limit_duration + if secret is not UNSET: + field_dict["secret"] = secret + if slack_webhook_url is not UNSET: + field_dict["slack_webhook_url"] = slack_webhook_url + if support_email is not UNSET: + field_dict["support_email"] = support_email + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_endpoint_authentication import ModelsEndpointAuthentication + from ..models.models_mtls_client_cert import ModelsMtlsClientCert + + d = dict(src_dict) + advanced_signatures = d.pop("advanced_signatures", UNSET) + + _authentication = d.pop("authentication", UNSET) + authentication: ModelsEndpointAuthentication | Unset + if isinstance(_authentication, Unset): + authentication = UNSET + else: + authentication = ModelsEndpointAuthentication.from_dict(_authentication) + + content_type = d.pop("content_type", UNSET) + + description = d.pop("description", UNSET) + + http_timeout = d.pop("http_timeout", UNSET) + + is_disabled = d.pop("is_disabled", UNSET) + + _mtls_client_cert = d.pop("mtls_client_cert", UNSET) + mtls_client_cert: ModelsMtlsClientCert | Unset + if isinstance(_mtls_client_cert, Unset): + mtls_client_cert = UNSET + else: + mtls_client_cert = ModelsMtlsClientCert.from_dict(_mtls_client_cert) + + name = d.pop("name", UNSET) + + owner_id = d.pop("owner_id", UNSET) + + rate_limit = d.pop("rate_limit", UNSET) + + rate_limit_duration = d.pop("rate_limit_duration", UNSET) + + secret = d.pop("secret", UNSET) + + slack_webhook_url = d.pop("slack_webhook_url", UNSET) + + support_email = d.pop("support_email", UNSET) + + url = d.pop("url", UNSET) + + models_update_endpoint = cls( + advanced_signatures=advanced_signatures, + authentication=authentication, + content_type=content_type, + description=description, + http_timeout=http_timeout, + is_disabled=is_disabled, + mtls_client_cert=mtls_client_cert, + name=name, + owner_id=owner_id, + rate_limit=rate_limit, + rate_limit_duration=rate_limit_duration, + secret=secret, + slack_webhook_url=slack_webhook_url, + support_email=support_email, + url=url, + ) + + models_update_endpoint.additional_properties = d + return models_update_endpoint + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_update_event_type.py b/src/convoy/models/models_update_event_type.py new file mode 100644 index 0000000..198e7bd --- /dev/null +++ b/src/convoy/models/models_update_event_type.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_update_event_type_json_schema import ( + ModelsUpdateEventTypeJsonSchema, + ) + + +T = TypeVar("T", bound="ModelsUpdateEventType") + + +@_attrs_define +class ModelsUpdateEventType: + """ + Attributes: + category (str | Unset): Category is a product-specific grouping for the event type + description (str | Unset): Description is used to describe what the event type does + json_schema (ModelsUpdateEventTypeJsonSchema | Unset): JSONSchema is the JSON structure of the event type + """ + + category: str | Unset = UNSET + description: str | Unset = UNSET + json_schema: ModelsUpdateEventTypeJsonSchema | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + category = self.category + + description = self.description + + json_schema: dict[str, Any] | Unset = UNSET + if not isinstance(self.json_schema, Unset): + json_schema = self.json_schema.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if category is not UNSET: + field_dict["category"] = category + if description is not UNSET: + field_dict["description"] = description + if json_schema is not UNSET: + field_dict["json_schema"] = json_schema + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_update_event_type_json_schema import ( + ModelsUpdateEventTypeJsonSchema, + ) + + d = dict(src_dict) + category = d.pop("category", UNSET) + + description = d.pop("description", UNSET) + + _json_schema = d.pop("json_schema", UNSET) + json_schema: ModelsUpdateEventTypeJsonSchema | Unset + if isinstance(_json_schema, Unset): + json_schema = UNSET + else: + json_schema = ModelsUpdateEventTypeJsonSchema.from_dict(_json_schema) + + models_update_event_type = cls( + category=category, + description=description, + json_schema=json_schema, + ) + + models_update_event_type.additional_properties = d + return models_update_event_type + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_update_event_type_json_schema.py b/src/convoy/models/models_update_event_type_json_schema.py new file mode 100644 index 0000000..8dae1e5 --- /dev/null +++ b/src/convoy/models/models_update_event_type_json_schema.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ModelsUpdateEventTypeJsonSchema") + + +@_attrs_define +class ModelsUpdateEventTypeJsonSchema: + """JSONSchema is the JSON structure of the event type""" + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + models_update_event_type_json_schema = cls() + + models_update_event_type_json_schema.additional_properties = d + return models_update_event_type_json_schema + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_update_filter_request.py b/src/convoy/models/models_update_filter_request.py new file mode 100644 index 0000000..99f83bc --- /dev/null +++ b/src/convoy/models/models_update_filter_request.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_m import DatastoreM + from ..models.models_optional_time import ModelsOptionalTime + + +T = TypeVar("T", bound="ModelsUpdateFilterRequest") + + +@_attrs_define +class ModelsUpdateFilterRequest: + """ + Attributes: + body (DatastoreM | Unset): + enabled_at (ModelsOptionalTime | Unset): + event_type (str | Unset): Type of event this filter applies to (optional) + headers (DatastoreM | Unset): + is_flattened (bool | Unset): Whether the filter uses flattened JSON paths (optional) + path (DatastoreM | Unset): + query (DatastoreM | Unset): + """ + + body: DatastoreM | Unset = UNSET + enabled_at: ModelsOptionalTime | Unset = UNSET + event_type: str | Unset = UNSET + headers: DatastoreM | Unset = UNSET + is_flattened: bool | Unset = UNSET + path: DatastoreM | Unset = UNSET + query: DatastoreM | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + body: dict[str, Any] | Unset = UNSET + if not isinstance(self.body, Unset): + body = self.body.to_dict() + + enabled_at: dict[str, Any] | Unset = UNSET + if not isinstance(self.enabled_at, Unset): + enabled_at = self.enabled_at.to_dict() + + event_type = self.event_type + + headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.headers, Unset): + headers = self.headers.to_dict() + + is_flattened = self.is_flattened + + path: dict[str, Any] | Unset = UNSET + if not isinstance(self.path, Unset): + path = self.path.to_dict() + + query: dict[str, Any] | Unset = UNSET + if not isinstance(self.query, Unset): + query = self.query.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if body is not UNSET: + field_dict["body"] = body + if enabled_at is not UNSET: + field_dict["enabled_at"] = enabled_at + if event_type is not UNSET: + field_dict["event_type"] = event_type + if headers is not UNSET: + field_dict["headers"] = headers + if is_flattened is not UNSET: + field_dict["is_flattened"] = is_flattened + if path is not UNSET: + field_dict["path"] = path + if query is not UNSET: + field_dict["query"] = query + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_m import DatastoreM + from ..models.models_optional_time import ModelsOptionalTime + + d = dict(src_dict) + _body = d.pop("body", UNSET) + body: DatastoreM | Unset + if isinstance(_body, Unset): + body = UNSET + else: + body = DatastoreM.from_dict(_body) + + _enabled_at = d.pop("enabled_at", UNSET) + enabled_at: ModelsOptionalTime | Unset + if isinstance(_enabled_at, Unset): + enabled_at = UNSET + else: + enabled_at = ModelsOptionalTime.from_dict(_enabled_at) + + event_type = d.pop("event_type", UNSET) + + _headers = d.pop("headers", UNSET) + headers: DatastoreM | Unset + if isinstance(_headers, Unset): + headers = UNSET + else: + headers = DatastoreM.from_dict(_headers) + + is_flattened = d.pop("is_flattened", UNSET) + + _path = d.pop("path", UNSET) + path: DatastoreM | Unset + if isinstance(_path, Unset): + path = UNSET + else: + path = DatastoreM.from_dict(_path) + + _query = d.pop("query", UNSET) + query: DatastoreM | Unset + if isinstance(_query, Unset): + query = UNSET + else: + query = DatastoreM.from_dict(_query) + + models_update_filter_request = cls( + body=body, + enabled_at=enabled_at, + event_type=event_type, + headers=headers, + is_flattened=is_flattened, + path=path, + query=query, + ) + + models_update_filter_request.additional_properties = d + return models_update_filter_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_update_project.py b/src/convoy/models/models_update_project.py new file mode 100644 index 0000000..583b0ff --- /dev/null +++ b/src/convoy/models/models_update_project.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_project_config import ModelsProjectConfig + + +T = TypeVar("T", bound="ModelsUpdateProject") + + +@_attrs_define +class ModelsUpdateProject: + """ + Attributes: + config (ModelsProjectConfig | Unset): + logo_url (str | Unset): + name (str | Unset): Project Name + """ + + config: ModelsProjectConfig | Unset = UNSET + logo_url: str | Unset = UNSET + name: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + config: dict[str, Any] | Unset = UNSET + if not isinstance(self.config, Unset): + config = self.config.to_dict() + + logo_url = self.logo_url + + name = self.name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if config is not UNSET: + field_dict["config"] = config + if logo_url is not UNSET: + field_dict["logo_url"] = logo_url + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_project_config import ModelsProjectConfig + + d = dict(src_dict) + _config = d.pop("config", UNSET) + config: ModelsProjectConfig | Unset + if isinstance(_config, Unset): + config = UNSET + else: + config = ModelsProjectConfig.from_dict(_config) + + logo_url = d.pop("logo_url", UNSET) + + name = d.pop("name", UNSET) + + models_update_project = cls( + config=config, + logo_url=logo_url, + name=name, + ) + + models_update_project.additional_properties = d + return models_update_project + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_update_source.py b/src/convoy/models/models_update_source.py new file mode 100644 index 0000000..416a38b --- /dev/null +++ b/src/convoy/models/models_update_source.py @@ -0,0 +1,199 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_source_type import DatastoreSourceType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_pub_sub_config import ModelsPubSubConfig + from ..models.models_update_custom_response import ModelsUpdateCustomResponse + from ..models.models_verifier_config import ModelsVerifierConfig + + +T = TypeVar("T", bound="ModelsUpdateSource") + + +@_attrs_define +class ModelsUpdateSource: + """ + Attributes: + body_function (str | Unset): Function is a javascript function used to mutate the payload + immediately after ingesting an event + custom_response (ModelsUpdateCustomResponse | Unset): + event_type_location (str | Unset): EventTypeLocation is used to specify where Convoy should read the event type + from an incoming webhook request. + forward_headers (list[str] | Unset): Soecfy header you want convoy to save from the ingest request and forward + to your endpoints when the event is dispatched. + header_function (str | Unset): Function is a javascript function used to mutate the headers + immediately after ingesting an event + idempotency_keys (list[str] | Unset): IdempotencyKeys are used to specify parts of a webhook request to uniquely + identify the event in an incoming webhooks project. + is_disabled (bool | Unset): This is used to manually enable/disable the source. + name (str | Unset): Source name. + pub_sub (ModelsPubSubConfig | Unset): + type_ (DatastoreSourceType | Unset): + verifier (ModelsVerifierConfig | Unset): + """ + + body_function: str | Unset = UNSET + custom_response: ModelsUpdateCustomResponse | Unset = UNSET + event_type_location: str | Unset = UNSET + forward_headers: list[str] | Unset = UNSET + header_function: str | Unset = UNSET + idempotency_keys: list[str] | Unset = UNSET + is_disabled: bool | Unset = UNSET + name: str | Unset = UNSET + pub_sub: ModelsPubSubConfig | Unset = UNSET + type_: DatastoreSourceType | Unset = UNSET + verifier: ModelsVerifierConfig | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + body_function = self.body_function + + custom_response: dict[str, Any] | Unset = UNSET + if not isinstance(self.custom_response, Unset): + custom_response = self.custom_response.to_dict() + + event_type_location = self.event_type_location + + forward_headers: list[str] | Unset = UNSET + if not isinstance(self.forward_headers, Unset): + forward_headers = self.forward_headers + + header_function = self.header_function + + idempotency_keys: list[str] | Unset = UNSET + if not isinstance(self.idempotency_keys, Unset): + idempotency_keys = self.idempotency_keys + + is_disabled = self.is_disabled + + name = self.name + + pub_sub: dict[str, Any] | Unset = UNSET + if not isinstance(self.pub_sub, Unset): + pub_sub = self.pub_sub.to_dict() + + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_.value + + verifier: dict[str, Any] | Unset = UNSET + if not isinstance(self.verifier, Unset): + verifier = self.verifier.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if body_function is not UNSET: + field_dict["body_function"] = body_function + if custom_response is not UNSET: + field_dict["custom_response"] = custom_response + if event_type_location is not UNSET: + field_dict["event_type_location"] = event_type_location + if forward_headers is not UNSET: + field_dict["forward_headers"] = forward_headers + if header_function is not UNSET: + field_dict["header_function"] = header_function + if idempotency_keys is not UNSET: + field_dict["idempotency_keys"] = idempotency_keys + if is_disabled is not UNSET: + field_dict["is_disabled"] = is_disabled + if name is not UNSET: + field_dict["name"] = name + if pub_sub is not UNSET: + field_dict["pub_sub"] = pub_sub + if type_ is not UNSET: + field_dict["type"] = type_ + if verifier is not UNSET: + field_dict["verifier"] = verifier + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_pub_sub_config import ModelsPubSubConfig + from ..models.models_update_custom_response import ModelsUpdateCustomResponse + from ..models.models_verifier_config import ModelsVerifierConfig + + d = dict(src_dict) + body_function = d.pop("body_function", UNSET) + + _custom_response = d.pop("custom_response", UNSET) + custom_response: ModelsUpdateCustomResponse | Unset + if isinstance(_custom_response, Unset): + custom_response = UNSET + else: + custom_response = ModelsUpdateCustomResponse.from_dict(_custom_response) + + event_type_location = d.pop("event_type_location", UNSET) + + forward_headers = cast(list[str], d.pop("forward_headers", UNSET)) + + header_function = d.pop("header_function", UNSET) + + idempotency_keys = cast(list[str], d.pop("idempotency_keys", UNSET)) + + is_disabled = d.pop("is_disabled", UNSET) + + name = d.pop("name", UNSET) + + _pub_sub = d.pop("pub_sub", UNSET) + pub_sub: ModelsPubSubConfig | Unset + if isinstance(_pub_sub, Unset): + pub_sub = UNSET + else: + pub_sub = ModelsPubSubConfig.from_dict(_pub_sub) + + _type_ = d.pop("type", UNSET) + type_: DatastoreSourceType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = DatastoreSourceType(_type_) + + _verifier = d.pop("verifier", UNSET) + verifier: ModelsVerifierConfig | Unset + if isinstance(_verifier, Unset): + verifier = UNSET + else: + verifier = ModelsVerifierConfig.from_dict(_verifier) + + models_update_source = cls( + body_function=body_function, + custom_response=custom_response, + event_type_location=event_type_location, + forward_headers=forward_headers, + header_function=header_function, + idempotency_keys=idempotency_keys, + is_disabled=is_disabled, + name=name, + pub_sub=pub_sub, + type_=type_, + verifier=verifier, + ) + + models_update_source.additional_properties = d + return models_update_source + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_update_subscription.py b/src/convoy/models/models_update_subscription.py new file mode 100644 index 0000000..54195a0 --- /dev/null +++ b/src/convoy/models/models_update_subscription.py @@ -0,0 +1,196 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_delivery_mode import DatastoreDeliveryMode +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_alert_configuration import ModelsAlertConfiguration + from ..models.models_filter_configuration import ModelsFilterConfiguration + from ..models.models_rate_limit_configuration import ModelsRateLimitConfiguration + from ..models.models_retry_configuration import ModelsRetryConfiguration + + +T = TypeVar("T", bound="ModelsUpdateSubscription") + + +@_attrs_define +class ModelsUpdateSubscription: + """ + Attributes: + alert_config (ModelsAlertConfiguration | Unset): + app_id (str | Unset): Deprecated but necessary for backward compatibility + delivery_mode (DatastoreDeliveryMode | Unset): + endpoint_id (str | Unset): Destination endpoint ID + filter_config (ModelsFilterConfiguration | Unset): + function (str | Unset): Convoy supports mutating your request payload using a js function. Use this field + to specify a `transform` function for this purpose. See this[https://docs.getconvoy.io/product- + manual/subscriptions#functions] for more + name (str | Unset): Subscription Nme + rate_limit_config (ModelsRateLimitConfiguration | Unset): + retry_config (ModelsRetryConfiguration | Unset): + source_id (str | Unset): Source Id + """ + + alert_config: ModelsAlertConfiguration | Unset = UNSET + app_id: str | Unset = UNSET + delivery_mode: DatastoreDeliveryMode | Unset = UNSET + endpoint_id: str | Unset = UNSET + filter_config: ModelsFilterConfiguration | Unset = UNSET + function: str | Unset = UNSET + name: str | Unset = UNSET + rate_limit_config: ModelsRateLimitConfiguration | Unset = UNSET + retry_config: ModelsRetryConfiguration | Unset = UNSET + source_id: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + alert_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.alert_config, Unset): + alert_config = self.alert_config.to_dict() + + app_id = self.app_id + + delivery_mode: str | Unset = UNSET + if not isinstance(self.delivery_mode, Unset): + delivery_mode = self.delivery_mode.value + + endpoint_id = self.endpoint_id + + filter_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.filter_config, Unset): + filter_config = self.filter_config.to_dict() + + function = self.function + + name = self.name + + rate_limit_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.rate_limit_config, Unset): + rate_limit_config = self.rate_limit_config.to_dict() + + retry_config: dict[str, Any] | Unset = UNSET + if not isinstance(self.retry_config, Unset): + retry_config = self.retry_config.to_dict() + + source_id = self.source_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if alert_config is not UNSET: + field_dict["alert_config"] = alert_config + if app_id is not UNSET: + field_dict["app_id"] = app_id + if delivery_mode is not UNSET: + field_dict["delivery_mode"] = delivery_mode + if endpoint_id is not UNSET: + field_dict["endpoint_id"] = endpoint_id + if filter_config is not UNSET: + field_dict["filter_config"] = filter_config + if function is not UNSET: + field_dict["function"] = function + if name is not UNSET: + field_dict["name"] = name + if rate_limit_config is not UNSET: + field_dict["rate_limit_config"] = rate_limit_config + if retry_config is not UNSET: + field_dict["retry_config"] = retry_config + if source_id is not UNSET: + field_dict["source_id"] = source_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_alert_configuration import ModelsAlertConfiguration + from ..models.models_filter_configuration import ModelsFilterConfiguration + from ..models.models_rate_limit_configuration import ( + ModelsRateLimitConfiguration, + ) + from ..models.models_retry_configuration import ModelsRetryConfiguration + + d = dict(src_dict) + _alert_config = d.pop("alert_config", UNSET) + alert_config: ModelsAlertConfiguration | Unset + if isinstance(_alert_config, Unset): + alert_config = UNSET + else: + alert_config = ModelsAlertConfiguration.from_dict(_alert_config) + + app_id = d.pop("app_id", UNSET) + + _delivery_mode = d.pop("delivery_mode", UNSET) + delivery_mode: DatastoreDeliveryMode | Unset + if isinstance(_delivery_mode, Unset): + delivery_mode = UNSET + else: + delivery_mode = DatastoreDeliveryMode(_delivery_mode) + + endpoint_id = d.pop("endpoint_id", UNSET) + + _filter_config = d.pop("filter_config", UNSET) + filter_config: ModelsFilterConfiguration | Unset + if isinstance(_filter_config, Unset): + filter_config = UNSET + else: + filter_config = ModelsFilterConfiguration.from_dict(_filter_config) + + function = d.pop("function", UNSET) + + name = d.pop("name", UNSET) + + _rate_limit_config = d.pop("rate_limit_config", UNSET) + rate_limit_config: ModelsRateLimitConfiguration | Unset + if isinstance(_rate_limit_config, Unset): + rate_limit_config = UNSET + else: + rate_limit_config = ModelsRateLimitConfiguration.from_dict( + _rate_limit_config + ) + + _retry_config = d.pop("retry_config", UNSET) + retry_config: ModelsRetryConfiguration | Unset + if isinstance(_retry_config, Unset): + retry_config = UNSET + else: + retry_config = ModelsRetryConfiguration.from_dict(_retry_config) + + source_id = d.pop("source_id", UNSET) + + models_update_subscription = cls( + alert_config=alert_config, + app_id=app_id, + delivery_mode=delivery_mode, + endpoint_id=endpoint_id, + filter_config=filter_config, + function=function, + name=name, + rate_limit_config=rate_limit_config, + retry_config=retry_config, + source_id=source_id, + ) + + models_update_subscription.additional_properties = d + return models_update_subscription + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/models_verifier_config.py b/src/convoy/models/models_verifier_config.py new file mode 100644 index 0000000..524b5ac --- /dev/null +++ b/src/convoy/models/models_verifier_config.py @@ -0,0 +1,122 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.datastore_verifier_type import DatastoreVerifierType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_api_key import ModelsApiKey + from ..models.models_basic_auth import ModelsBasicAuth + from ..models.models_h_mac import ModelsHMac + + +T = TypeVar("T", bound="ModelsVerifierConfig") + + +@_attrs_define +class ModelsVerifierConfig: + """ + Attributes: + type_ (DatastoreVerifierType): + api_key (ModelsApiKey | Unset): + basic_auth (ModelsBasicAuth | Unset): + hmac (ModelsHMac | Unset): + """ + + type_: DatastoreVerifierType + api_key: ModelsApiKey | Unset = UNSET + basic_auth: ModelsBasicAuth | Unset = UNSET + hmac: ModelsHMac | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + type_ = self.type_.value + + api_key: dict[str, Any] | Unset = UNSET + if not isinstance(self.api_key, Unset): + api_key = self.api_key.to_dict() + + basic_auth: dict[str, Any] | Unset = UNSET + if not isinstance(self.basic_auth, Unset): + basic_auth = self.basic_auth.to_dict() + + hmac: dict[str, Any] | Unset = UNSET + if not isinstance(self.hmac, Unset): + hmac = self.hmac.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "type": type_, + } + ) + if api_key is not UNSET: + field_dict["api_key"] = api_key + if basic_auth is not UNSET: + field_dict["basic_auth"] = basic_auth + if hmac is not UNSET: + field_dict["hmac"] = hmac + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_api_key import ModelsApiKey + from ..models.models_basic_auth import ModelsBasicAuth + from ..models.models_h_mac import ModelsHMac + + d = dict(src_dict) + type_ = DatastoreVerifierType(d.pop("type")) + + _api_key = d.pop("api_key", UNSET) + api_key: ModelsApiKey | Unset + if isinstance(_api_key, Unset): + api_key = UNSET + else: + api_key = ModelsApiKey.from_dict(_api_key) + + _basic_auth = d.pop("basic_auth", UNSET) + basic_auth: ModelsBasicAuth | Unset + if isinstance(_basic_auth, Unset): + basic_auth = UNSET + else: + basic_auth = ModelsBasicAuth.from_dict(_basic_auth) + + _hmac = d.pop("hmac", UNSET) + hmac: ModelsHMac | Unset + if isinstance(_hmac, Unset): + hmac = UNSET + else: + hmac = ModelsHMac.from_dict(_hmac) + + models_verifier_config = cls( + type_=type_, + api_key=api_key, + basic_auth=basic_auth, + hmac=hmac, + ) + + models_verifier_config.additional_properties = d + return models_verifier_config + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/pause_endpoint_response_202.py b/src/convoy/models/pause_endpoint_response_202.py new file mode 100644 index 0000000..9433106 --- /dev/null +++ b/src/convoy/models/pause_endpoint_response_202.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_endpoint_response import ModelsEndpointResponse + + +T = TypeVar("T", bound="PauseEndpointResponse202") + + +@_attrs_define +class PauseEndpointResponse202: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEndpointResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEndpointResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_endpoint_response import ModelsEndpointResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEndpointResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEndpointResponse.from_dict(_data) + + pause_endpoint_response_202 = cls( + message=message, + status=status, + data=data, + ) + + pause_endpoint_response_202.additional_properties = d + return pause_endpoint_response_202 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/pause_endpoint_response_400.py b/src/convoy/models/pause_endpoint_response_400.py new file mode 100644 index 0000000..1eda3cf --- /dev/null +++ b/src/convoy/models/pause_endpoint_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="PauseEndpointResponse400") + + +@_attrs_define +class PauseEndpointResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + pause_endpoint_response_400 = cls( + message=message, + status=status, + data=data, + ) + + pause_endpoint_response_400.additional_properties = d + return pause_endpoint_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/pause_endpoint_response_401.py b/src/convoy/models/pause_endpoint_response_401.py new file mode 100644 index 0000000..9cae6c7 --- /dev/null +++ b/src/convoy/models/pause_endpoint_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="PauseEndpointResponse401") + + +@_attrs_define +class PauseEndpointResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + pause_endpoint_response_401 = cls( + message=message, + status=status, + data=data, + ) + + pause_endpoint_response_401.additional_properties = d + return pause_endpoint_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/pause_endpoint_response_404.py b/src/convoy/models/pause_endpoint_response_404.py new file mode 100644 index 0000000..c9bab62 --- /dev/null +++ b/src/convoy/models/pause_endpoint_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="PauseEndpointResponse404") + + +@_attrs_define +class PauseEndpointResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + pause_endpoint_response_404 = cls( + message=message, + status=status, + data=data, + ) + + pause_endpoint_response_404.additional_properties = d + return pause_endpoint_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/post_v1_projects_project_id_sources_test_function_response_200.py b/src/convoy/models/post_v1_projects_project_id_sources_test_function_response_200.py new file mode 100644 index 0000000..f1cc1e3 --- /dev/null +++ b/src/convoy/models/post_v1_projects_project_id_sources_test_function_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_function_response import ModelsFunctionResponse + + +T = TypeVar("T", bound="PostV1ProjectsProjectIDSourcesTestFunctionResponse200") + + +@_attrs_define +class PostV1ProjectsProjectIDSourcesTestFunctionResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsFunctionResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsFunctionResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_function_response import ModelsFunctionResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsFunctionResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsFunctionResponse.from_dict(_data) + + post_v1_projects_project_id_sources_test_function_response_200 = cls( + message=message, + status=status, + data=data, + ) + + post_v1_projects_project_id_sources_test_function_response_200.additional_properties = d + return post_v1_projects_project_id_sources_test_function_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/post_v1_projects_project_id_sources_test_function_response_400.py b/src/convoy/models/post_v1_projects_project_id_sources_test_function_response_400.py new file mode 100644 index 0000000..f20576b --- /dev/null +++ b/src/convoy/models/post_v1_projects_project_id_sources_test_function_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="PostV1ProjectsProjectIDSourcesTestFunctionResponse400") + + +@_attrs_define +class PostV1ProjectsProjectIDSourcesTestFunctionResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + post_v1_projects_project_id_sources_test_function_response_400 = cls( + message=message, + status=status, + data=data, + ) + + post_v1_projects_project_id_sources_test_function_response_400.additional_properties = d + return post_v1_projects_project_id_sources_test_function_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/post_v1_projects_project_id_sources_test_function_response_401.py b/src/convoy/models/post_v1_projects_project_id_sources_test_function_response_401.py new file mode 100644 index 0000000..0b3c170 --- /dev/null +++ b/src/convoy/models/post_v1_projects_project_id_sources_test_function_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="PostV1ProjectsProjectIDSourcesTestFunctionResponse401") + + +@_attrs_define +class PostV1ProjectsProjectIDSourcesTestFunctionResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + post_v1_projects_project_id_sources_test_function_response_401 = cls( + message=message, + status=status, + data=data, + ) + + post_v1_projects_project_id_sources_test_function_response_401.additional_properties = d + return post_v1_projects_project_id_sources_test_function_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/post_v1_projects_project_id_sources_test_function_response_404.py b/src/convoy/models/post_v1_projects_project_id_sources_test_function_response_404.py new file mode 100644 index 0000000..93e652c --- /dev/null +++ b/src/convoy/models/post_v1_projects_project_id_sources_test_function_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="PostV1ProjectsProjectIDSourcesTestFunctionResponse404") + + +@_attrs_define +class PostV1ProjectsProjectIDSourcesTestFunctionResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + post_v1_projects_project_id_sources_test_function_response_404 = cls( + message=message, + status=status, + data=data, + ) + + post_v1_projects_project_id_sources_test_function_response_404.additional_properties = d + return post_v1_projects_project_id_sources_test_function_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/refresh_portal_link_auth_token_response_200.py b/src/convoy/models/refresh_portal_link_auth_token_response_200.py new file mode 100644 index 0000000..2930dda --- /dev/null +++ b/src/convoy/models/refresh_portal_link_auth_token_response_200.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RefreshPortalLinkAuthTokenResponse200") + + +@_attrs_define +class RefreshPortalLinkAuthTokenResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (str | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data = self.data + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + data = d.pop("data", UNSET) + + refresh_portal_link_auth_token_response_200 = cls( + message=message, + status=status, + data=data, + ) + + refresh_portal_link_auth_token_response_200.additional_properties = d + return refresh_portal_link_auth_token_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/refresh_portal_link_auth_token_response_400.py b/src/convoy/models/refresh_portal_link_auth_token_response_400.py new file mode 100644 index 0000000..a50be80 --- /dev/null +++ b/src/convoy/models/refresh_portal_link_auth_token_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="RefreshPortalLinkAuthTokenResponse400") + + +@_attrs_define +class RefreshPortalLinkAuthTokenResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + refresh_portal_link_auth_token_response_400 = cls( + message=message, + status=status, + data=data, + ) + + refresh_portal_link_auth_token_response_400.additional_properties = d + return refresh_portal_link_auth_token_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/refresh_portal_link_auth_token_response_401.py b/src/convoy/models/refresh_portal_link_auth_token_response_401.py new file mode 100644 index 0000000..c24a5f6 --- /dev/null +++ b/src/convoy/models/refresh_portal_link_auth_token_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="RefreshPortalLinkAuthTokenResponse401") + + +@_attrs_define +class RefreshPortalLinkAuthTokenResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + refresh_portal_link_auth_token_response_401 = cls( + message=message, + status=status, + data=data, + ) + + refresh_portal_link_auth_token_response_401.additional_properties = d + return refresh_portal_link_auth_token_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/refresh_portal_link_auth_token_response_404.py b/src/convoy/models/refresh_portal_link_auth_token_response_404.py new file mode 100644 index 0000000..d44e765 --- /dev/null +++ b/src/convoy/models/refresh_portal_link_auth_token_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="RefreshPortalLinkAuthTokenResponse404") + + +@_attrs_define +class RefreshPortalLinkAuthTokenResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + refresh_portal_link_auth_token_response_404 = cls( + message=message, + status=status, + data=data, + ) + + refresh_portal_link_auth_token_response_404.additional_properties = d + return refresh_portal_link_auth_token_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/replay_endpoint_event_response_200.py b/src/convoy/models/replay_endpoint_event_response_200.py new file mode 100644 index 0000000..d306c3e --- /dev/null +++ b/src/convoy/models/replay_endpoint_event_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_event_response import ModelsEventResponse + + +T = TypeVar("T", bound="ReplayEndpointEventResponse200") + + +@_attrs_define +class ReplayEndpointEventResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEventResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEventResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_event_response import ModelsEventResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEventResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEventResponse.from_dict(_data) + + replay_endpoint_event_response_200 = cls( + message=message, + status=status, + data=data, + ) + + replay_endpoint_event_response_200.additional_properties = d + return replay_endpoint_event_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/replay_endpoint_event_response_400.py b/src/convoy/models/replay_endpoint_event_response_400.py new file mode 100644 index 0000000..91cebf4 --- /dev/null +++ b/src/convoy/models/replay_endpoint_event_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ReplayEndpointEventResponse400") + + +@_attrs_define +class ReplayEndpointEventResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + replay_endpoint_event_response_400 = cls( + message=message, + status=status, + data=data, + ) + + replay_endpoint_event_response_400.additional_properties = d + return replay_endpoint_event_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/replay_endpoint_event_response_401.py b/src/convoy/models/replay_endpoint_event_response_401.py new file mode 100644 index 0000000..470725e --- /dev/null +++ b/src/convoy/models/replay_endpoint_event_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ReplayEndpointEventResponse401") + + +@_attrs_define +class ReplayEndpointEventResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + replay_endpoint_event_response_401 = cls( + message=message, + status=status, + data=data, + ) + + replay_endpoint_event_response_401.additional_properties = d + return replay_endpoint_event_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/replay_endpoint_event_response_404.py b/src/convoy/models/replay_endpoint_event_response_404.py new file mode 100644 index 0000000..a181807 --- /dev/null +++ b/src/convoy/models/replay_endpoint_event_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ReplayEndpointEventResponse404") + + +@_attrs_define +class ReplayEndpointEventResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + replay_endpoint_event_response_404 = cls( + message=message, + status=status, + data=data, + ) + + replay_endpoint_event_response_404.additional_properties = d + return replay_endpoint_event_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/resend_event_delivery_response_200.py b/src/convoy/models/resend_event_delivery_response_200.py new file mode 100644 index 0000000..e7fb307 --- /dev/null +++ b/src/convoy/models/resend_event_delivery_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_event_delivery_response import ModelsEventDeliveryResponse + + +T = TypeVar("T", bound="ResendEventDeliveryResponse200") + + +@_attrs_define +class ResendEventDeliveryResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEventDeliveryResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEventDeliveryResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_event_delivery_response import ModelsEventDeliveryResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEventDeliveryResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEventDeliveryResponse.from_dict(_data) + + resend_event_delivery_response_200 = cls( + message=message, + status=status, + data=data, + ) + + resend_event_delivery_response_200.additional_properties = d + return resend_event_delivery_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/resend_event_delivery_response_400.py b/src/convoy/models/resend_event_delivery_response_400.py new file mode 100644 index 0000000..1774572 --- /dev/null +++ b/src/convoy/models/resend_event_delivery_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ResendEventDeliveryResponse400") + + +@_attrs_define +class ResendEventDeliveryResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + resend_event_delivery_response_400 = cls( + message=message, + status=status, + data=data, + ) + + resend_event_delivery_response_400.additional_properties = d + return resend_event_delivery_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/resend_event_delivery_response_401.py b/src/convoy/models/resend_event_delivery_response_401.py new file mode 100644 index 0000000..c7d6e4a --- /dev/null +++ b/src/convoy/models/resend_event_delivery_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ResendEventDeliveryResponse401") + + +@_attrs_define +class ResendEventDeliveryResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + resend_event_delivery_response_401 = cls( + message=message, + status=status, + data=data, + ) + + resend_event_delivery_response_401.additional_properties = d + return resend_event_delivery_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/resend_event_delivery_response_404.py b/src/convoy/models/resend_event_delivery_response_404.py new file mode 100644 index 0000000..3a99e25 --- /dev/null +++ b/src/convoy/models/resend_event_delivery_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ResendEventDeliveryResponse404") + + +@_attrs_define +class ResendEventDeliveryResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + resend_event_delivery_response_404 = cls( + message=message, + status=status, + data=data, + ) + + resend_event_delivery_response_404.additional_properties = d + return resend_event_delivery_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/resend_meta_event_response_200.py b/src/convoy/models/resend_meta_event_response_200.py new file mode 100644 index 0000000..784d272 --- /dev/null +++ b/src/convoy/models/resend_meta_event_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_meta_event_response import ModelsMetaEventResponse + + +T = TypeVar("T", bound="ResendMetaEventResponse200") + + +@_attrs_define +class ResendMetaEventResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsMetaEventResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsMetaEventResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_meta_event_response import ModelsMetaEventResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsMetaEventResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsMetaEventResponse.from_dict(_data) + + resend_meta_event_response_200 = cls( + message=message, + status=status, + data=data, + ) + + resend_meta_event_response_200.additional_properties = d + return resend_meta_event_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/resend_meta_event_response_400.py b/src/convoy/models/resend_meta_event_response_400.py new file mode 100644 index 0000000..b0abb37 --- /dev/null +++ b/src/convoy/models/resend_meta_event_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ResendMetaEventResponse400") + + +@_attrs_define +class ResendMetaEventResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + resend_meta_event_response_400 = cls( + message=message, + status=status, + data=data, + ) + + resend_meta_event_response_400.additional_properties = d + return resend_meta_event_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/resend_meta_event_response_401.py b/src/convoy/models/resend_meta_event_response_401.py new file mode 100644 index 0000000..874ad78 --- /dev/null +++ b/src/convoy/models/resend_meta_event_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ResendMetaEventResponse401") + + +@_attrs_define +class ResendMetaEventResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + resend_meta_event_response_401 = cls( + message=message, + status=status, + data=data, + ) + + resend_meta_event_response_401.additional_properties = d + return resend_meta_event_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/resend_meta_event_response_404.py b/src/convoy/models/resend_meta_event_response_404.py new file mode 100644 index 0000000..1fc4db8 --- /dev/null +++ b/src/convoy/models/resend_meta_event_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ResendMetaEventResponse404") + + +@_attrs_define +class ResendMetaEventResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + resend_meta_event_response_404 = cls( + message=message, + status=status, + data=data, + ) + + resend_meta_event_response_404.additional_properties = d + return resend_meta_event_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/revoke_portal_link_response_200.py b/src/convoy/models/revoke_portal_link_response_200.py new file mode 100644 index 0000000..84adb1a --- /dev/null +++ b/src/convoy/models/revoke_portal_link_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="RevokePortalLinkResponse200") + + +@_attrs_define +class RevokePortalLinkResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + revoke_portal_link_response_200 = cls( + message=message, + status=status, + data=data, + ) + + revoke_portal_link_response_200.additional_properties = d + return revoke_portal_link_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/revoke_portal_link_response_400.py b/src/convoy/models/revoke_portal_link_response_400.py new file mode 100644 index 0000000..6f460c8 --- /dev/null +++ b/src/convoy/models/revoke_portal_link_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="RevokePortalLinkResponse400") + + +@_attrs_define +class RevokePortalLinkResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + revoke_portal_link_response_400 = cls( + message=message, + status=status, + data=data, + ) + + revoke_portal_link_response_400.additional_properties = d + return revoke_portal_link_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/revoke_portal_link_response_401.py b/src/convoy/models/revoke_portal_link_response_401.py new file mode 100644 index 0000000..317f755 --- /dev/null +++ b/src/convoy/models/revoke_portal_link_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="RevokePortalLinkResponse401") + + +@_attrs_define +class RevokePortalLinkResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + revoke_portal_link_response_401 = cls( + message=message, + status=status, + data=data, + ) + + revoke_portal_link_response_401.additional_properties = d + return revoke_portal_link_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/revoke_portal_link_response_404.py b/src/convoy/models/revoke_portal_link_response_404.py new file mode 100644 index 0000000..23468be --- /dev/null +++ b/src/convoy/models/revoke_portal_link_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="RevokePortalLinkResponse404") + + +@_attrs_define +class RevokePortalLinkResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + revoke_portal_link_response_404 = cls( + message=message, + status=status, + data=data, + ) + + revoke_portal_link_response_404.additional_properties = d + return revoke_portal_link_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_filter_response_200.py b/src/convoy/models/test_filter_response_200.py new file mode 100644 index 0000000..eaa6efa --- /dev/null +++ b/src/convoy/models/test_filter_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_test_filter_response import ModelsTestFilterResponse + + +T = TypeVar("T", bound="TestFilterResponse200") + + +@_attrs_define +class TestFilterResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsTestFilterResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsTestFilterResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_test_filter_response import ModelsTestFilterResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsTestFilterResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsTestFilterResponse.from_dict(_data) + + test_filter_response_200 = cls( + message=message, + status=status, + data=data, + ) + + test_filter_response_200.additional_properties = d + return test_filter_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_filter_response_400.py b/src/convoy/models/test_filter_response_400.py new file mode 100644 index 0000000..757e2d8 --- /dev/null +++ b/src/convoy/models/test_filter_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="TestFilterResponse400") + + +@_attrs_define +class TestFilterResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + test_filter_response_400 = cls( + message=message, + status=status, + data=data, + ) + + test_filter_response_400.additional_properties = d + return test_filter_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_filter_response_401.py b/src/convoy/models/test_filter_response_401.py new file mode 100644 index 0000000..a420707 --- /dev/null +++ b/src/convoy/models/test_filter_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="TestFilterResponse401") + + +@_attrs_define +class TestFilterResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + test_filter_response_401 = cls( + message=message, + status=status, + data=data, + ) + + test_filter_response_401.additional_properties = d + return test_filter_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_filter_response_404.py b/src/convoy/models/test_filter_response_404.py new file mode 100644 index 0000000..38733e1 --- /dev/null +++ b/src/convoy/models/test_filter_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="TestFilterResponse404") + + +@_attrs_define +class TestFilterResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + test_filter_response_404 = cls( + message=message, + status=status, + data=data, + ) + + test_filter_response_404.additional_properties = d + return test_filter_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_o_auth_2_connection_response_200.py b/src/convoy/models/test_o_auth_2_connection_response_200.py new file mode 100644 index 0000000..4c60e78 --- /dev/null +++ b/src/convoy/models/test_o_auth_2_connection_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_test_o_auth_2_response import ModelsTestOAuth2Response + + +T = TypeVar("T", bound="TestOAuth2ConnectionResponse200") + + +@_attrs_define +class TestOAuth2ConnectionResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsTestOAuth2Response | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsTestOAuth2Response | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_test_o_auth_2_response import ModelsTestOAuth2Response + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsTestOAuth2Response | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsTestOAuth2Response.from_dict(_data) + + test_o_auth_2_connection_response_200 = cls( + message=message, + status=status, + data=data, + ) + + test_o_auth_2_connection_response_200.additional_properties = d + return test_o_auth_2_connection_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_o_auth_2_connection_response_400.py b/src/convoy/models/test_o_auth_2_connection_response_400.py new file mode 100644 index 0000000..e30af78 --- /dev/null +++ b/src/convoy/models/test_o_auth_2_connection_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="TestOAuth2ConnectionResponse400") + + +@_attrs_define +class TestOAuth2ConnectionResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + test_o_auth_2_connection_response_400 = cls( + message=message, + status=status, + data=data, + ) + + test_o_auth_2_connection_response_400.additional_properties = d + return test_o_auth_2_connection_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_o_auth_2_connection_response_401.py b/src/convoy/models/test_o_auth_2_connection_response_401.py new file mode 100644 index 0000000..a47600a --- /dev/null +++ b/src/convoy/models/test_o_auth_2_connection_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="TestOAuth2ConnectionResponse401") + + +@_attrs_define +class TestOAuth2ConnectionResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + test_o_auth_2_connection_response_401 = cls( + message=message, + status=status, + data=data, + ) + + test_o_auth_2_connection_response_401.additional_properties = d + return test_o_auth_2_connection_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_o_auth_2_connection_response_404.py b/src/convoy/models/test_o_auth_2_connection_response_404.py new file mode 100644 index 0000000..d6aa225 --- /dev/null +++ b/src/convoy/models/test_o_auth_2_connection_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="TestOAuth2ConnectionResponse404") + + +@_attrs_define +class TestOAuth2ConnectionResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + test_o_auth_2_connection_response_404 = cls( + message=message, + status=status, + data=data, + ) + + test_o_auth_2_connection_response_404.additional_properties = d + return test_o_auth_2_connection_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_subscription_filter_response_200.py b/src/convoy/models/test_subscription_filter_response_200.py new file mode 100644 index 0000000..6b85be3 --- /dev/null +++ b/src/convoy/models/test_subscription_filter_response_200.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TestSubscriptionFilterResponse200") + + +@_attrs_define +class TestSubscriptionFilterResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (bool | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: bool | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data = self.data + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + data = d.pop("data", UNSET) + + test_subscription_filter_response_200 = cls( + message=message, + status=status, + data=data, + ) + + test_subscription_filter_response_200.additional_properties = d + return test_subscription_filter_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_subscription_filter_response_400.py b/src/convoy/models/test_subscription_filter_response_400.py new file mode 100644 index 0000000..cf38628 --- /dev/null +++ b/src/convoy/models/test_subscription_filter_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="TestSubscriptionFilterResponse400") + + +@_attrs_define +class TestSubscriptionFilterResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + test_subscription_filter_response_400 = cls( + message=message, + status=status, + data=data, + ) + + test_subscription_filter_response_400.additional_properties = d + return test_subscription_filter_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_subscription_filter_response_401.py b/src/convoy/models/test_subscription_filter_response_401.py new file mode 100644 index 0000000..c1ab22a --- /dev/null +++ b/src/convoy/models/test_subscription_filter_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="TestSubscriptionFilterResponse401") + + +@_attrs_define +class TestSubscriptionFilterResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + test_subscription_filter_response_401 = cls( + message=message, + status=status, + data=data, + ) + + test_subscription_filter_response_401.additional_properties = d + return test_subscription_filter_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_subscription_filter_response_404.py b/src/convoy/models/test_subscription_filter_response_404.py new file mode 100644 index 0000000..19d83ab --- /dev/null +++ b/src/convoy/models/test_subscription_filter_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="TestSubscriptionFilterResponse404") + + +@_attrs_define +class TestSubscriptionFilterResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + test_subscription_filter_response_404 = cls( + message=message, + status=status, + data=data, + ) + + test_subscription_filter_response_404.additional_properties = d + return test_subscription_filter_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_subscription_function_response_200.py b/src/convoy/models/test_subscription_function_response_200.py new file mode 100644 index 0000000..b8cd829 --- /dev/null +++ b/src/convoy/models/test_subscription_function_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_function_response import ModelsFunctionResponse + + +T = TypeVar("T", bound="TestSubscriptionFunctionResponse200") + + +@_attrs_define +class TestSubscriptionFunctionResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsFunctionResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsFunctionResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_function_response import ModelsFunctionResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsFunctionResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsFunctionResponse.from_dict(_data) + + test_subscription_function_response_200 = cls( + message=message, + status=status, + data=data, + ) + + test_subscription_function_response_200.additional_properties = d + return test_subscription_function_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_subscription_function_response_400.py b/src/convoy/models/test_subscription_function_response_400.py new file mode 100644 index 0000000..223fbfd --- /dev/null +++ b/src/convoy/models/test_subscription_function_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="TestSubscriptionFunctionResponse400") + + +@_attrs_define +class TestSubscriptionFunctionResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + test_subscription_function_response_400 = cls( + message=message, + status=status, + data=data, + ) + + test_subscription_function_response_400.additional_properties = d + return test_subscription_function_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_subscription_function_response_401.py b/src/convoy/models/test_subscription_function_response_401.py new file mode 100644 index 0000000..9a402de --- /dev/null +++ b/src/convoy/models/test_subscription_function_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="TestSubscriptionFunctionResponse401") + + +@_attrs_define +class TestSubscriptionFunctionResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + test_subscription_function_response_401 = cls( + message=message, + status=status, + data=data, + ) + + test_subscription_function_response_401.additional_properties = d + return test_subscription_function_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/test_subscription_function_response_404.py b/src/convoy/models/test_subscription_function_response_404.py new file mode 100644 index 0000000..62bc45c --- /dev/null +++ b/src/convoy/models/test_subscription_function_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="TestSubscriptionFunctionResponse404") + + +@_attrs_define +class TestSubscriptionFunctionResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + test_subscription_function_response_404 = cls( + message=message, + status=status, + data=data, + ) + + test_subscription_function_response_404.additional_properties = d + return test_subscription_function_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/toggle_subscription_status_response_202.py b/src/convoy/models/toggle_subscription_status_response_202.py new file mode 100644 index 0000000..37c5e61 --- /dev/null +++ b/src/convoy/models/toggle_subscription_status_response_202.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ToggleSubscriptionStatusResponse202") + + +@_attrs_define +class ToggleSubscriptionStatusResponse202: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + toggle_subscription_status_response_202 = cls( + message=message, + status=status, + data=data, + ) + + toggle_subscription_status_response_202.additional_properties = d + return toggle_subscription_status_response_202 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/toggle_subscription_status_response_400.py b/src/convoy/models/toggle_subscription_status_response_400.py new file mode 100644 index 0000000..4a934b3 --- /dev/null +++ b/src/convoy/models/toggle_subscription_status_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ToggleSubscriptionStatusResponse400") + + +@_attrs_define +class ToggleSubscriptionStatusResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + toggle_subscription_status_response_400 = cls( + message=message, + status=status, + data=data, + ) + + toggle_subscription_status_response_400.additional_properties = d + return toggle_subscription_status_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/toggle_subscription_status_response_401.py b/src/convoy/models/toggle_subscription_status_response_401.py new file mode 100644 index 0000000..45fbd32 --- /dev/null +++ b/src/convoy/models/toggle_subscription_status_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ToggleSubscriptionStatusResponse401") + + +@_attrs_define +class ToggleSubscriptionStatusResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + toggle_subscription_status_response_401 = cls( + message=message, + status=status, + data=data, + ) + + toggle_subscription_status_response_401.additional_properties = d + return toggle_subscription_status_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/toggle_subscription_status_response_404.py b/src/convoy/models/toggle_subscription_status_response_404.py new file mode 100644 index 0000000..ace2095 --- /dev/null +++ b/src/convoy/models/toggle_subscription_status_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="ToggleSubscriptionStatusResponse404") + + +@_attrs_define +class ToggleSubscriptionStatusResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + toggle_subscription_status_response_404 = cls( + message=message, + status=status, + data=data, + ) + + toggle_subscription_status_response_404.additional_properties = d + return toggle_subscription_status_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_endpoint_response_202.py b/src/convoy/models/update_endpoint_response_202.py new file mode 100644 index 0000000..a5b908e --- /dev/null +++ b/src/convoy/models/update_endpoint_response_202.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_endpoint_response import ModelsEndpointResponse + + +T = TypeVar("T", bound="UpdateEndpointResponse202") + + +@_attrs_define +class UpdateEndpointResponse202: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEndpointResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEndpointResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_endpoint_response import ModelsEndpointResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEndpointResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEndpointResponse.from_dict(_data) + + update_endpoint_response_202 = cls( + message=message, + status=status, + data=data, + ) + + update_endpoint_response_202.additional_properties = d + return update_endpoint_response_202 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_endpoint_response_400.py b/src/convoy/models/update_endpoint_response_400.py new file mode 100644 index 0000000..e45970b --- /dev/null +++ b/src/convoy/models/update_endpoint_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateEndpointResponse400") + + +@_attrs_define +class UpdateEndpointResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_endpoint_response_400 = cls( + message=message, + status=status, + data=data, + ) + + update_endpoint_response_400.additional_properties = d + return update_endpoint_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_endpoint_response_401.py b/src/convoy/models/update_endpoint_response_401.py new file mode 100644 index 0000000..58e0d8b --- /dev/null +++ b/src/convoy/models/update_endpoint_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateEndpointResponse401") + + +@_attrs_define +class UpdateEndpointResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_endpoint_response_401 = cls( + message=message, + status=status, + data=data, + ) + + update_endpoint_response_401.additional_properties = d + return update_endpoint_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_endpoint_response_404.py b/src/convoy/models/update_endpoint_response_404.py new file mode 100644 index 0000000..ec5f715 --- /dev/null +++ b/src/convoy/models/update_endpoint_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateEndpointResponse404") + + +@_attrs_define +class UpdateEndpointResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_endpoint_response_404 = cls( + message=message, + status=status, + data=data, + ) + + update_endpoint_response_404.additional_properties = d + return update_endpoint_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_event_type_response_201.py b/src/convoy/models/update_event_type_response_201.py new file mode 100644 index 0000000..7c227bb --- /dev/null +++ b/src/convoy/models/update_event_type_response_201.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_event_type_response import ModelsEventTypeResponse + + +T = TypeVar("T", bound="UpdateEventTypeResponse201") + + +@_attrs_define +class UpdateEventTypeResponse201: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsEventTypeResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsEventTypeResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_event_type_response import ModelsEventTypeResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsEventTypeResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsEventTypeResponse.from_dict(_data) + + update_event_type_response_201 = cls( + message=message, + status=status, + data=data, + ) + + update_event_type_response_201.additional_properties = d + return update_event_type_response_201 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_event_type_response_400.py b/src/convoy/models/update_event_type_response_400.py new file mode 100644 index 0000000..d926ad1 --- /dev/null +++ b/src/convoy/models/update_event_type_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateEventTypeResponse400") + + +@_attrs_define +class UpdateEventTypeResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_event_type_response_400 = cls( + message=message, + status=status, + data=data, + ) + + update_event_type_response_400.additional_properties = d + return update_event_type_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_event_type_response_401.py b/src/convoy/models/update_event_type_response_401.py new file mode 100644 index 0000000..a158cb2 --- /dev/null +++ b/src/convoy/models/update_event_type_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateEventTypeResponse401") + + +@_attrs_define +class UpdateEventTypeResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_event_type_response_401 = cls( + message=message, + status=status, + data=data, + ) + + update_event_type_response_401.additional_properties = d + return update_event_type_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_event_type_response_404.py b/src/convoy/models/update_event_type_response_404.py new file mode 100644 index 0000000..fe4d21d --- /dev/null +++ b/src/convoy/models/update_event_type_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateEventTypeResponse404") + + +@_attrs_define +class UpdateEventTypeResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_event_type_response_404 = cls( + message=message, + status=status, + data=data, + ) + + update_event_type_response_404.additional_properties = d + return update_event_type_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_filter_response_200.py b/src/convoy/models/update_filter_response_200.py new file mode 100644 index 0000000..bddb571 --- /dev/null +++ b/src/convoy/models/update_filter_response_200.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_filter_response import ModelsFilterResponse + + +T = TypeVar("T", bound="UpdateFilterResponse200") + + +@_attrs_define +class UpdateFilterResponse200: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsFilterResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsFilterResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_filter_response import ModelsFilterResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsFilterResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsFilterResponse.from_dict(_data) + + update_filter_response_200 = cls( + message=message, + status=status, + data=data, + ) + + update_filter_response_200.additional_properties = d + return update_filter_response_200 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_filter_response_400.py b/src/convoy/models/update_filter_response_400.py new file mode 100644 index 0000000..72ae4d9 --- /dev/null +++ b/src/convoy/models/update_filter_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateFilterResponse400") + + +@_attrs_define +class UpdateFilterResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_filter_response_400 = cls( + message=message, + status=status, + data=data, + ) + + update_filter_response_400.additional_properties = d + return update_filter_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_filter_response_401.py b/src/convoy/models/update_filter_response_401.py new file mode 100644 index 0000000..5bf9bb4 --- /dev/null +++ b/src/convoy/models/update_filter_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateFilterResponse401") + + +@_attrs_define +class UpdateFilterResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_filter_response_401 = cls( + message=message, + status=status, + data=data, + ) + + update_filter_response_401.additional_properties = d + return update_filter_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_filter_response_404.py b/src/convoy/models/update_filter_response_404.py new file mode 100644 index 0000000..533869d --- /dev/null +++ b/src/convoy/models/update_filter_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateFilterResponse404") + + +@_attrs_define +class UpdateFilterResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_filter_response_404 = cls( + message=message, + status=status, + data=data, + ) + + update_filter_response_404.additional_properties = d + return update_filter_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_portal_link_response_202.py b/src/convoy/models/update_portal_link_response_202.py new file mode 100644 index 0000000..bd0d3ea --- /dev/null +++ b/src/convoy/models/update_portal_link_response_202.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.datastore_portal_link_response import DatastorePortalLinkResponse + + +T = TypeVar("T", bound="UpdatePortalLinkResponse202") + + +@_attrs_define +class UpdatePortalLinkResponse202: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (DatastorePortalLinkResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: DatastorePortalLinkResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.datastore_portal_link_response import DatastorePortalLinkResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: DatastorePortalLinkResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = DatastorePortalLinkResponse.from_dict(_data) + + update_portal_link_response_202 = cls( + message=message, + status=status, + data=data, + ) + + update_portal_link_response_202.additional_properties = d + return update_portal_link_response_202 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_portal_link_response_400.py b/src/convoy/models/update_portal_link_response_400.py new file mode 100644 index 0000000..f30a642 --- /dev/null +++ b/src/convoy/models/update_portal_link_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdatePortalLinkResponse400") + + +@_attrs_define +class UpdatePortalLinkResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_portal_link_response_400 = cls( + message=message, + status=status, + data=data, + ) + + update_portal_link_response_400.additional_properties = d + return update_portal_link_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_portal_link_response_401.py b/src/convoy/models/update_portal_link_response_401.py new file mode 100644 index 0000000..ce6a5de --- /dev/null +++ b/src/convoy/models/update_portal_link_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdatePortalLinkResponse401") + + +@_attrs_define +class UpdatePortalLinkResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_portal_link_response_401 = cls( + message=message, + status=status, + data=data, + ) + + update_portal_link_response_401.additional_properties = d + return update_portal_link_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_portal_link_response_404.py b/src/convoy/models/update_portal_link_response_404.py new file mode 100644 index 0000000..92863be --- /dev/null +++ b/src/convoy/models/update_portal_link_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdatePortalLinkResponse404") + + +@_attrs_define +class UpdatePortalLinkResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_portal_link_response_404 = cls( + message=message, + status=status, + data=data, + ) + + update_portal_link_response_404.additional_properties = d + return update_portal_link_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_project_response_202.py b/src/convoy/models/update_project_response_202.py new file mode 100644 index 0000000..98f71a2 --- /dev/null +++ b/src/convoy/models/update_project_response_202.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_project_response import ModelsProjectResponse + + +T = TypeVar("T", bound="UpdateProjectResponse202") + + +@_attrs_define +class UpdateProjectResponse202: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsProjectResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsProjectResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_project_response import ModelsProjectResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsProjectResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsProjectResponse.from_dict(_data) + + update_project_response_202 = cls( + message=message, + status=status, + data=data, + ) + + update_project_response_202.additional_properties = d + return update_project_response_202 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_project_response_400.py b/src/convoy/models/update_project_response_400.py new file mode 100644 index 0000000..5e66d98 --- /dev/null +++ b/src/convoy/models/update_project_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateProjectResponse400") + + +@_attrs_define +class UpdateProjectResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_project_response_400 = cls( + message=message, + status=status, + data=data, + ) + + update_project_response_400.additional_properties = d + return update_project_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_project_response_401.py b/src/convoy/models/update_project_response_401.py new file mode 100644 index 0000000..783c50d --- /dev/null +++ b/src/convoy/models/update_project_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateProjectResponse401") + + +@_attrs_define +class UpdateProjectResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_project_response_401 = cls( + message=message, + status=status, + data=data, + ) + + update_project_response_401.additional_properties = d + return update_project_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_project_response_403.py b/src/convoy/models/update_project_response_403.py new file mode 100644 index 0000000..381b90b --- /dev/null +++ b/src/convoy/models/update_project_response_403.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateProjectResponse403") + + +@_attrs_define +class UpdateProjectResponse403: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_project_response_403 = cls( + message=message, + status=status, + data=data, + ) + + update_project_response_403.additional_properties = d + return update_project_response_403 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_project_response_404.py b/src/convoy/models/update_project_response_404.py new file mode 100644 index 0000000..40a0e83 --- /dev/null +++ b/src/convoy/models/update_project_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateProjectResponse404") + + +@_attrs_define +class UpdateProjectResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_project_response_404 = cls( + message=message, + status=status, + data=data, + ) + + update_project_response_404.additional_properties = d + return update_project_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_source_response_202.py b/src/convoy/models/update_source_response_202.py new file mode 100644 index 0000000..8c6601c --- /dev/null +++ b/src/convoy/models/update_source_response_202.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_source_response import ModelsSourceResponse + + +T = TypeVar("T", bound="UpdateSourceResponse202") + + +@_attrs_define +class UpdateSourceResponse202: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsSourceResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsSourceResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_source_response import ModelsSourceResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsSourceResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsSourceResponse.from_dict(_data) + + update_source_response_202 = cls( + message=message, + status=status, + data=data, + ) + + update_source_response_202.additional_properties = d + return update_source_response_202 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_source_response_400.py b/src/convoy/models/update_source_response_400.py new file mode 100644 index 0000000..b173289 --- /dev/null +++ b/src/convoy/models/update_source_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateSourceResponse400") + + +@_attrs_define +class UpdateSourceResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_source_response_400 = cls( + message=message, + status=status, + data=data, + ) + + update_source_response_400.additional_properties = d + return update_source_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_source_response_401.py b/src/convoy/models/update_source_response_401.py new file mode 100644 index 0000000..41d2298 --- /dev/null +++ b/src/convoy/models/update_source_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateSourceResponse401") + + +@_attrs_define +class UpdateSourceResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_source_response_401 = cls( + message=message, + status=status, + data=data, + ) + + update_source_response_401.additional_properties = d + return update_source_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_source_response_404.py b/src/convoy/models/update_source_response_404.py new file mode 100644 index 0000000..ebaf59c --- /dev/null +++ b/src/convoy/models/update_source_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateSourceResponse404") + + +@_attrs_define +class UpdateSourceResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_source_response_404 = cls( + message=message, + status=status, + data=data, + ) + + update_source_response_404.additional_properties = d + return update_source_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_subscription_response_202.py b/src/convoy/models/update_subscription_response_202.py new file mode 100644 index 0000000..3404c8e --- /dev/null +++ b/src/convoy/models/update_subscription_response_202.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.models_subscription_response import ModelsSubscriptionResponse + + +T = TypeVar("T", bound="UpdateSubscriptionResponse202") + + +@_attrs_define +class UpdateSubscriptionResponse202: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (ModelsSubscriptionResponse | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: ModelsSubscriptionResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.models_subscription_response import ModelsSubscriptionResponse + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: ModelsSubscriptionResponse | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = ModelsSubscriptionResponse.from_dict(_data) + + update_subscription_response_202 = cls( + message=message, + status=status, + data=data, + ) + + update_subscription_response_202.additional_properties = d + return update_subscription_response_202 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_subscription_response_400.py b/src/convoy/models/update_subscription_response_400.py new file mode 100644 index 0000000..7c42415 --- /dev/null +++ b/src/convoy/models/update_subscription_response_400.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateSubscriptionResponse400") + + +@_attrs_define +class UpdateSubscriptionResponse400: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_subscription_response_400 = cls( + message=message, + status=status, + data=data, + ) + + update_subscription_response_400.additional_properties = d + return update_subscription_response_400 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_subscription_response_401.py b/src/convoy/models/update_subscription_response_401.py new file mode 100644 index 0000000..4cebbad --- /dev/null +++ b/src/convoy/models/update_subscription_response_401.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateSubscriptionResponse401") + + +@_attrs_define +class UpdateSubscriptionResponse401: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_subscription_response_401 = cls( + message=message, + status=status, + data=data, + ) + + update_subscription_response_401.additional_properties = d + return update_subscription_response_401 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/update_subscription_response_404.py b/src/convoy/models/update_subscription_response_404.py new file mode 100644 index 0000000..c76b5df --- /dev/null +++ b/src/convoy/models/update_subscription_response_404.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.handlers_stub import HandlersStub + + +T = TypeVar("T", bound="UpdateSubscriptionResponse404") + + +@_attrs_define +class UpdateSubscriptionResponse404: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + data (HandlersStub | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + data: HandlersStub | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.handlers_stub import HandlersStub + + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + _data = d.pop("data", UNSET) + data: HandlersStub | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = HandlersStub.from_dict(_data) + + update_subscription_response_404 = cls( + message=message, + status=status, + data=data, + ) + + update_subscription_response_404.additional_properties = d + return update_subscription_response_404 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/models/util_server_response.py b/src/convoy/models/util_server_response.py new file mode 100644 index 0000000..28fd777 --- /dev/null +++ b/src/convoy/models/util_server_response.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UtilServerResponse") + + +@_attrs_define +class UtilServerResponse: + """ + Attributes: + message (str | Unset): + status (bool | Unset): + """ + + message: str | Unset = UNSET + status: bool | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + status = self.status + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if message is not UNSET: + field_dict["message"] = message + if status is not UNSET: + field_dict["status"] = status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message", UNSET) + + status = d.pop("status", UNSET) + + util_server_response = cls( + message=message, + status=status, + ) + + util_server_response.additional_properties = d + return util_server_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/convoy/types.py b/src/convoy/types.py new file mode 100644 index 0000000..b64af09 --- /dev/null +++ b/src/convoy/types.py @@ -0,0 +1,54 @@ +"""Contains some shared types for properties""" + +from collections.abc import Mapping, MutableMapping +from http import HTTPStatus +from typing import IO, BinaryIO, Generic, Literal, TypeVar + +from attrs import define + + +class Unset: + def __bool__(self) -> Literal[False]: + return False + + +UNSET: Unset = Unset() + +# The types that `httpx.Client(files=)` can accept, copied from that library. +FileContent = IO[bytes] | bytes | str +FileTypes = ( + # (filename, file (or bytes), content_type) + tuple[str | None, FileContent, str | None] + # (filename, file (or bytes), content_type, headers) + | tuple[str | None, FileContent, str | None, Mapping[str, str]] +) +RequestFiles = list[tuple[str, FileTypes]] + + +@define +class File: + """Contains information for file uploads""" + + payload: BinaryIO + file_name: str | None = None + mime_type: str | None = None + + def to_tuple(self) -> FileTypes: + """Return a tuple representation that httpx will accept for multipart/form-data""" + return self.file_name, self.payload, self.mime_type + + +T = TypeVar("T") + + +@define +class Response(Generic[T]): + """A response from an endpoint""" + + status_code: HTTPStatus + content: bytes + headers: MutableMapping[str, str] + parsed: T | None + + +__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"]