From c7e339f009820afe4d2e01b1ec28e124d8d27f1b Mon Sep 17 00:00:00 2001 From: sbansla Date: Fri, 4 Oct 2024 17:19:13 +0530 Subject: [PATCH] chore: autogenerating code from open api spec --- .../api/account_provisioning/v3/__init__.py | 2 +- .../v3/authenticate_account.py | 36 ++- .../account_provisioning/v3/create_account.py | 49 ++-- .../account_provisioning/v3/delete_account.py | 36 ++- .../v3/get_account_state.py | 37 ++- .../account_provisioning/v3/list_account.py | 39 ++- .../v3/list_account_offering.py | 37 ++- .../account_provisioning/v3/list_offering.py | 31 +-- .../v3/models/__init__.py | 77 ++++-- .../v3/models/account_list.py | 37 ++- .../v3/models/account_provisioning_account.py | 31 +-- .../models/account_provisioning_account_id.py | 26 +- .../v3/models/account_provisioning_catalog.py | 24 +- .../account_provisioning_offering_list.py | 28 +-- .../account_provisioning_offering_v1.py | 41 ++-- .../models/account_provisioning_pagination.py | 31 +-- .../v3/models/account_provisioning_profile.py | 73 +++--- .../models/account_provisioning_state_read.py | 26 +- .../account_provisioning_state_write.py | 26 +- .../v3/models/catalog_entry.py | 40 +-- .../v3/models/catalog_entry_entitlements.py | 49 ++-- .../v3/models/create_account_params.py | 38 +-- .../v3/models/error_response.py | 41 ++-- .../v3/models/offerings_to_add.py | 28 +-- .../account_provisioning/v3/models/state.py | 14 +- .../account_provisioning/v3/models/state1.py | 8 +- .../account_provisioning/v3/models/type.py | 8 +- .../v3/update_account_offering.py | 45 ++-- .../v3/update_account_state.py | 46 ++-- sendgrid/rest/api/alerts/v3/__init__.py | 2 +- sendgrid/rest/api/alerts/v3/create_alert.py | 45 ++-- sendgrid/rest/api/alerts/v3/delete_alert.py | 46 ++-- sendgrid/rest/api/alerts/v3/get_alert.py | 47 ++-- sendgrid/rest/api/alerts/v3/list_alert.py | 43 ++-- .../rest/api/alerts/v3/models/__init__.py | 35 ++- .../v3/models/create_alert201_response.py | 73 +++--- .../alerts/v3/models/create_alert_request.py | 49 ++-- .../api/alerts/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../alerts/v3/models/get_alert200_response.py | 73 +++--- .../v3/models/list_alert200_response_inner.py | 73 +++--- sendgrid/rest/api/alerts/v3/models/type.py | 8 +- sendgrid/rest/api/alerts/v3/models/type1.py | 8 +- sendgrid/rest/api/alerts/v3/models/type2.py | 8 +- sendgrid/rest/api/alerts/v3/models/type3.py | 8 +- .../v3/models/update_alert200_response.py | 73 +++--- .../alerts/v3/models/update_alert_request.py | 41 ++-- sendgrid/rest/api/alerts/v3/update_alert.py | 49 ++-- sendgrid/rest/api/api_keys/v3/__init__.py | 2 +- .../rest/api/api_keys/v3/create_api_key.py | 49 ++-- .../rest/api/api_keys/v3/delete_api_key.py | 46 ++-- sendgrid/rest/api/api_keys/v3/get_api_key.py | 47 ++-- sendgrid/rest/api/api_keys/v3/list_api_key.py | 45 ++-- .../rest/api/api_keys/v3/models/__init__.py | 49 +++- .../api_keys/v3/models/api_key_response.py | 31 +-- .../v3/models/api_key_scopes_response.py | 39 ++- .../v3/models/create_api_key201_response.py | 47 ++-- .../v3/models/create_api_key_request.py | 29 +-- .../api/api_keys/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../v3/models/get_api_key200_response.py | 28 +-- .../v3/models/list_api_key200_response.py | 24 +- .../v3/models/update_api_key_name_request.py | 26 +- .../v3/models/update_api_key_request.py | 29 +-- .../rest/api/api_keys/v3/update_api_key.py | 53 ++-- .../api/api_keys/v3/update_api_key_name.py | 53 ++-- .../api/domain_authentication/v3/__init__.py | 2 +- .../v3/add_ip_to_authenticated_domain.py | 55 +++-- .../v3/associate_subuser_with_domain.py | 47 ++-- .../associate_subuser_with_domain_multiple.py | 47 ++-- .../v3/authenticate_domain.py | 49 ++-- .../v3/delete_authenticated_domain.py | 46 ++-- .../v3/delete_ip_from_authenticated_domain.py | 51 ++-- ...ssociate_authenticated_domain_from_user.py | 36 ++- .../v3/disassociate_subuser_from_domain.py | 40 ++- .../v3/email_dns_record.py | 38 +-- .../v3/get_authenticated_domain.py | 47 ++-- ...list_all_authenticated_domain_with_user.py | 36 ++- .../v3/list_authenticated_domain.py | 53 ++-- .../v3/list_authenticated_domain_with_user.py | 36 ++- .../v3/list_default_authenticated_domain.py | 45 ++-- .../v3/models/__init__.py | 132 +++++++--- .../add_ip_to_authenticated_domain_request.py | 26 +- .../associate_subuser_with_domain_request.py | 26 +- .../v3/models/authenticate_domain_request.py | 87 ++++--- .../v3/models/authenticated_domain.py | 115 ++++----- .../v3/models/authenticated_domain_spf.py | 115 ++++----- .../v3/models/authenticated_domain_spf_dns.py | 65 ++--- .../authenticated_domain_spf_dns_dkim.py | 49 ++-- ...authenticated_domain_spf_dns_domain_spf.py | 49 ++-- ...uthenticated_domain_spf_dns_mail_server.py | 49 ++-- ...henticated_domain_spf_dns_subdomain_spf.py | 49 ++-- .../v3/models/email_dns_record400_response.py | 30 +-- .../email_dns_record400_response_errors.py | 31 +-- .../v3/models/email_dns_record_request.py | 49 ++-- ...ated_domain_with_user200_response_inner.py | 115 ++++----- ..._domain_with_user200_response_inner_dns.py | 55 +++-- ...n_with_user200_response_inner_dns_dkim1.py | 49 ++-- ...h_user200_response_inner_dns_mail_cname.py | 49 ++-- .../update_authenticated_domain_request.py | 30 +-- ...lidate_authenticated_domain200_response.py | 47 ++-- ...d_domain200_response_validation_results.py | 69 +++--- ...in200_response_validation_results_dkim1.py | 31 +-- ..._response_validation_results_mail_cname.py | 31 +-- ...main200_response_validation_results_spf.py | 31 +-- ...lidate_authenticated_domain500_response.py | 29 ++- ...ticated_domain500_response_errors_inner.py | 26 +- .../v3/update_authenticated_domain.py | 55 +++-- .../v3/validate_authenticated_domain.py | 47 ++-- .../rest/api/email_activity/v3/__init__.py | 2 +- .../api/email_activity/v3/download_csv.py | 37 ++- .../rest/api/email_activity/v3/get_message.py | 37 ++- .../api/email_activity/v3/list_message.py | 41 ++-- .../api/email_activity/v3/models/__init__.py | 70 +++++- .../email_activity/v3/models/abbv_message.py | 81 +++--- .../email_activity/v3/models/bounce_type.py | 8 +- .../email_activity/v3/models/bounce_type1.py | 8 +- .../v3/models/download_csv200_response.py | 32 +-- .../email_activity_response_base_props.py | 57 +++-- .../api/email_activity/v3/models/event.py | 81 +++--- .../email_activity/v3/models/event_name.py | 26 +- .../email_activity/v3/models/event_name1.py | 26 +- .../v3/models/get_message404_response.py | 28 +-- .../get_message404_response_errors_inner.py | 31 +-- .../v3/models/list_message200_response.py | 24 +- .../v3/models/list_message400_response.py | 26 +- .../list_message400_response_errors_inner.py | 26 +- .../v3/models/list_message429_response.py | 26 +- .../list_message429_response_errors_inner.py | 26 +- .../api/email_activity/v3/models/message.py | 135 +++++----- .../v3/models/outbound_ip_type.py | 8 +- .../v3/models/outbound_ip_type1.py | 8 +- .../v3/models/request_csv202_response.py | 31 +-- .../api/email_activity/v3/models/status.py | 10 +- .../api/email_activity/v3/models/status1.py | 10 +- .../api/email_activity/v3/models/status2.py | 6 +- .../api/email_activity/v3/models/status3.py | 10 +- .../rest/api/email_activity/v3/request_csv.py | 37 ++- .../rest/api/email_validation/v3/__init__.py | 2 +- .../v3/get_email_job_for_verification.py | 37 ++- .../v3/get_validations_email_jobs.py | 31 +-- .../v3/list_email_job_for_verification.py | 41 ++-- .../email_validation/v3/models/__init__.py | 92 +++++-- .../v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../email_validation/v3/models/file_type.py | 8 +- .../get_validations_email_jobs200_response.py | 27 +- ...ons_email_jobs200_response_result_inner.py | 49 ++-- ...lidations_email_jobs_job_id200_response.py | 28 +-- ...ns_email_jobs_job_id200_response_result.py | 85 +++---- ..._job_id200_response_result_errors_inner.py | 26 +- ...list_email_job_for_verification_request.py | 26 +- .../put_validations_email_jobs200_response.py | 45 ++-- ...l_jobs200_response_upload_headers_inner.py | 31 +-- .../api/email_validation/v3/models/status.py | 16 +- .../api/email_validation/v3/models/status1.py | 16 +- .../v3/models/validate_email200_response.py | 30 +-- .../validate_email200_response_result.py | 93 +++---- ...alidate_email200_response_result_checks.py | 53 ++-- ...il200_response_result_checks_additional.py | 33 ++- ..._email200_response_result_checks_domain.py | 43 ++-- ...il200_response_result_checks_local_part.py | 26 +- .../v3/models/validate_email_request.py | 31 +-- .../api/email_validation/v3/models/verdict.py | 10 +- .../api/email_validation/v3/validate_email.py | 39 ++- sendgrid/rest/api/enforced_tls/v3/__init__.py | 2 +- .../v3/list_enforced_tls_setting.py | 43 ++-- .../api/enforced_tls/v3/models/__init__.py | 19 +- .../models/enforced_tls_request_response.py | 41 ++-- .../enforced_tls/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../v3/update_enforced_tls_setting.py | 48 ++-- sendgrid/rest/api/integrations/v3/__init__.py | 2 +- .../api/integrations/v3/add_integration.py | 35 ++- .../api/integrations/v3/delete_integration.py | 36 ++- .../integrations/v3/find_integration_by_id.py | 37 ++- .../v3/get_integrations_by_user.py | 31 +-- .../api/integrations/v3/models/__init__.py | 106 ++++++-- .../v3/models/add_integration400_response.py | 24 +- .../models/delete_integration400_response.py | 28 +-- .../models/delete_integration404_response.py | 28 +-- .../api/integrations/v3/models/destination.py | 6 +- .../integrations/v3/models/destination1.py | 6 +- .../integrations/v3/models/destination2.py | 6 +- .../integrations/v3/models/destination3.py | 6 +- .../v3/models/destination_region.py | 8 +- .../v3/models/destination_region1.py | 8 +- .../v3/models/destination_region2.py | 8 +- .../api/integrations/v3/models/forbidden.py | 26 +- .../get_integrations_by_user200_response.py | 24 +- .../get_integrations_by_user403_response.py | 24 +- .../get_integrations_by_user500_response.py | 24 +- .../rest/api/integrations/v3/models/id.py | 26 +- .../api/integrations/v3/models/integration.py | 73 +++--- .../v3/models/integration_filters.py | 24 +- .../v3/models/integration_input.py | 57 +++-- .../v3/models/integration_input_filters.py | 24 +- .../v3/models/integration_input_properties.py | 37 +-- .../v3/models/integration_not_found.py | 26 +- .../v3/models/integration_patch.py | 57 +++-- .../v3/models/integration_patch_filters.py | 24 +- .../v3/models/integration_patch_properties.py | 37 +-- .../v3/models/integration_properties.py | 37 +-- .../integrations/v3/models/internal_error.py | 26 +- .../v3/models/invalid_delete_request.py | 32 +-- .../integrations/v3/models/invalid_request.py | 31 +-- .../rest/api/integrations/v3/models/items.py | 28 +-- .../rest/api/integrations/v3/models/items1.py | 28 +-- .../rest/api/integrations/v3/models/items2.py | 28 +-- .../api/integrations/v3/update_integration.py | 41 ++-- .../api/ip_access_management/v3/__init__.py | 2 +- .../v3/add_ip_to_allow_list.py | 49 ++-- .../v3/delete_allowed_ip.py | 46 ++-- .../v3/delete_allowed_ips.py | 48 ++-- .../ip_access_management/v3/get_allowed_ip.py | 47 ++-- .../v3/list_access_activity.py | 45 ++-- .../v3/list_allowed_ip.py | 43 ++-- .../v3/models/__init__.py | 52 +++- .../v3/models/add_ip_to_allow_list_request.py | 28 +-- .../add_ip_to_allow_list_request_ips_inner.py | 26 +- .../v3/models/delete_allowed_ips_request.py | 24 +- .../v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../v3/models/ip_access_management2xx.py | 28 +-- .../ip_access_management2xx_result_inner.py | 49 ++-- .../list_access_activity200_response.py | 26 +- ...ccess_activity200_response_result_inner.py | 65 +++-- .../api/ip_address_management/v3/__init__.py | 2 +- .../api/ip_address_management/v3/add_ip.py | 39 ++- .../v3/add_ips_to_ip_pool.py | 45 ++-- .../v3/add_sub_users_to_ip.py | 45 ++-- .../v3/create_ip_pool.py | 39 ++- .../v3/delete_ip_pool.py | 36 ++- .../v3/delete_ips_from_ip_pool.py | 44 ++-- .../v3/delete_sub_users_from_ip.py | 44 ++-- .../api/ip_address_management/v3/get_ip.py | 37 ++- .../ip_address_management/v3/get_ip_pool.py | 37 ++- .../api/ip_address_management/v3/list_ip.py | 59 ++--- .../v3/list_ip_assigned_to_ip_pool.py | 41 ++-- .../ip_address_management/v3/list_ip_pool.py | 45 ++-- .../v3/list_sub_user_assigned_to_ip.py | 39 ++- .../v3/models/__init__.py | 196 ++++++++++++--- .../v3/models/add_ip201_response.py | 55 ++--- .../v3/models/add_ip_request.py | 55 ++--- .../models/add_ips_to_ip_pool200_response.py | 37 ++- .../v3/models/add_ips_to_ip_pool_request.py | 24 +- .../models/add_sub_users_to_ip200_response.py | 29 +-- .../v3/models/add_sub_users_to_ip_request.py | 24 +- .../v3/models/create_ip_pool201_response.py | 37 ++- .../v3/models/create_ip_pool_request.py | 29 +-- .../models/delete_ips_from_ip_pool_request.py | 24 +- .../delete_sub_users_from_ip_request.py | 24 +- .../v3/models/get_ip200_response.py | 91 +++---- .../models/get_ip200_response_pools_inner.py | 31 +-- .../v3/models/get_ip_pool200_response.py | 61 ++--- ...ol200_response_ip_count_by_region_inner.py | 31 +-- .../ip_address_management_error_response.py | 26 +- ..._management_error_response_errors_inner.py | 31 +-- .../ip_address_management/v3/models/items.py | 8 +- .../v3/models/list_ip200_response.py | 38 +-- .../v3/models/list_ip200_response_metadata.py | 28 +-- ...ist_ip200_response_metadata_next_params.py | 113 +++++---- .../list_ip200_response_result_inner.py | 91 +++---- ...ip200_response_result_inner_pools_inner.py | 31 +-- ...list_ip_assigned_to_ip_pool200_response.py | 38 +-- ...ssigned_to_ip_pool200_response_metadata.py | 31 +-- ...p_pool200_response_metadata_next_params.py | 41 ++-- ...ned_to_ip_pool200_response_result_inner.py | 43 ++-- .../v3/models/list_ip_pool200_response.py | 38 +-- .../list_ip_pool200_response_metadata.py | 28 +-- ...p_pool200_response_metadata_next_params.py | 57 +++-- .../list_ip_pool200_response_result_inner.py | 55 ++--- ...ist_sub_user_assigned_to_ip200_response.py | 34 +-- ...ser_assigned_to_ip200_response_metadata.py | 31 +-- ..._to_ip200_response_metadata_next_params.py | 31 +-- .../ip_address_management/v3/models/region.py | 8 +- .../v3/models/region1.py | 10 +- .../v3/models/region2.py | 8 +- .../v3/models/region3.py | 8 +- .../v3/models/region4.py | 10 +- .../v3/models/region5.py | 8 +- .../v3/models/region6.py | 8 +- .../v3/models/region7.py | 10 +- .../v3/models/update_ip200_response.py | 49 ++-- .../v3/models/update_ip_pool200_response.py | 31 +-- .../v3/models/update_ip_pool_request.py | 26 +- .../v3/models/update_ip_request.py | 41 ++-- .../api/ip_address_management/v3/update_ip.py | 45 ++-- .../v3/update_ip_pool.py | 45 ++-- sendgrid/rest/api/ip_warmup/v3/__init__.py | 2 +- .../rest/api/ip_warmup/v3/get_warm_up_ip.py | 37 ++- .../rest/api/ip_warmup/v3/list_warm_up_ip.py | 31 +-- .../rest/api/ip_warmup/v3/models/__init__.py | 39 ++- .../v3/models/get_warm_up_ip404_response.py | 26 +- ...get_warm_up_ip404_response_errors_inner.py | 31 +-- .../ip_warmup/v3/models/ip_warmup200_inner.py | 31 +-- .../v3/models/stop_ip_warm_up404_response.py | 26 +- ...top_ip_warm_up404_response_errors_inner.py | 31 +-- .../v3/models/warm_up_ip404_response.py | 28 +-- .../warm_up_ip404_response_errors_inner.py | 31 +-- .../ip_warmup/v3/models/warm_up_ip_request.py | 26 +- .../rest/api/ip_warmup/v3/stop_ip_warm_up.py | 36 ++- sendgrid/rest/api/ip_warmup/v3/warm_up_ip.py | 35 ++- sendgrid/rest/api/ips/v3/__init__.py | 2 +- sendgrid/rest/api/ips/v3/add_ip.py | 35 ++- sendgrid/rest/api/ips/v3/add_ip_to_ip_pool.py | 45 ++-- sendgrid/rest/api/ips/v3/create_ip_pool.py | 35 ++- .../rest/api/ips/v3/delete_ip_from_ip_pool.py | 40 ++- sendgrid/rest/api/ips/v3/delete_ip_pool.py | 36 ++- sendgrid/rest/api/ips/v3/get_ip.py | 37 ++- sendgrid/rest/api/ips/v3/get_ip_pool.py | 37 ++- sendgrid/rest/api/ips/v3/list_assigned_ip.py | 31 +-- sendgrid/rest/api/ips/v3/list_ip.py | 47 ++-- sendgrid/rest/api/ips/v3/list_ip_pool.py | 31 +-- .../api/ips/v3/list_remaining_ip_count.py | 31 +-- sendgrid/rest/api/ips/v3/models/__init__.py | 92 +++++-- .../api/ips/v3/models/add_ip201_response.py | 43 ++-- .../v3/models/add_ip201_response_ips_inner.py | 29 +-- .../rest/api/ips/v3/models/add_ip_request.py | 39 ++- .../models/add_ip_to_ip_pool201_response.py | 47 ++-- .../models/add_ip_to_ip_pool404_response.py | 26 +- ..._ip_to_ip_pool404_response_errors_inner.py | 31 +-- .../v3/models/add_ip_to_ip_pool_request.py | 26 +- .../ips/v3/models/create_ip_pool_request.py | 26 +- .../delete_ip_from_ip_pool404_response.py | 26 +- .../v3/models/delete_ip_pool404_response.py | 26 +- .../rest/api/ips/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../api/ips/v3/models/get_ip200_response.py | 71 +++--- .../ips/v3/models/get_ip_pool200_response.py | 27 +- .../ips/v3/models/get_ip_pool404_response.py | 28 +-- .../get_ip_pool404_response_errors_inner.py | 31 +-- .../rest/api/ips/v3/models/ip_pools200.py | 26 +- .../list_assigned_ip200_response_inner.py | 47 ++-- .../v3/models/list_ip200_response_inner.py | 79 +++--- .../list_remaining_ip_count200_response.py | 27 +- ...ning_ip_count200_response_results_inner.py | 41 ++-- .../api/ips/v3/models/sort_by_direction.py | 8 +- .../v3/models/update_ip_pool404_response.py | 26 +- ...update_ip_pool404_response_errors_inner.py | 31 +-- .../ips/v3/models/update_ip_pool_request.py | 26 +- sendgrid/rest/api/ips/v3/update_ip_pool.py | 41 ++-- .../rest/api/link_branding/v3/__init__.py | 2 +- .../v3/associate_branded_link_with_subuser.py | 47 ++-- .../link_branding/v3/create_branded_link.py | 49 ++-- .../link_branding/v3/delete_branded_link.py | 46 ++-- .../disassociate_branded_link_from_subuser.py | 35 ++- .../api/link_branding/v3/get_branded_link.py | 47 ++-- .../api/link_branding/v3/list_branded_link.py | 45 ++-- .../v3/list_default_branded_link.py | 45 ++-- .../v3/list_subuser_branded_link.py | 36 ++- .../api/link_branding/v3/models/__init__.py | 81 ++++-- ...ciate_branded_link_with_subuser_request.py | 26 +- .../v3/models/create_branded_link_request.py | 49 ++-- .../v3/models/link_branding200.py | 93 +++---- .../v3/models/link_branding200_dns.py | 41 ++-- .../link_branding200_dns_domain_cname.py | 49 ++-- .../link_branding200_dns_owner_cname.py | 49 ++-- .../api/link_branding/v3/models/region.py | 8 +- .../rest/api/link_branding/v3/models/type.py | 10 +- .../rest/api/link_branding/v3/models/type1.py | 10 +- .../v3/models/update_branded_link_request.py | 26 +- .../validate_branded_link200_response.py | 47 ++-- ...ded_link200_response_validation_results.py | 45 ++-- ...esponse_validation_results_domain_cname.py | 31 +-- ...response_validation_results_owner_cname.py | 31 +-- .../validate_branded_link500_response.py | 26 +- ...e_branded_link500_response_errors_inner.py | 26 +- .../link_branding/v3/update_branded_link.py | 53 ++-- .../link_branding/v3/validate_branded_link.py | 47 ++-- .../rest/api/lmc_campaigns/v3/__init__.py | 2 +- .../api/lmc_campaigns/v3/create_campaign.py | 49 ++-- .../api/lmc_campaigns/v3/delete_campaign.py | 46 ++-- .../rest/api/lmc_campaigns/v3/get_campaign.py | 47 ++-- .../v3/get_scheduled_campaign.py | 47 ++-- .../api/lmc_campaigns/v3/list_campaign.py | 47 ++-- .../api/lmc_campaigns/v3/models/__init__.py | 76 ++++-- .../lmc_campaigns/v3/models/campaigns2xx.py | 127 +++++----- .../api/lmc_campaigns/v3/models/editor.py | 8 +- .../lmc_campaigns/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../v3/models/get_campaign200_response.py | 119 +++++---- .../v3/models/list_campaign200_response.py | 24 +- .../v3/models/post_campaigns_request.py | 111 +++++---- .../v3/models/schedule_a_campaign_request.py | 26 +- .../v3/models/schedule_a_campaign_response.py | 41 ++-- .../v3/models/send_a_campaign_response.py | 31 +-- .../v3/models/send_a_test_campaign_request.py | 26 +- .../v3/models/send_test_campaign_request.py | 26 +- .../api/lmc_campaigns/v3/models/status.py | 6 +- .../v3/models/update_a_campaign_request.py | 55 ++--- .../update_a_scheduled_campaign_request.py | 26 +- .../update_a_scheduled_campaign_response.py | 41 ++-- ...w_scheduled_time_of_a_campaign_response.py | 26 +- .../api/lmc_campaigns/v3/schedule_campaign.py | 53 ++-- .../api/lmc_campaigns/v3/send_campaign.py | 47 ++-- .../lmc_campaigns/v3/send_test_campaign.py | 53 ++-- .../lmc_campaigns/v3/un_schedule_campaign.py | 46 ++-- .../api/lmc_campaigns/v3/update_campaign.py | 53 ++-- .../v3/update_scheduled_campaign.py | 55 +++-- .../rest/api/lmc_contactdb/v3/__init__.py | 2 +- .../api/lmc_contactdb/v3/add_recipient.py | 49 ++-- .../v3/add_recipient_to_contact_db_list.py | 50 ++-- .../v3/add_recipients_to_contact_db_list.py | 48 ++-- .../v3/create_contact_db_list.py | 49 ++-- .../lmc_contactdb/v3/create_custom_field.py | 49 ++-- .../api/lmc_contactdb/v3/create_segment.py | 49 ++-- .../v3/delete_contact_db_list.py | 52 ++-- .../v3/delete_contact_db_lists.py | 44 ++-- .../lmc_contactdb/v3/delete_custom_field.py | 47 ++-- .../api/lmc_contactdb/v3/delete_recipient.py | 46 ++-- .../delete_recipient_from_contact_db_list.py | 54 ++-- .../api/lmc_contactdb/v3/delete_recipients.py | 44 ++-- .../api/lmc_contactdb/v3/delete_segment.py | 52 ++-- .../rest/api/lmc_contactdb/v3/get_billable.py | 43 ++-- .../lmc_contactdb/v3/get_contact_db_list.py | 47 ++-- .../api/lmc_contactdb/v3/get_custom_field.py | 47 ++-- .../api/lmc_contactdb/v3/get_recipient.py | 47 ++-- .../lmc_contactdb/v3/get_recipient_list.py | 47 ++-- .../rest/api/lmc_contactdb/v3/get_segment.py | 47 ++-- .../lmc_contactdb/v3/list_contact_db_list.py | 43 ++-- .../api/lmc_contactdb/v3/list_custom_field.py | 43 ++-- .../api/lmc_contactdb/v3/list_recipient.py | 47 ++-- .../lmc_contactdb/v3/list_recipient_count.py | 43 ++-- .../v3/list_recipient_for_segment.py | 51 ++-- .../list_recipients_from_contact_db_list.py | 51 ++-- .../lmc_contactdb/v3/list_reserved_field.py | 43 ++-- .../lmc_contactdb/v3/list_search_recipient.py | 45 ++-- .../rest/api/lmc_contactdb/v3/list_segment.py | 43 ++-- .../rest/api/lmc_contactdb/v3/list_status.py | 43 ++-- .../api/lmc_contactdb/v3/models/__init__.py | 188 +++++++++++--- .../v3/models/add_recipient_request_inner.py | 49 ++-- .../api/lmc_contactdb/v3/models/and_or.py | 10 +- .../v3/models/contactdb_custom_field.py | 31 +-- .../v3/models/contactdb_custom_field_id2xx.py | 39 ++- .../models/contactdb_custom_field_id_value.py | 49 ++-- .../v3/models/contactdb_list2xx.py | 41 ++-- .../v3/models/contactdb_recipient200.py | 26 +- ...contactdb_recipient200_recipients_inner.py | 99 ++++---- .../v3/models/contactdb_recipient_count200.py | 26 +- .../models/contactdb_recipient_response201.py | 67 ++--- ...ctdb_recipient_response201_errors_inner.py | 28 +-- .../v3/models/contactdb_segments.py | 51 ++-- .../models/contactdb_segments_conditions.py | 49 ++-- .../v3/models/contactdb_segments_id200.py | 59 ++--- .../v3/models/create_a_list_request.py | 26 +- .../v3/models/create_custom_field_request.py | 31 +-- .../lmc_contactdb/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../models/get_recipient_list200_response.py | 24 +- .../models/list_all_custom_fields_response.py | 28 +-- .../v3/models/list_all_lists_response.py | 24 +- .../v3/models/list_all_segments_response.py | 28 +-- ...pients_from_contact_db_list200_response.py | 28 +-- .../list_recipients_on_a_segment_response.py | 28 +-- .../v3/models/list_recipients_response.py | 24 +- .../models/list_reserved_field200_response.py | 29 +-- ...field200_response_reserved_fields_inner.py | 31 +-- .../v3/models/list_status200_response.py | 28 +-- .../list_status200_response_status_inner.py | 31 +-- .../api/lmc_contactdb/v3/models/operator.py | 14 +- .../v3/models/search_recipient200_response.py | 35 +-- ..._recipient200_response_recipients_inner.py | 93 +++---- ...se_recipients_inner_custom_fields_inner.py | 55 +++-- .../v3/models/search_recipient_request.py | 34 +-- .../rest/api/lmc_contactdb/v3/models/type.py | 10 +- .../v3/models/update_a_list_request.py | 26 +- .../update_contact_db_list200_response.py | 41 ++-- .../models/update_recipient_request_inner.py | 41 ++-- .../v3/models/update_segment_request.py | 43 ++-- .../api/lmc_contactdb/v3/search_recipient.py | 39 ++- .../v3/update_contact_db_list.py | 53 ++-- .../api/lmc_contactdb/v3/update_recipient.py | 51 ++-- .../api/lmc_contactdb/v3/update_segment.py | 53 ++-- sendgrid/rest/api/lmc_senders/v3/__init__.py | 2 +- .../rest/api/lmc_senders/v3/create_sender.py | 49 ++-- .../rest/api/lmc_senders/v3/delete_sender.py | 46 ++-- .../rest/api/lmc_senders/v3/get_sender.py | 47 ++-- .../rest/api/lmc_senders/v3/list_sender.py | 43 ++-- .../api/lmc_senders/v3/models/__init__.py | 39 ++- .../v3/models/create_sender400_response.py | 26 +- .../create_sender400_response_errors_inner.py | 31 +-- .../v3/models/create_sender_request.py | 89 ++++--- .../v3/models/list_sender200_response.py | 24 +- .../api/lmc_senders/v3/models/sender_id.py | 137 ++++++----- .../v3/models/sender_id_request.py | 97 ++++---- .../v3/models/sender_id_request_from.py | 31 +-- .../v3/models/sender_id_request_reply_to.py | 31 +-- .../v3/reset_sender_verification.py | 46 ++-- .../rest/api/lmc_senders/v3/update_sender.py | 49 ++-- sendgrid/rest/api/mail/v3/__init__.py | 2 +- .../rest/api/mail/v3/create_mail_batch.py | 43 ++-- sendgrid/rest/api/mail/v3/get_mail_batch.py | 43 ++-- sendgrid/rest/api/mail/v3/models/__init__.py | 95 ++++++-- .../api/mail/v3/models/content_encoding.py | 6 +- .../rest/api/mail/v3/models/disposition.py | 8 +- .../rest/api/mail/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../api/mail/v3/models/mail_batch_response.py | 26 +- sendgrid/rest/api/mail/v3/models/mail_from.py | 31 +-- sendgrid/rest/api/mail/v3/models/mail_to.py | 31 +-- .../api/mail/v3/models/send_mail_request.py | 171 +++++++------ .../mail/v3/models/send_mail_request_asm.py | 31 ++- .../send_mail_request_attachments_inner.py | 57 +++-- .../models/send_mail_request_content_inner.py | 31 +-- .../models/send_mail_request_mail_settings.py | 97 +++++--- ..._mail_settings_bypass_bounce_management.py | 26 +- ...st_mail_settings_bypass_list_management.py | 26 +- ...st_mail_settings_bypass_spam_management.py | 26 +- ..._settings_bypass_unsubscribe_management.py | 26 +- .../send_mail_request_mail_settings_footer.py | 41 ++-- ...mail_request_mail_settings_sandbox_mode.py | 26 +- ...end_mail_request_personalizations_inner.py | 95 ++++---- .../send_mail_request_tracking_settings.py | 67 ++--- ...equest_tracking_settings_click_tracking.py | 30 +-- ...il_request_tracking_settings_ganalytics.py | 65 +++-- ...request_tracking_settings_open_tracking.py | 31 ++- ...tracking_settings_subscription_tracking.py | 49 ++-- sendgrid/rest/api/mail/v3/send_mail.py | 44 ++-- .../rest/api/mail_settings/v3/__init__.py | 2 +- .../v3/list_address_whitelist.py | 43 ++-- .../api/mail_settings/v3/list_bounce_purge.py | 43 ++-- .../rest/api/mail_settings/v3/list_footer.py | 43 ++-- .../mail_settings/v3/list_forward_bounce.py | 43 ++-- .../api/mail_settings/v3/list_forward_spam.py | 43 ++-- .../api/mail_settings/v3/list_mail_setting.py | 47 ++-- .../api/mail_settings/v3/list_template.py | 43 ++-- .../api/mail_settings/v3/models/__init__.py | 62 +++-- .../models/list_mail_setting200_response.py | 26 +- ...t_mail_setting200_response_result_inner.py | 49 ++-- .../mail_settings_address_whitelabel200.py | 27 +- .../v3/models/mail_settings_bounce_purge.py | 41 ++-- .../v3/models/mail_settings_footer.py | 41 ++-- .../v3/models/mail_settings_forward_bounce.py | 31 +-- .../v3/models/mail_settings_forward_spam.py | 31 +-- .../v3/models/mail_settings_template200.py | 30 +-- .../update_address_whitelist_request.py | 27 +- .../v3/models/update_template200_response.py | 30 +-- .../v3/models/update_template_request.py | 30 +-- .../v3/update_address_whitelist.py | 51 ++-- .../mail_settings/v3/update_bounce_purge.py | 48 ++-- .../api/mail_settings/v3/update_footer.py | 48 ++-- .../mail_settings/v3/update_forward_bounce.py | 48 ++-- .../mail_settings/v3/update_forward_spam.py | 48 ++-- .../api/mail_settings/v3/update_template.py | 49 ++-- sendgrid/rest/api/mc_contacts/v3/__init__.py | 2 +- .../rest/api/mc_contacts/v3/delete_contact.py | 39 ++- .../v3/delete_contact_identifier.py | 47 ++-- .../rest/api/mc_contacts/v3/export_contact.py | 39 ++- .../rest/api/mc_contacts/v3/get_contact.py | 36 ++- .../v3/get_contact_by_identifiers.py | 47 ++-- .../api/mc_contacts/v3/get_export_contact.py | 36 ++- .../api/mc_contacts/v3/get_import_contact.py | 36 ++- .../rest/api/mc_contacts/v3/import_contact.py | 39 ++- .../mc_contacts/v3/list_batched_contact.py | 39 ++- .../rest/api/mc_contacts/v3/list_contact.py | 31 +-- .../mc_contacts/v3/list_contact_by_email.py | 39 ++- .../api/mc_contacts/v3/list_contact_count.py | 31 +-- .../api/mc_contacts/v3/list_export_contact.py | 31 +-- .../api/mc_contacts/v3/models/__init__.py | 230 ++++++++++++++---- .../mc_contacts/v3/models/contact_details3.py | 215 ++++++++-------- .../mc_contacts/v3/models/contact_export.py | 95 ++++---- .../mc_contacts/v3/models/contact_import.py | 69 +++--- .../v3/models/contact_import_results.py | 65 +++-- .../mc_contacts/v3/models/contact_request.py | 131 +++++----- .../models/contact_request_custom_fields.py | 26 +- .../mc_contacts/v3/models/contacts_error.py | 49 ++-- .../v3/models/delete_contact202_response.py | 26 +- .../v3/models/delete_contact400_response.py | 24 +- .../delete_contact_identifier202_response.py | 26 +- .../delete_contact_identifier_request.py | 33 ++- .../mc_contacts/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../v3/models/export_contact202_response.py | 31 +-- .../v3/models/export_contact_request.py | 59 ++--- .../export_contact_request_notifications.py | 26 +- .../api/mc_contacts/v3/models/file_type.py | 8 +- .../api/mc_contacts/v3/models/file_type1.py | 6 +- .../get_contact_by_identifiers200_response.py | 27 +- ...by_identifiers200_response_result_value.py | 29 +-- .../get_contact_by_identifiers_request.py | 24 +- .../models/get_import_contact400_response.py | 26 +- .../mc_contacts/v3/models/identifier_type.py | 12 +- .../mc_contacts/v3/models/identifier_type1.py | 12 +- .../v3/models/import_contact200_response.py | 45 ++-- ...ontact200_response_upload_headers_inner.py | 31 +-- .../v3/models/import_contact400_response.py | 24 +- .../v3/models/import_contact404_response.py | 24 +- .../v3/models/import_contact_request.py | 39 ++- .../list_batched_contact200_response.py | 24 +- .../v3/models/list_batched_contact_request.py | 24 +- .../v3/models/list_contact200_response.py | 39 ++- .../v3/models/list_contact400_response.py | 24 +- .../list_contact_by_email200_response.py | 26 +- .../models/list_contact_by_email_request.py | 47 ++-- .../models/list_contact_count200_response.py | 47 ++-- ...ct_count200_response_billable_breakdown.py | 31 +-- .../models/list_export_contact200_response.py | 38 +-- ...ist_export_contact200_response_metadata.py | 41 ++-- ...export_contact200_response_result_inner.py | 115 +++++---- ...ntact200_response_result_inner_metadata.py | 41 ++-- ...00_response_result_inner_segments_inner.py | 31 +-- .../models/list_export_contact400_response.py | 26 +- ...export_contact400_response_errors_inner.py | 32 +-- .../api/mc_contacts/v3/models/metadata.py | 49 ++-- .../v3/models/search_contact200_response.py | 39 ++- .../v3/models/search_contact400_response.py | 26 +- ...search_contact400_response_errors_inner.py | 31 +-- .../v3/models/search_contact500_response.py | 26 +- ...search_contact500_response_errors_inner.py | 26 +- .../v3/models/search_contact_request.py | 26 +- .../mc_contacts/v3/models/self_metadata.py | 26 +- .../rest/api/mc_contacts/v3/models/status.py | 10 +- .../v3/models/update_contact202_response.py | 26 +- .../v3/models/update_contact_request.py | 30 ++- .../rest/api/mc_contacts/v3/search_contact.py | 39 ++- .../rest/api/mc_contacts/v3/update_contact.py | 39 ++- .../rest/api/mc_custom_fields/v3/__init__.py | 2 +- .../v3/create_field_definition.py | 39 ++- .../v3/delete_field_definition.py | 35 ++- .../v3/list_field_definition.py | 31 +-- .../mc_custom_fields/v3/models/__init__.py | 51 +++- .../create_field_definition200_response.py | 49 ++-- .../create_field_definition400_response.py | 28 +-- .../models/create_field_definition_request.py | 29 +-- .../custom_field_definitions_response.py | 41 ++-- .../v3/models/custom_fields_error.py | 49 ++-- .../mc_custom_fields/v3/models/field_type.py | 10 +- .../mc_custom_fields/v3/models/field_type1.py | 10 +- .../mc_custom_fields/v3/models/field_type2.py | 10 +- .../list_field_definition200_response.py | 47 ++-- .../mc_custom_fields/v3/models/metadata.py | 49 ++-- ...served_field_definitions_response_inner.py | 41 ++-- .../models/update_field_definition_request.py | 26 +- .../v3/update_field_definition.py | 44 ++-- sendgrid/rest/api/mc_designs/v3/__init__.py | 1 + .../rest/api/mc_designs/v3/create_design.py | 55 +++++ .../rest/api/mc_designs/v3/delete_design.py | 52 ++++ .../api/mc_designs/v3/duplicate_design.py | 61 +++++ .../v3/duplicate_pre_built_design.py | 61 +++++ sendgrid/rest/api/mc_designs/v3/get_design.py | 52 ++++ .../api/mc_designs/v3/get_pre_built_design.py | 52 ++++ .../rest/api/mc_designs/v3/list_design.py | 54 ++++ .../mc_designs/v3/list_pre_built_design.py | 54 ++++ .../rest/api/mc_designs/v3/models/__init__.py | 50 ++++ .../api/mc_designs/v3/models/api_error.py | 37 +++ .../api/mc_designs/v3/models/api_errors.py | 23 ++ .../v3/models/design_common_properties.py | 46 ++++ .../v3/models/design_duplicate_input.py | 26 ++ .../api/mc_designs/v3/models/design_input.py | 42 ++++ .../api/mc_designs/v3/models/design_output.py | 42 ++++ .../v3/models/design_output_summary.py | 50 ++++ .../rest/api/mc_designs/v3/models/editor.py | 7 + .../v3/models/list_design200_response.py | 36 +++ .../rest/api/mc_designs/v3/models/metadata.py | 41 ++++ .../v3/models/update_design_request.py | 49 ++++ .../rest/api/mc_designs/v3/update_design.py | 61 +++++ sendgrid/rest/api/mc_lists/v3/__init__.py | 2 +- .../api/mc_lists/v3/create_marketing_list.py | 39 ++- .../rest/api/mc_lists/v3/delete_contact.py | 40 ++- .../api/mc_lists/v3/delete_marketing_list.py | 41 ++-- .../api/mc_lists/v3/get_marketing_list.py | 41 ++-- .../api/mc_lists/v3/list_contact_count.py | 36 ++- .../api/mc_lists/v3/list_marketing_list.py | 41 ++-- .../rest/api/mc_lists/v3/models/__init__.py | 57 ++++- .../api/mc_lists/v3/models/contact_details.py | 215 ++++++++-------- .../create_marketing_list400_response.py | 24 +- .../models/create_marketing_list_request.py | 26 +- .../v3/models/delete_contact202_response.py | 26 +- .../delete_marketing_list200_response.py | 26 +- .../delete_marketing_list404_response.py | 24 +- sendgrid/rest/api/mc_lists/v3/models/error.py | 49 ++-- .../models/get_marketing_list200_response.py | 57 +++-- sendgrid/rest/api/mc_lists/v3/models/list.py | 47 ++-- .../models/list_contact_count200_response.py | 31 ++- .../models/list_marketing_list200_response.py | 28 +-- .../rest/api/mc_lists/v3/models/metadata.py | 49 ++-- .../api/mc_lists/v3/models/self_metadata.py | 26 +- .../models/update_marketing_list_request.py | 26 +- .../api/mc_lists/v3/update_marketing_list.py | 45 ++-- sendgrid/rest/api/mc_segments/v3/__init__.py | 2 +- .../rest/api/mc_segments/v3/delete_segment.py | 36 ++- .../rest/api/mc_segments/v3/get_segment.py | 41 ++-- .../rest/api/mc_segments/v3/list_segment.py | 41 ++-- .../api/mc_segments/v3/models/__init__.py | 47 +++- .../mc_segments/v3/models/contact_response.py | 155 ++++++------ .../models/contact_response_custom_fields.py | 33 ++- .../mc_segments/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../api/mc_segments/v3/models/full_segment.py | 111 +++++---- .../v3/models/get_segment404_response.py | 28 +-- .../get_segment404_response_errors_inner.py | 31 +-- .../v3/models/list_segment200_response.py | 24 +- .../v3/models/list_segment500_response.py | 26 +- .../list_segment500_response_errors_inner.py | 26 +- .../mc_segments/v3/models/segment_summary.py | 81 +++--- .../mc_segments/v3/models/segment_write_v2.py | 39 ++- .../rest/api/mc_segments_2/v3/__init__.py | 2 +- .../api/mc_segments_2/v3/create_segment.py | 35 ++- .../api/mc_segments_2/v3/delete_segment.py | 35 ++- .../rest/api/mc_segments_2/v3/get_segment.py | 41 ++-- .../rest/api/mc_segments_2/v3/list_segment.py | 41 ++-- .../api/mc_segments_2/v3/models/__init__.py | 40 ++- .../v3/models/all_segments200.py | 107 ++++---- .../v3/models/contact_response.py | 155 ++++++------ .../models/contact_response_custom_fields.py | 33 ++- .../v3/models/errors_segment_v2.py | 28 +-- .../models/errors_segment_v2_errors_inner.py | 31 +-- .../api/mc_segments_2/v3/models/metadata.py | 49 ++-- .../api/mc_segments_2/v3/models/segment2xx.py | 139 +++++------ .../mc_segments_2/v3/models/segment_error.py | 26 +- .../v3/models/segment_refresh202.py | 26 +- .../v3/models/segment_refresh_request.py | 26 +- .../v3/models/segment_status_response.py | 33 ++- .../mc_segments_2/v3/models/segment_update.py | 31 +-- .../v3/models/segment_write_v2.py | 39 ++- .../api/mc_segments_2/v3/refresh_segment.py | 45 ++-- .../api/mc_segments_2/v3/update_segment.py | 40 ++- sendgrid/rest/api/mc_senders/v3/__init__.py | 2 +- .../rest/api/mc_senders/v3/create_sender.py | 49 ++-- .../rest/api/mc_senders/v3/delete_sender.py | 46 ++-- sendgrid/rest/api/mc_senders/v3/get_sender.py | 47 ++-- .../rest/api/mc_senders/v3/list_sender.py | 43 ++-- .../rest/api/mc_senders/v3/models/__init__.py | 41 +++- .../v3/models/create_sender_request.py | 97 ++++---- .../v3/models/create_sender_request_from.py | 31 +-- .../models/create_sender_request_reply_to.py | 31 +-- .../mc_senders/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../v3/models/list_sender200_response.py | 24 +- .../rest/api/mc_senders/v3/models/sender.py | 137 ++++++----- .../mc_senders/v3/models/sender_request.py | 93 +++---- .../v3/models/sender_request_from.py | 31 +-- .../v3/models/sender_request_reply_to.py | 31 +-- .../v3/reset_sender_verification.py | 46 ++-- .../rest/api/mc_senders/v3/update_sender.py | 49 ++-- .../rest/api/mc_singlesends/v3/__init__.py | 1 + .../mc_singlesends/v3/create_single_send.py | 57 +++++ .../v3/delete_scheduled_single_send.py | 52 ++++ .../mc_singlesends/v3/delete_single_send.py | 52 ++++ .../mc_singlesends/v3/delete_single_sends.py | 52 ++++ .../v3/duplicate_single_send.py | 61 +++++ .../api/mc_singlesends/v3/get_single_send.py | 52 ++++ .../api/mc_singlesends/v3/list_category.py | 48 ++++ .../api/mc_singlesends/v3/list_single_send.py | 53 ++++ .../api/mc_singlesends/v3/models/__init__.py | 112 +++++++++ .../v3/models/ab_test_summary.py | 55 +++++ .../models/duplicate_single_send_request.py | 22 ++ .../api/mc_singlesends/v3/models/editor.py | 7 + .../api/mc_singlesends/v3/models/editor1.py | 7 + .../api/mc_singlesends/v3/models/items.py | 8 + .../v3/models/list_category200_response.py | 22 ++ .../v3/models/list_single_send200_response.py | 36 +++ .../v3/models/list_single_send500_response.py | 27 ++ ...st_single_send500_response_errors_inner.py | 37 +++ .../api/mc_singlesends/v3/models/metadata.py | 41 ++++ .../schedule_single_send201_response.py | 28 +++ .../v3/models/schedule_single_send_request.py | 22 ++ .../models/search_single_send200_response.py | 36 +++ .../v3/models/singlesend_request.py | 51 ++++ .../models/singlesend_request_email_config.py | 66 +++++ .../v3/models/singlesend_request_send_to.py | 37 +++ .../v3/models/singlesend_response.py | 75 ++++++ .../singlesend_response_email_config.py | 66 +++++ .../v3/models/singlesend_response_send_to.py | 37 +++ .../v3/models/singlesend_response_short.py | 63 +++++ .../singlesend_response_warnings_inner.py | 37 +++ .../v3/models/singlesend_schedule.py | 28 +++ .../v3/models/singlesend_search.py | 38 +++ .../api/mc_singlesends/v3/models/status.py | 6 + .../api/mc_singlesends/v3/models/status1.py | 8 + .../api/mc_singlesends/v3/models/status2.py | 8 + .../api/mc_singlesends/v3/models/status3.py | 8 + .../rest/api/mc_singlesends/v3/models/type.py | 7 + .../v3/models/winner_criteria.py | 8 + .../mc_singlesends/v3/schedule_single_send.py | 61 +++++ .../mc_singlesends/v3/search_single_send.py | 59 +++++ .../mc_singlesends/v3/update_single_send.py | 61 +++++ sendgrid/rest/api/mc_stats/v3/__init__.py | 2 +- .../api/mc_stats/v3/export_automation_stat.py | 38 ++- .../mc_stats/v3/export_single_send_stat.py | 38 ++- .../api/mc_stats/v3/get_automation_stat.py | 55 ++--- .../api/mc_stats/v3/get_single_send_stat.py | 53 ++-- .../api/mc_stats/v3/list_automation_stat.py | 41 ++-- .../mc_stats/v3/list_click_tracking_stat.py | 47 ++-- .../api/mc_stats/v3/list_single_send_stat.py | 41 ++-- .../v3/list_single_send_tracking_stat.py | 49 ++-- .../rest/api/mc_stats/v3/models/__init__.py | 67 ++++- .../rest/api/mc_stats/v3/models/ab_phase.py | 10 +- .../rest/api/mc_stats/v3/models/ab_phase1.py | 10 +- .../api/mc_stats/v3/models/ab_phase_id.py | 8 +- .../api/mc_stats/v3/models/aggregated_by.py | 8 +- .../models/autmoations_link_stats_response.py | 47 ++-- ...tions_link_stats_response_results_inner.py | 49 ++-- .../v3/models/automations_response.py | 34 +-- .../automations_response_results_inner.py | 49 ++-- .../api/mc_stats/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- sendgrid/rest/api/mc_stats/v3/models/items.py | 6 +- .../rest/api/mc_stats/v3/models/items1.py | 8 +- .../rest/api/mc_stats/v3/models/items2.py | 8 +- .../v3/models/link_tracking_metadata.py | 49 ++-- .../rest/api/mc_stats/v3/models/metadata.py | 49 ++-- .../rest/api/mc_stats/v3/models/metrics.py | 113 +++++---- .../models/singlesends_link_stats_response.py | 47 ++-- ...sends_link_stats_response_results_inner.py | 57 +++-- .../v3/models/singlesends_response.py | 34 +-- .../singlesends_response_results_inner.py | 57 +++-- sendgrid/rest/api/mc_test/v3/__init__.py | 2 +- .../rest/api/mc_test/v3/models/__init__.py | 14 +- .../api/mc_test/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../send_test_marketing_email_request.py | 71 +++--- .../mc_test/v3/send_test_marketing_email.py | 40 +-- sendgrid/rest/api/partner/v3/__init__.py | 2 +- .../api/partner/v3/list_partner_setting.py | 47 ++-- .../rest/api/partner/v3/models/__init__.py | 14 +- .../list_partner_setting200_response.py | 26 +- ...artner_setting200_response_result_inner.py | 49 ++-- .../recipients_data_erasure/v3/__init__.py | 2 +- .../v3/erase_recipient_email_data.py | 51 ++-- .../v3/models/__init__.py | 22 +- ...s_data_erasure_erase_recipients_request.py | 24 +- .../recipients_data_erasure_error_v1.py | 31 +-- .../models/recipients_data_erasure_job_id.py | 26 +- sendgrid/rest/api/reverse_dns/v3/__init__.py | 2 +- .../api/reverse_dns/v3/delete_reverse_dns.py | 46 ++-- .../api/reverse_dns/v3/get_reverse_dns.py | 47 ++-- .../api/reverse_dns/v3/list_reverse_dns.py | 49 ++-- .../api/reverse_dns/v3/models/__init__.py | 60 ++++- .../api/reverse_dns/v3/models/reverse_dns.py | 103 ++++---- .../v3/models/reverse_dns_a_record.py | 49 ++-- .../v3/models/reverse_dns_users_inner.py | 32 +-- .../v3/models/set_up_reverse_dns_request.py | 41 ++-- .../validate_reverse_dns200_response.py | 47 ++-- ...erse_dns200_response_validation_results.py | 31 +-- ...00_response_validation_results_a_record.py | 31 +-- .../validate_reverse_dns404_response.py | 26 +- ...te_reverse_dns404_response_errors_inner.py | 26 +- .../validate_reverse_dns500_response.py | 26 +- ...te_reverse_dns500_response_errors_inner.py | 26 +- .../api/reverse_dns/v3/set_up_reverse_dns.py | 49 ++-- .../reverse_dns/v3/validate_reverse_dns.py | 47 ++-- .../rest/api/scheduled_sends/v3/__init__.py | 2 +- .../v3/create_scheduled_send.py | 51 ++-- .../v3/delete_scheduled_send.py | 46 ++-- .../scheduled_sends/v3/get_scheduled_send.py | 47 ++-- .../scheduled_sends/v3/list_scheduled_send.py | 43 ++-- .../api/scheduled_sends/v3/models/__init__.py | 32 ++- ...ancel_or_pause_a_scheduled_send_request.py | 31 +-- .../v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../v3/models/mail_batch_id.py | 26 +- .../v3/models/scheduled_send_status.py | 29 +-- .../api/scheduled_sends/v3/models/status.py | 8 +- .../api/scheduled_sends/v3/models/status1.py | 8 +- .../api/scheduled_sends/v3/models/status2.py | 8 +- .../models/update_scheduled_send_request.py | 26 +- .../v3/update_scheduled_send.py | 52 ++-- sendgrid/rest/api/scopes/v3/__init__.py | 2 +- .../api/scopes/v3/approve_scope_request.py | 37 ++- .../rest/api/scopes/v3/deny_scope_request.py | 36 ++- sendgrid/rest/api/scopes/v3/list_scope.py | 43 ++-- .../rest/api/scopes/v3/list_scope_request.py | 39 ++- .../rest/api/scopes/v3/models/__init__.py | 48 +++- .../approve_scope_request200_response.py | 26 +- .../models/deny_scope_request404_response.py | 26 +- ..._scope_request404_response_errors_inner.py | 31 +-- .../api/scopes/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../v3/models/list_scope200_response.py | 24 +- .../v3/models/list_scope401_response.py | 28 +-- .../list_scope401_response_errors_inner.py | 31 +-- .../list_scope_request200_response_inner.py | 65 +++-- sendgrid/rest/api/seq/v3/__init__.py | 1 + .../seq/v3/list_engagement_quality_score.py | 61 +++++ .../list_subuser_engagement_quality_score.py | 62 +++++ sendgrid/rest/api/seq/v3/models/__init__.py | 24 ++ sendgrid/rest/api/seq/v3/models/seq_error.py | 23 ++ .../rest/api/seq/v3/models/seq_metadata.py | 25 ++ .../seq/v3/models/seq_metadata_next_params.py | 22 ++ .../rest/api/seq/v3/models/seq_metrics.py | 45 ++++ sendgrid/rest/api/seq/v3/models/seq_score.py | 46 ++++ sendgrid/rest/api/sso/v3/__init__.py | 2 +- .../rest/api/sso/v3/create_sso_certificate.py | 39 ++- .../rest/api/sso/v3/create_sso_integration.py | 39 ++- .../rest/api/sso/v3/create_sso_teammate.py | 39 ++- .../rest/api/sso/v3/delete_sso_certificate.py | 36 ++- .../rest/api/sso/v3/delete_sso_integration.py | 35 ++- .../rest/api/sso/v3/get_sso_certificate.py | 36 ++- .../rest/api/sso/v3/get_sso_integration.py | 41 ++-- .../rest/api/sso/v3/list_sso_integration.py | 37 ++- .../v3/list_sso_integration_certificate.py | 37 ++- sendgrid/rest/api/sso/v3/models/__init__.py | 65 ++++- .../models/create_sso_certificate_request.py | 41 ++-- .../sso/v3/models/patch_sso_teammates200.py | 173 ++++++------- .../rest/api/sso/v3/models/permission_type.py | 8 +- .../api/sso/v3/models/permission_type1.py | 8 +- sendgrid/rest/api/sso/v3/models/persona.py | 12 +- .../models/post_patch_integration_request.py | 65 +++-- .../sso/v3/models/post_sso_teammates201.py | 85 +++---- .../v3/models/post_sso_teammates_request.py | 85 +++---- .../api/sso/v3/models/sso_certificate_body.py | 57 +++-- .../sso/v3/models/sso_error_response_inner.py | 41 ++-- .../rest/api/sso/v3/models/sso_integration.py | 97 ++++---- .../sso_teammates_base_request_props.py | 77 +++--- ...base_request_props_subuser_access_inner.py | 39 ++- .../sso_teammates_base_response_props.py | 63 +++-- ...mates_restricted_subuser_response_props.py | 37 +-- ...ser_response_props_subuser_access_inner.py | 63 +++-- .../models/update_sso_certificate_request.py | 41 ++-- sendgrid/rest/api/sso/v3/models/user_type.py | 10 +- .../rest/api/sso/v3/update_sso_certificate.py | 44 ++-- .../rest/api/sso/v3/update_sso_integration.py | 47 ++-- .../rest/api/sso/v3/update_sso_teammate.py | 45 ++-- sendgrid/rest/api/stats/v3/__init__.py | 2 +- sendgrid/rest/api/stats/v3/get_client_stat.py | 53 ++-- .../rest/api/stats/v3/list_browser_stat.py | 55 ++--- sendgrid/rest/api/stats/v3/list_category.py | 49 ++-- .../rest/api/stats/v3/list_category_stat.py | 51 ++-- .../api/stats/v3/list_category_stat_sum.py | 57 ++--- .../rest/api/stats/v3/list_client_stat.py | 49 ++-- .../rest/api/stats/v3/list_device_stat.py | 53 ++-- sendgrid/rest/api/stats/v3/list_geo_stat.py | 55 ++--- .../stats/v3/list_mailbox_provider_stat.py | 55 ++--- sendgrid/rest/api/stats/v3/list_stat.py | 53 ++-- sendgrid/rest/api/stats/v3/models/__init__.py | 107 ++++++-- .../stats/v3/models/advanced_stats_clicks.py | 30 +-- .../v3/models/advanced_stats_clicks_opens.py | 49 ++-- .../models/advanced_stats_mailbox_provider.py | 81 +++--- .../stats/v3/models/advanced_stats_opens.py | 32 +-- .../rest/api/stats/v3/models/aggregated_by.py | 10 +- .../api/stats/v3/models/aggregated_by1.py | 10 +- .../api/stats/v3/models/aggregated_by2.py | 10 +- .../api/stats/v3/models/aggregated_by3.py | 10 +- .../api/stats/v3/models/category_stats.py | 33 ++- .../v3/models/category_stats_stats_inner.py | 45 ++-- .../category_stats_stats_inner_metrics.py | 145 ++++++----- .../rest/api/stats/v3/models/client_type.py | 12 +- sendgrid/rest/api/stats/v3/models/country.py | 8 +- .../list_browser_stat200_response_inner.py | 33 ++- ...wser_stat200_response_inner_stats_inner.py | 41 ++-- .../models/list_category200_response_inner.py | 26 +- .../v3/models/list_category400_response.py | 26 +- .../list_category400_response_errors_inner.py | 31 +-- .../list_client_stat200_response_inner.py | 33 ++- ...ient_stat200_response_inner_stats_inner.py | 41 ++-- .../models/list_geo_stat200_response_inner.py | 33 ++- ..._geo_stat200_response_inner_stats_inner.py | 45 ++-- ...mailbox_provider_stat200_response_inner.py | 33 ++- ...ider_stat200_response_inner_stats_inner.py | 45 ++-- .../v3/models/list_stat200_response_inner.py | 33 ++- ...list_stat200_response_inner_stats_inner.py | 30 +-- .../api/stats/v3/models/sort_by_direction.py | 8 +- .../v3/models/stats_advanced_global_stats.py | 145 ++++++----- sendgrid/rest/api/subusers/v3/__init__.py | 2 +- .../rest/api/subusers/v3/create_subuser.py | 39 ++- .../rest/api/subusers/v3/delete_subuser.py | 36 ++- .../api/subusers/v3/get_subuser_credit.py | 37 ++- .../rest/api/subusers/v3/list_monthly_stat.py | 47 ++-- .../rest/api/subusers/v3/list_reputation.py | 36 ++- sendgrid/rest/api/subusers/v3/list_stat.py | 47 ++-- .../rest/api/subusers/v3/list_stat_sum.py | 49 ++-- sendgrid/rest/api/subusers/v3/list_subuser.py | 45 ++-- .../subusers/v3/list_subuser_monthly_stat.py | 49 ++-- .../rest/api/subusers/v3/models/__init__.py | 91 +++++-- .../api/subusers/v3/models/aggregated_by.py | 10 +- .../api/subusers/v3/models/category_stats.py | 33 ++- .../v3/models/category_stats_stats_inner.py | 45 ++-- .../category_stats_stats_inner_metrics.py | 145 ++++++----- .../v3/models/create_subuser_request.py | 63 +++-- .../api/subusers/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../list_reputation200_response_inner.py | 30 +-- .../rest/api/subusers/v3/models/region.py | 10 +- .../rest/api/subusers/v3/models/region1.py | 8 +- .../rest/api/subusers/v3/models/region2.py | 8 +- .../rest/api/subusers/v3/models/region3.py | 8 +- .../api/subusers/v3/models/reset_frequency.py | 10 +- .../subusers/v3/models/reset_frequency1.py | 10 +- .../subusers/v3/models/sort_by_direction.py | 8 +- .../subusers/v3/models/sort_by_direction1.py | 8 +- .../subusers/v3/models/sort_by_direction2.py | 8 +- .../api/subusers/v3/models/sort_by_metric.py | 22 +- .../rest/api/subusers/v3/models/subuser.py | 57 +++-- .../api/subusers/v3/models/subuser_credits.py | 57 +++-- .../v3/models/subuser_credits_request.py | 41 ++-- .../api/subusers/v3/models/subuser_post.py | 61 ++--- .../models/subuser_post_credit_allocation.py | 26 +- .../api/subusers/v3/models/subuser_stats.py | 33 ++- .../v3/models/subuser_stats_stats_inner.py | 61 ++--- .../subuser_stats_stats_inner_metrics.py | 145 ++++++----- sendgrid/rest/api/subusers/v3/models/type.py | 10 +- sendgrid/rest/api/subusers/v3/models/type1.py | 10 +- .../models/update_subuser_ip200_response.py | 24 +- ...update_subuser_remaining_credit_request.py | 26 +- .../v3/models/update_subuser_request.py | 26 +- .../update_subuser_website_access_request.py | 26 +- .../rest/api/subusers/v3/update_subuser.py | 44 ++-- .../api/subusers/v3/update_subuser_credit.py | 45 ++-- .../rest/api/subusers/v3/update_subuser_ip.py | 41 ++-- .../v3/update_subuser_remaining_credit.py | 47 ++-- .../v3/update_subuser_website_access.py | 45 ++-- sendgrid/rest/api/suppressions/v3/__init__.py | 1 + .../v3/add_suppression_to_asm_group.py | 69 ++++++ .../api/suppressions/v3/creat_asm_group.py | 67 +++++ .../v3/create_global_suppression.py | 65 +++++ .../api/suppressions/v3/delete_asm_group.py | 62 +++++ .../v3/delete_global_suppression.py | 62 +++++ .../suppressions/v3/delete_invalid_email.py | 62 +++++ .../suppressions/v3/delete_invalid_emails.py | 65 +++++ .../api/suppressions/v3/delete_spam_report.py | 62 +++++ .../suppressions/v3/delete_spam_reports.py | 65 +++++ .../v3/delete_suppression_block.py | 62 +++++ .../v3/delete_suppression_blocks.py | 67 +++++ .../v3/delete_suppression_bounce.py | 62 +++++ .../v3/delete_suppression_bounces.py | 67 +++++ .../v3/delete_suppression_from_asm_group.py | 64 +++++ .../rest/api/suppressions/v3/get_asm_group.py | 62 +++++ .../suppressions/v3/get_asm_suppression.py | 62 +++++ .../suppressions/v3/get_global_suppression.py | 62 +++++ .../api/suppressions/v3/get_invalid_email.py | 62 +++++ .../api/suppressions/v3/get_spam_report.py | 62 +++++ .../suppressions/v3/get_suppression_block.py | 62 +++++ .../v3/get_suppression_bounces.py | 62 +++++ ...get_suppression_bounces_classifications.py | 68 ++++++ .../api/suppressions/v3/list_asm_group.py | 59 +++++ .../suppressions/v3/list_asm_suppression.py | 58 +++++ .../v3/list_global_suppression.py | 63 +++++ .../api/suppressions/v3/list_invalid_email.py | 63 +++++ .../api/suppressions/v3/list_spam_report.py | 63 +++++ .../suppressions/v3/list_suppression_block.py | 63 +++++ .../v3/list_suppression_bounces.py | 65 +++++ ...ist_suppression_bounces_classifications.py | 63 +++++ .../v3/list_suppression_from_asm_group.py | 62 +++++ .../api/suppressions/v3/models/__init__.py | 134 ++++++++++ .../rest/api/suppressions/v3/models/accept.py | 7 + .../api/suppressions/v3/models/accept1.py | 7 + ...dd_suppression_to_asm_group201_response.py | 24 ++ .../v3/models/blocks_response_inner.py | 41 ++++ .../suppressions/v3/models/bounce_response.py | 41 ++++ .../suppressions/v3/models/classification.py | 12 + .../suppressions/v3/models/classification1.py | 12 + .../v3/models/creat_asm_group201_response.py | 41 ++++ .../create_global_suppression201_response.py | 24 ++ .../models/delete_invalid_emails_request.py | 30 +++ .../v3/models/delete_spam_reports_request.py | 30 +++ .../delete_suppression_blocks_request.py | 30 +++ .../delete_suppression_bounces_request.py | 30 +++ .../suppressions/v3/models/error_response.py | 30 +++ .../v3/models/error_response_errors_inner.py | 37 +++ .../v3/models/get_asm_group200_response.py | 49 ++++ .../models/get_asm_suppression200_response.py | 30 +++ ...pression200_response_suppressions_inner.py | 45 ++++ ...ion_bounces_classifications200_response.py | 32 +++ ...lassifications200_response_result_inner.py | 34 +++ ...ns200_response_result_inner_stats_inner.py | 25 ++ .../suppressions/v3/models/invalid_email.py | 37 +++ .../list_asm_suppression200_response_inner.py | 41 ++++ ...st_global_suppression200_response_inner.py | 25 ++ ...ion_bounces_classifications200_response.py | 32 +++ ...lassifications200_response_result_inner.py | 34 +++ ...ns200_response_result_inner_stats_inner.py | 33 +++ .../retrieve_a_global_suppression_response.py | 24 ++ .../v3/models/spam_reports_response_inner.py | 37 +++ .../v3/models/suppression_group.py | 49 ++++ .../suppression_group_request_base_props.py | 37 +++ .../v3/models/suppressions_request.py | 22 ++ .../v3/models/update_asm_group_request.py | 37 +++ .../v3/search_suppression_from_asm_group.py | 69 ++++++ .../api/suppressions/v3/update_asm_group.py | 69 ++++++ sendgrid/rest/api/teammates/v3/__init__.py | 2 +- .../teammates/v3/delete_pending_teammate.py | 46 ++-- .../rest/api/teammates/v3/delete_teammate.py | 46 ++-- .../rest/api/teammates/v3/get_teammate.py | 47 ++-- .../rest/api/teammates/v3/invite_teammate.py | 49 ++-- .../api/teammates/v3/list_pending_teammate.py | 43 ++-- .../teammates/v3/list_subuser_by_template.py | 45 ++-- .../rest/api/teammates/v3/list_teammate.py | 47 ++-- .../rest/api/teammates/v3/models/__init__.py | 101 ++++++-- .../v3/models/get_teammate200_response.py | 135 +++++----- .../v3/models/invite_teammate201_response.py | 47 ++-- .../v3/models/invite_teammate400_response.py | 26 +- ...nvite_teammate400_response_errors_inner.py | 31 +-- .../v3/models/invite_teammate_request.py | 39 ++- .../list_pending_teammate200_response.py | 26 +- ...nding_teammate200_response_result_inner.py | 55 ++--- .../list_subuser_by_template200_response.py | 49 ++-- ...ubuser_by_template200_response_metadata.py | 31 +-- ...mplate200_response_metadata_next_params.py | 41 ++-- ...mplate200_response_subuser_access_inner.py | 63 +++-- .../list_subuser_by_template400_response.py | 26 +- ...er_by_template400_response_errors_inner.py | 31 +-- .../v3/models/list_teammate200_response.py | 26 +- .../list_teammate200_response_result_inner.py | 129 +++++----- .../teammates/v3/models/permission_type.py | 8 +- .../resend_teammate_invite200_response.py | 47 ++-- .../v3/models/update_teammate200_response.py | 135 +++++----- .../v3/models/update_teammate_request.py | 27 +- .../rest/api/teammates/v3/models/user_type.py | 10 +- .../api/teammates/v3/models/user_type1.py | 10 +- .../api/teammates/v3/models/user_type2.py | 10 +- .../teammates/v3/resend_teammate_invite.py | 47 ++-- .../rest/api/teammates/v3/update_teammate.py | 53 ++-- sendgrid/rest/api/templates/v3/__init__.py | 2 +- .../templates/v3/activate_template_version.py | 51 ++-- .../rest/api/templates/v3/create_template.py | 49 ++-- .../templates/v3/create_template_version.py | 55 +++-- .../rest/api/templates/v3/delete_template.py | 46 ++-- .../templates/v3/delete_template_version.py | 50 ++-- .../api/templates/v3/duplicate_template.py | 53 ++-- .../rest/api/templates/v3/get_template.py | 47 ++-- .../api/templates/v3/get_template_version.py | 51 ++-- .../rest/api/templates/v3/list_template.py | 51 ++-- .../rest/api/templates/v3/models/__init__.py | 75 ++++-- .../rest/api/templates/v3/models/active.py | 8 +- .../rest/api/templates/v3/models/active1.py | 8 +- .../v3/models/create_template_request.py | 29 +-- .../v3/models/duplicate_template_request.py | 26 +- .../rest/api/templates/v3/models/editor.py | 8 +- .../rest/api/templates/v3/models/editor1.py | 8 +- .../api/templates/v3/models/generation.py | 8 +- .../api/templates/v3/models/generation1.py | 8 +- .../api/templates/v3/models/generations.py | 10 +- .../v3/models/list_template200_response.py | 34 +-- .../v3/models/list_template400_response.py | 26 +- .../list_template400_response_errors_inner.py | 32 +-- .../rest/api/templates/v3/models/metadata.py | 49 ++-- .../v3/models/transactional_template.py | 71 +++--- .../transactional_template_version_create.py | 81 +++--- .../transactional_template_version_output.py | 123 +++++----- .../models/transactional_template_warning.py | 26 +- .../transactional_templates_template_lean.py | 59 ++--- ...sactional_templates_version_output_lean.py | 105 ++++---- .../v3/models/update_template_request.py | 26 +- .../rest/api/templates/v3/update_template.py | 53 ++-- .../templates/v3/update_template_version.py | 59 ++--- .../rest/api/tracking_settings/v3/__init__.py | 2 +- .../v3/list_click_tracking_setting.py | 43 ++-- .../list_google_analytics_tracking_setting.py | 43 ++-- .../v3/list_open_tracking_setting.py | 43 ++-- .../v3/list_subscription_tracking_setting.py | 43 ++-- .../v3/list_tracking_setting.py | 43 ++-- .../tracking_settings/v3/models/__init__.py | 43 +++- .../v3/models/click_tracking.py | 30 +-- .../v3/models/google_analytics_settings.py | 65 +++-- .../list_open_tracking_setting200_response.py | 26 +- .../list_tracking_setting200_response.py | 26 +- ...acking_setting200_response_result_inner.py | 49 ++-- .../models/subscription_tracking_settings.py | 65 +++-- .../update_click_tracking_setting_request.py | 26 +- .../update_open_tracking_setting_request.py | 26 +- .../v3/update_click_tracking_setting.py | 51 ++-- ...pdate_google_analytics_tracking_setting.py | 48 ++-- .../v3/update_open_tracking_setting.py | 51 ++-- .../update_subscription_tracking_setting.py | 48 ++-- sendgrid/rest/api/user/v3/__init__.py | 2 +- sendgrid/rest/api/user/v3/list_account.py | 43 ++-- sendgrid/rest/api/user/v3/list_credit.py | 43 ++-- sendgrid/rest/api/user/v3/list_email.py | 43 ++-- sendgrid/rest/api/user/v3/list_profile.py | 43 ++-- sendgrid/rest/api/user/v3/list_username.py | 43 ++-- sendgrid/rest/api/user/v3/models/__init__.py | 57 ++++- .../rest/api/user/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../v3/models/get_user_account_response.py | 31 +-- .../v3/models/get_user_profile_response.py | 105 ++++---- .../user/v3/models/list_credit200_response.py | 73 +++--- .../user/v3/models/list_email200_response.py | 26 +- .../v3/models/list_username200_response.py | 32 +-- sendgrid/rest/api/user/v3/models/type.py | 8 +- .../v3/models/update_email200_response.py | 26 +- .../user/v3/models/update_email_request.py | 26 +- .../user/v3/models/update_password_request.py | 31 ++- .../v3/models/update_username200_response.py | 26 +- .../user/v3/models/update_username_request.py | 26 +- .../rest/api/user/v3/models/user_profile.py | 105 ++++---- sendgrid/rest/api/user/v3/update_email.py | 45 ++-- sendgrid/rest/api/user/v3/update_password.py | 48 ++-- sendgrid/rest/api/user/v3/update_profile.py | 44 ++-- sendgrid/rest/api/user/v3/update_username.py | 49 ++-- .../rest/api/verified_senders/v3/__init__.py | 1 + .../v3/create_verified_sender.py | 57 +++++ .../v3/delete_verified_sender.py | 52 ++++ .../v3/list_verified_sender.py | 54 ++++ .../v3/list_verified_sender_domain.py | 48 ++++ .../list_verified_sender_steps_completed.py | 48 ++++ .../verified_senders/v3/models/__init__.py | 72 ++++++ .../create_verified_sender400_response.py | 27 ++ ...erified_sender400_response_errors_inner.py | 37 +++ .../delete_verified_sender403_response.py | 27 ++ ...erified_sender403_response_errors_inner.py | 28 +++ .../delete_verified_sender404_response.py | 27 ++ .../v3/models/error_response.py | 30 +++ .../v3/models/error_response_errors_inner.py | 37 +++ .../list_verified_sender200_response.py | 25 ++ ...list_verified_sender_domain200_response.py | 27 ++ ...ified_sender_domain200_response_results.py | 33 +++ ...fied_sender_steps_completed200_response.py | 30 +++ ...der_steps_completed200_response_results.py | 33 +++ .../v3/models/verified_sender_request.py | 69 ++++++ .../v3/models/verified_sender_response.py | 81 ++++++ .../v3/resend_verified_sender.py | 52 ++++ .../v3/update_verified_sender.py | 61 +++++ .../v3/verify_sender_token.py | 52 ++++ sendgrid/rest/api/webhooks/v3/__init__.py | 2 +- .../api/webhooks/v3/create_event_webhook.py | 49 ++-- .../api/webhooks/v3/create_parse_setting.py | 44 ++-- .../api/webhooks/v3/delete_event_webhook.py | 46 ++-- .../api/webhooks/v3/delete_parse_setting.py | 46 ++-- .../rest/api/webhooks/v3/get_event_webhook.py | 49 ++-- .../rest/api/webhooks/v3/get_parse_setting.py | 47 ++-- .../webhooks/v3/get_signed_event_webhook.py | 47 ++-- .../api/webhooks/v3/list_event_webhook.py | 45 ++-- .../api/webhooks/v3/list_parse_setting.py | 43 ++-- .../rest/api/webhooks/v3/list_parse_static.py | 53 ++-- .../rest/api/webhooks/v3/models/__init__.py | 115 +++++++-- .../api/webhooks/v3/models/aggregated_by.py | 10 +- .../create_event_webhook400_response.py | 26 +- ..._event_webhook400_response_errors_inner.py | 39 ++- .../api/webhooks/v3/models/error_response.py | 33 ++- .../v3/models/error_response_errors_inner.py | 41 ++-- .../v3/models/event_webhook_all_response.py | 34 +-- .../event_webhook_base_response_props.py | 145 ++++++----- .../event_webhook_date_response_props.py | 33 ++- .../models/event_webhook_no_dates_response.py | 169 +++++++------ .../event_webhook_oauth_response_props.py | 33 ++- .../v3/models/event_webhook_request.py | 153 ++++++------ .../models/event_webhook_signed_response.py | 185 +++++++------- .../event_webhook_signed_response_prop.py | 26 +- .../v3/models/event_webhook_test_request.py | 57 +++-- .../models/event_webhook_unsigned_response.py | 177 +++++++------- .../get_signed_event_webhook200_response.py | 31 +-- .../get_signed_event_webhook404_response.py | 26 +- ..._event_webhook404_response_errors_inner.py | 26 +- .../models/list_parse_setting200_response.py | 24 +- .../list_parse_static200_response_inner.py | 33 ++- ...se_static200_response_inner_stats_inner.py | 28 +-- ...c200_response_inner_stats_inner_metrics.py | 26 +- .../api/webhooks/v3/models/parse_setting.py | 49 ++-- .../update_signed_event_webhook_request.py | 26 +- .../api/webhooks/v3/test_event_webhook.py | 48 ++-- .../api/webhooks/v3/update_event_webhook.py | 55 ++--- .../api/webhooks/v3/update_parse_setting.py | 48 ++-- .../v3/update_signed_event_webhook.py | 55 +++-- 1245 files changed, 28323 insertions(+), 22949 deletions(-) create mode 100644 sendgrid/rest/api/mc_designs/v3/__init__.py create mode 100644 sendgrid/rest/api/mc_designs/v3/create_design.py create mode 100644 sendgrid/rest/api/mc_designs/v3/delete_design.py create mode 100644 sendgrid/rest/api/mc_designs/v3/duplicate_design.py create mode 100644 sendgrid/rest/api/mc_designs/v3/duplicate_pre_built_design.py create mode 100644 sendgrid/rest/api/mc_designs/v3/get_design.py create mode 100644 sendgrid/rest/api/mc_designs/v3/get_pre_built_design.py create mode 100644 sendgrid/rest/api/mc_designs/v3/list_design.py create mode 100644 sendgrid/rest/api/mc_designs/v3/list_pre_built_design.py create mode 100644 sendgrid/rest/api/mc_designs/v3/models/__init__.py create mode 100644 sendgrid/rest/api/mc_designs/v3/models/api_error.py create mode 100644 sendgrid/rest/api/mc_designs/v3/models/api_errors.py create mode 100644 sendgrid/rest/api/mc_designs/v3/models/design_common_properties.py create mode 100644 sendgrid/rest/api/mc_designs/v3/models/design_duplicate_input.py create mode 100644 sendgrid/rest/api/mc_designs/v3/models/design_input.py create mode 100644 sendgrid/rest/api/mc_designs/v3/models/design_output.py create mode 100644 sendgrid/rest/api/mc_designs/v3/models/design_output_summary.py create mode 100644 sendgrid/rest/api/mc_designs/v3/models/editor.py create mode 100644 sendgrid/rest/api/mc_designs/v3/models/list_design200_response.py create mode 100644 sendgrid/rest/api/mc_designs/v3/models/metadata.py create mode 100644 sendgrid/rest/api/mc_designs/v3/models/update_design_request.py create mode 100644 sendgrid/rest/api/mc_designs/v3/update_design.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/__init__.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/create_single_send.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/delete_scheduled_single_send.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/delete_single_send.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/delete_single_sends.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/duplicate_single_send.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/get_single_send.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/list_category.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/list_single_send.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/__init__.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/ab_test_summary.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/duplicate_single_send_request.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/editor.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/editor1.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/items.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/list_category200_response.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/list_single_send200_response.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/list_single_send500_response.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/list_single_send500_response_errors_inner.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/metadata.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/schedule_single_send201_response.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/schedule_single_send_request.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/search_single_send200_response.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/singlesend_request.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/singlesend_request_email_config.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/singlesend_request_send_to.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_email_config.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_send_to.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_short.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_warnings_inner.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/singlesend_schedule.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/singlesend_search.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/status.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/status1.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/status2.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/status3.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/type.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/models/winner_criteria.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/schedule_single_send.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/search_single_send.py create mode 100644 sendgrid/rest/api/mc_singlesends/v3/update_single_send.py create mode 100644 sendgrid/rest/api/seq/v3/__init__.py create mode 100644 sendgrid/rest/api/seq/v3/list_engagement_quality_score.py create mode 100644 sendgrid/rest/api/seq/v3/list_subuser_engagement_quality_score.py create mode 100644 sendgrid/rest/api/seq/v3/models/__init__.py create mode 100644 sendgrid/rest/api/seq/v3/models/seq_error.py create mode 100644 sendgrid/rest/api/seq/v3/models/seq_metadata.py create mode 100644 sendgrid/rest/api/seq/v3/models/seq_metadata_next_params.py create mode 100644 sendgrid/rest/api/seq/v3/models/seq_metrics.py create mode 100644 sendgrid/rest/api/seq/v3/models/seq_score.py create mode 100644 sendgrid/rest/api/suppressions/v3/__init__.py create mode 100644 sendgrid/rest/api/suppressions/v3/add_suppression_to_asm_group.py create mode 100644 sendgrid/rest/api/suppressions/v3/creat_asm_group.py create mode 100644 sendgrid/rest/api/suppressions/v3/create_global_suppression.py create mode 100644 sendgrid/rest/api/suppressions/v3/delete_asm_group.py create mode 100644 sendgrid/rest/api/suppressions/v3/delete_global_suppression.py create mode 100644 sendgrid/rest/api/suppressions/v3/delete_invalid_email.py create mode 100644 sendgrid/rest/api/suppressions/v3/delete_invalid_emails.py create mode 100644 sendgrid/rest/api/suppressions/v3/delete_spam_report.py create mode 100644 sendgrid/rest/api/suppressions/v3/delete_spam_reports.py create mode 100644 sendgrid/rest/api/suppressions/v3/delete_suppression_block.py create mode 100644 sendgrid/rest/api/suppressions/v3/delete_suppression_blocks.py create mode 100644 sendgrid/rest/api/suppressions/v3/delete_suppression_bounce.py create mode 100644 sendgrid/rest/api/suppressions/v3/delete_suppression_bounces.py create mode 100644 sendgrid/rest/api/suppressions/v3/delete_suppression_from_asm_group.py create mode 100644 sendgrid/rest/api/suppressions/v3/get_asm_group.py create mode 100644 sendgrid/rest/api/suppressions/v3/get_asm_suppression.py create mode 100644 sendgrid/rest/api/suppressions/v3/get_global_suppression.py create mode 100644 sendgrid/rest/api/suppressions/v3/get_invalid_email.py create mode 100644 sendgrid/rest/api/suppressions/v3/get_spam_report.py create mode 100644 sendgrid/rest/api/suppressions/v3/get_suppression_block.py create mode 100644 sendgrid/rest/api/suppressions/v3/get_suppression_bounces.py create mode 100644 sendgrid/rest/api/suppressions/v3/get_suppression_bounces_classifications.py create mode 100644 sendgrid/rest/api/suppressions/v3/list_asm_group.py create mode 100644 sendgrid/rest/api/suppressions/v3/list_asm_suppression.py create mode 100644 sendgrid/rest/api/suppressions/v3/list_global_suppression.py create mode 100644 sendgrid/rest/api/suppressions/v3/list_invalid_email.py create mode 100644 sendgrid/rest/api/suppressions/v3/list_spam_report.py create mode 100644 sendgrid/rest/api/suppressions/v3/list_suppression_block.py create mode 100644 sendgrid/rest/api/suppressions/v3/list_suppression_bounces.py create mode 100644 sendgrid/rest/api/suppressions/v3/list_suppression_bounces_classifications.py create mode 100644 sendgrid/rest/api/suppressions/v3/list_suppression_from_asm_group.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/__init__.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/accept.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/accept1.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/add_suppression_to_asm_group201_response.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/blocks_response_inner.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/bounce_response.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/classification.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/classification1.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/creat_asm_group201_response.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/create_global_suppression201_response.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/delete_invalid_emails_request.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/delete_spam_reports_request.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/delete_suppression_blocks_request.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/delete_suppression_bounces_request.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/error_response.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/error_response_errors_inner.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/get_asm_group200_response.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/get_asm_suppression200_response.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/get_asm_suppression200_response_suppressions_inner.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/get_suppression_bounces_classifications200_response.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/get_suppression_bounces_classifications200_response_result_inner.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/get_suppression_bounces_classifications200_response_result_inner_stats_inner.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/invalid_email.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/list_asm_suppression200_response_inner.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/list_global_suppression200_response_inner.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/list_suppression_bounces_classifications200_response.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/list_suppression_bounces_classifications200_response_result_inner.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/list_suppression_bounces_classifications200_response_result_inner_stats_inner.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/retrieve_a_global_suppression_response.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/spam_reports_response_inner.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/suppression_group.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/suppression_group_request_base_props.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/suppressions_request.py create mode 100644 sendgrid/rest/api/suppressions/v3/models/update_asm_group_request.py create mode 100644 sendgrid/rest/api/suppressions/v3/search_suppression_from_asm_group.py create mode 100644 sendgrid/rest/api/suppressions/v3/update_asm_group.py create mode 100644 sendgrid/rest/api/verified_senders/v3/__init__.py create mode 100644 sendgrid/rest/api/verified_senders/v3/create_verified_sender.py create mode 100644 sendgrid/rest/api/verified_senders/v3/delete_verified_sender.py create mode 100644 sendgrid/rest/api/verified_senders/v3/list_verified_sender.py create mode 100644 sendgrid/rest/api/verified_senders/v3/list_verified_sender_domain.py create mode 100644 sendgrid/rest/api/verified_senders/v3/list_verified_sender_steps_completed.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/__init__.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/create_verified_sender400_response.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/create_verified_sender400_response_errors_inner.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/delete_verified_sender403_response.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/delete_verified_sender403_response_errors_inner.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/delete_verified_sender404_response.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/error_response.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/error_response_errors_inner.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/list_verified_sender200_response.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_domain200_response.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_domain200_response_results.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_steps_completed200_response.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_steps_completed200_response_results.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/verified_sender_request.py create mode 100644 sendgrid/rest/api/verified_senders/v3/models/verified_sender_response.py create mode 100644 sendgrid/rest/api/verified_senders/v3/resend_verified_sender.py create mode 100644 sendgrid/rest/api/verified_senders/v3/update_verified_sender.py create mode 100644 sendgrid/rest/api/verified_senders/v3/verify_sender_token.py diff --git a/sendgrid/rest/api/account_provisioning/v3/__init__.py b/sendgrid/rest/api/account_provisioning/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/account_provisioning/v3/__init__.py +++ b/sendgrid/rest/api/account_provisioning/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/account_provisioning/v3/authenticate_account.py b/sendgrid/rest/api/account_provisioning/v3/authenticate_account.py index 33d58fd6..7e468fc0 100644 --- a/sendgrid/rest/api/account_provisioning/v3/authenticate_account.py +++ b/sendgrid/rest/api/account_provisioning/v3/authenticate_account.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated class AuthenticateAccount: def __init__(self, client) -> None: self.client = client - + def send( self, - account_id: str, - + account_id: str, ): - path='/v3/partners/accounts/{accountID}/sso' + path = "/v3/partners/accounts/{accountID}/sso" path = path.format( - account_id=account_id, + account_id=account_id, ) data = None - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/create_account.py b/sendgrid/rest/api/account_provisioning/v3/create_account.py index d235dd73..4b9cc570 100644 --- a/sendgrid/rest/api/account_provisioning/v3/create_account.py +++ b/sendgrid/rest/api/account_provisioning/v3/create_account.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_account_id import AccountProvisioningAccountId -from sendgrid.rest.api.account_provisioning.v3.models.create_account_params import CreateAccountParams +from sendgrid.rest.api.account_provisioning.v3.models.create_account_params import ( + CreateAccountParams, +) + class CreateAccount: def __init__(self, client) -> None: self.client = client - + def send( self, - t_test_account: Optional[str] = None, - create_account_params: Optional[CreateAccountParams] = None, - + t_test_account: Optional[str] = None, + create_account_params: Optional[CreateAccountParams] = None, ): - path='/v3/partners/accounts' + path = "/v3/partners/accounts" headers = values.of( - { - 'T-Test-Account': t_test_account, - }) + { + "T-Test-Account": t_test_account, + } + ) headers["Content-Type"] = "application/json" data = None if create_account_params: data = create_account_params.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/delete_account.py b/sendgrid/rest/api/account_provisioning/v3/delete_account.py index 24834849..3ea83b49 100644 --- a/sendgrid/rest/api/account_provisioning/v3/delete_account.py +++ b/sendgrid/rest/api/account_provisioning/v3/delete_account.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated class DeleteAccount: def __init__(self, client) -> None: self.client = client - + def send( self, - account_id: str, - + account_id: str, ): - path='/v3/partners/accounts/{accountID}' + path = "/v3/partners/accounts/{accountID}" path = path.format( - account_id=account_id, + account_id=account_id, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/get_account_state.py b/sendgrid/rest/api/account_provisioning/v3/get_account_state.py index 1c61436e..704e4d07 100644 --- a/sendgrid/rest/api/account_provisioning/v3/get_account_state.py +++ b/sendgrid/rest/api/account_provisioning/v3/get_account_state.py @@ -12,48 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_state_read import AccountProvisioningStateRead class GetAccountState: def __init__(self, client) -> None: self.client = client - + def send( self, - account_id: str, - + account_id: str, ): - path='/v3/partners/accounts/{accountID}/state' + path = "/v3/partners/accounts/{accountID}/state" path = path.format( - account_id=account_id, + account_id=account_id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/list_account.py b/sendgrid/rest/api/account_provisioning/v3/list_account.py index 4fe7a78d..a7f13b01 100644 --- a/sendgrid/rest/api/account_provisioning/v3/list_account.py +++ b/sendgrid/rest/api/account_provisioning/v3/list_account.py @@ -12,47 +12,42 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.account_provisioning.v3.models.account_list import AccountList + class ListAccount: def __init__(self, client) -> None: self.client = client - + def send( self, - offset: Optional[str] = None, - limit: Optional[int] = None, - + offset: Optional[str] = None, + limit: Optional[int] = None, ): - path='/v3/partners/accounts' + path = "/v3/partners/accounts" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/list_account_offering.py b/sendgrid/rest/api/account_provisioning/v3/list_account_offering.py index ca3aee7a..2cc7e548 100644 --- a/sendgrid/rest/api/account_provisioning/v3/list_account_offering.py +++ b/sendgrid/rest/api/account_provisioning/v3/list_account_offering.py @@ -12,48 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_list import AccountProvisioningOfferingList class ListAccountOffering: def __init__(self, client) -> None: self.client = client - + def send( self, - account_id: str, - + account_id: str, ): - path='/v3/partners/accounts/{accountID}/offerings' + path = "/v3/partners/accounts/{accountID}/offerings" path = path.format( - account_id=account_id, + account_id=account_id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/list_offering.py b/sendgrid/rest/api/account_provisioning/v3/list_offering.py index 65371c2b..ad6a4af3 100644 --- a/sendgrid/rest/api/account_provisioning/v3/list_offering.py +++ b/sendgrid/rest/api/account_provisioning/v3/list_offering.py @@ -12,42 +12,37 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_catalog import AccountProvisioningCatalog class ListOffering: def __init__(self, client) -> None: self.client = client - + def send( self, - ): - path='/v3/partners/offerings' + path = "/v3/partners/offerings" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/__init__.py b/sendgrid/rest/api/account_provisioning/v3/models/__init__.py index 1ae1d36e..e19c8c27 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/__init__.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/__init__.py @@ -11,25 +11,70 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.account_provisioning.v3.models.account_list import AccountList -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_account import AccountProvisioningAccount -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_account_id import AccountProvisioningAccountId -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_catalog import AccountProvisioningCatalog -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_list import AccountProvisioningOfferingList -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_v1 import AccountProvisioningOfferingV1 -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_pagination import AccountProvisioningPagination -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_profile import AccountProvisioningProfile -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_state_read import AccountProvisioningStateRead -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_state_write import AccountProvisioningStateWrite +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_account import ( + AccountProvisioningAccount, +) +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_account_id import ( + AccountProvisioningAccountId, +) +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_catalog import ( + AccountProvisioningCatalog, +) +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_list import ( + AccountProvisioningOfferingList, +) +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_v1 import ( + AccountProvisioningOfferingV1, +) +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_pagination import ( + AccountProvisioningPagination, +) +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_profile import ( + AccountProvisioningProfile, +) +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_state_read import ( + AccountProvisioningStateRead, +) +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_state_write import ( + AccountProvisioningStateWrite, +) from sendgrid.rest.api.account_provisioning.v3.models.catalog_entry import CatalogEntry -from sendgrid.rest.api.account_provisioning.v3.models.catalog_entry_entitlements import CatalogEntryEntitlements -from sendgrid.rest.api.account_provisioning.v3.models.create_account_params import CreateAccountParams -from sendgrid.rest.api.account_provisioning.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.account_provisioning.v3.models.offerings_to_add import OfferingsToAdd +from sendgrid.rest.api.account_provisioning.v3.models.catalog_entry_entitlements import ( + CatalogEntryEntitlements, +) +from sendgrid.rest.api.account_provisioning.v3.models.create_account_params import ( + CreateAccountParams, +) +from sendgrid.rest.api.account_provisioning.v3.models.error_response import ( + ErrorResponse, +) +from sendgrid.rest.api.account_provisioning.v3.models.offerings_to_add import ( + OfferingsToAdd, +) from sendgrid.rest.api.account_provisioning.v3.models.state import State from sendgrid.rest.api.account_provisioning.v3.models.state1 import State1 from sendgrid.rest.api.account_provisioning.v3.models.type import Type -__all__ = [ 'AccountList', 'AccountProvisioningAccount', 'AccountProvisioningAccountId', 'AccountProvisioningCatalog', 'AccountProvisioningOfferingList', 'AccountProvisioningOfferingV1', 'AccountProvisioningPagination', 'AccountProvisioningProfile', 'AccountProvisioningStateRead', 'AccountProvisioningStateWrite', 'CatalogEntry', 'CatalogEntryEntitlements', 'CreateAccountParams', 'ErrorResponse', 'OfferingsToAdd', 'State', 'State1', 'Type' ] -# Testing code \ No newline at end of file + +__all__ = [ + "AccountList", + "AccountProvisioningAccount", + "AccountProvisioningAccountId", + "AccountProvisioningCatalog", + "AccountProvisioningOfferingList", + "AccountProvisioningOfferingV1", + "AccountProvisioningPagination", + "AccountProvisioningProfile", + "AccountProvisioningStateRead", + "AccountProvisioningStateWrite", + "CatalogEntry", + "CatalogEntryEntitlements", + "CreateAccountParams", + "ErrorResponse", + "OfferingsToAdd", + "State", + "State1", + "Type", +] +# Testing code diff --git a/sendgrid/rest/api/account_provisioning/v3/models/account_list.py b/sendgrid/rest/api/account_provisioning/v3/models/account_list.py index 27ef0648..9ab28cb4 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/account_list.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/account_list.py @@ -1,27 +1,28 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_account import AccountProvisioningAccount -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_pagination import AccountProvisioningPagination - +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_account import ( + AccountProvisioningAccount, +) +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_pagination import ( + AccountProvisioningPagination, +) class AccountList: def __init__( - self, - accounts: Optional[List[AccountProvisioningAccount]]=None, - pages: Optional[AccountProvisioningPagination]=None + self, + accounts: Optional[List[AccountProvisioningAccount]] = None, + pages: Optional[AccountProvisioningPagination] = None, ): - self.accounts=accounts - self.pages=pages + self.accounts = accounts + self.pages = pages def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "accounts": self.accounts, - "pages": self.pages - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"accounts": self.accounts, "pages": self.pages}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,8 +30,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AccountList( - accounts=payload.get('accounts'), - pages=payload.get('pages') - ) - + return AccountList(accounts=payload.get("accounts"), pages=payload.get("pages")) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_account.py b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_account.py index 6bd139be..2710c05b 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_account.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_account.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AccountProvisioningAccount: - def __init__( - self, - id: Optional[str]=None, - created_at: Optional[datetime]=None - ): - self.id=id - self.created_at=created_at + def __init__(self, id: Optional[str] = None, created_at: Optional[datetime] = None): + self.id = id + self.created_at = created_at def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "id": self.id, - "created_at": self.created_at - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"id": self.id, "created_at": self.created_at}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AccountProvisioningAccount( - id=payload.get('id'), - created_at=payload.get('created_at') - ) - + id=payload.get("id"), created_at=payload.get("created_at") + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_account_id.py b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_account_id.py index 3dc80ae5..af76163b 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_account_id.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_account_id.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AccountProvisioningAccountId: - def __init__( - self, - account_id: Optional[str]=None - ): - self.account_id=account_id + def __init__(self, account_id: Optional[str] = None): + self.account_id = account_id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "account_id": self.account_id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"account_id": self.account_id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AccountProvisioningAccountId( - account_id=payload.get('account_id') - ) - + return AccountProvisioningAccountId(account_id=payload.get("account_id")) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_catalog.py b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_catalog.py index 9472e682..1f818485 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_catalog.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_catalog.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.account_provisioning.v3.models.catalog_entry import CatalogEntry - class AccountProvisioningCatalog: - def __init__( - self, - catalog: Optional[List[CatalogEntry]]=None - ): - self.catalog=catalog + def __init__(self, catalog: Optional[List[CatalogEntry]] = None): + self.catalog = catalog def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "catalog": self.catalog - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"catalog": self.catalog}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AccountProvisioningCatalog( - catalog=payload.get('catalog') - ) - + return AccountProvisioningCatalog(catalog=payload.get("catalog")) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_offering_list.py b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_offering_list.py index 05275e3e..371db5c9 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_offering_list.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_offering_list.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_v1 import AccountProvisioningOfferingV1 - +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_v1 import ( + AccountProvisioningOfferingV1, +) class AccountProvisioningOfferingList: - def __init__( - self, - offerings: Optional[List[AccountProvisioningOfferingV1]]=None - ): - self.offerings=offerings + def __init__(self, offerings: Optional[List[AccountProvisioningOfferingV1]] = None): + self.offerings = offerings def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "offerings": self.offerings - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"offerings": self.offerings}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AccountProvisioningOfferingList( - offerings=payload.get('offerings') - ) - + return AccountProvisioningOfferingList(offerings=payload.get("offerings")) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_offering_v1.py b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_offering_v1.py index 85b07220..9b362d39 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_offering_v1.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_offering_v1.py @@ -1,29 +1,29 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.account_provisioning.v3.models.type import Type - class AccountProvisioningOfferingV1: def __init__( - self, - name: Optional[str]=None, - type: Optional[Type]=None, - quantity: Optional[int]=None + self, + name: Optional[str] = None, + type: Optional[Type] = None, + quantity: Optional[int] = None, ): - self.name=name - self.type=type - self.quantity=quantity + self.name = name + self.type = type + self.quantity = quantity def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "type": self.type, - "quantity": self.quantity - }.items() if value is not None} + "name": self.name, + "type": self.type, + "quantity": self.quantity, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +32,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AccountProvisioningOfferingV1( - name=payload.get('name'), - type=payload.get('type'), - quantity=payload.get('quantity') - ) - + name=payload.get("name"), + type=payload.get("type"), + quantity=payload.get("quantity"), + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_pagination.py b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_pagination.py index 4808b095..378dd596 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_pagination.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_pagination.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AccountProvisioningPagination: - def __init__( - self, - last: Optional[str]=None, - example: Optional[object]=None - ): - self.last=last - self.example=example + def __init__(self, last: Optional[str] = None, example: Optional[object] = None): + self.last = last + self.example = example def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "last": self.last, - "example": self.example - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"last": self.last, "example": self.example}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AccountProvisioningPagination( - last=payload.get('last'), - example=payload.get('example') - ) - + last=payload.get("last"), example=payload.get("example") + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_profile.py b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_profile.py index db7e89bc..47edf9fe 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_profile.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_profile.py @@ -1,40 +1,40 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AccountProvisioningProfile: def __init__( - self, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - company_name: Optional[str]=None, - company_website: Optional[str]=None, - email: Optional[str]=None, - phone: Optional[str]=None, - timezone: Optional[str]=None + self, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + company_name: Optional[str] = None, + company_website: Optional[str] = None, + email: Optional[str] = None, + phone: Optional[str] = None, + timezone: Optional[str] = None, ): - self.first_name=first_name - self.last_name=last_name - self.company_name=company_name - self.company_website=company_website - self.email=email - self.phone=phone - self.timezone=timezone + self.first_name = first_name + self.last_name = last_name + self.company_name = company_name + self.company_website = company_website + self.email = email + self.phone = phone + self.timezone = timezone def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "first_name": self.first_name, - "last_name": self.last_name, - "company_name": self.company_name, - "company_website": self.company_website, - "email": self.email, - "phone": self.phone, - "timezone": self.timezone - }.items() if value is not None} + "first_name": self.first_name, + "last_name": self.last_name, + "company_name": self.company_name, + "company_website": self.company_website, + "email": self.email, + "phone": self.phone, + "timezone": self.timezone, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -43,12 +43,11 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AccountProvisioningProfile( - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - company_name=payload.get('company_name'), - company_website=payload.get('company_website'), - email=payload.get('email'), - phone=payload.get('phone'), - timezone=payload.get('timezone') - ) - + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + company_name=payload.get("company_name"), + company_website=payload.get("company_website"), + email=payload.get("email"), + phone=payload.get("phone"), + timezone=payload.get("timezone"), + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_state_read.py b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_state_read.py index d81d8ae2..890ef894 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_state_read.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_state_read.py @@ -1,23 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.account_provisioning.v3.models.state import State - class AccountProvisioningStateRead: - def __init__( - self, - state: Optional[State]=None - ): - self.state=state + def __init__(self, state: Optional[State] = None): + self.state = state def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "state": self.state - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"state": self.state}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AccountProvisioningStateRead( - state=payload.get('state') - ) - + return AccountProvisioningStateRead(state=payload.get("state")) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_state_write.py b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_state_write.py index 9d567e57..c026516e 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_state_write.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/account_provisioning_state_write.py @@ -1,23 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.account_provisioning.v3.models.state1 import State1 - class AccountProvisioningStateWrite: - def __init__( - self, - state: Optional[State1]=None - ): - self.state=state + def __init__(self, state: Optional[State1] = None): + self.state = state def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "state": self.state - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"state": self.state}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AccountProvisioningStateWrite( - state=payload.get('state') - ) - + return AccountProvisioningStateWrite(state=payload.get("state")) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/catalog_entry.py b/sendgrid/rest/api/account_provisioning/v3/models/catalog_entry.py index a8b37902..d87c5666 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/catalog_entry.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/catalog_entry.py @@ -1,27 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_v1 import AccountProvisioningOfferingV1 -from sendgrid.rest.api.account_provisioning.v3.models.catalog_entry_entitlements import CatalogEntryEntitlements - +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_v1 import ( + AccountProvisioningOfferingV1, +) +from sendgrid.rest.api.account_provisioning.v3.models.catalog_entry_entitlements import ( + CatalogEntryEntitlements, +) class CatalogEntry: def __init__( - self, - offering: Optional[AccountProvisioningOfferingV1]=None, - entitlements: Optional[CatalogEntryEntitlements]=None + self, + offering: Optional[AccountProvisioningOfferingV1] = None, + entitlements: Optional[CatalogEntryEntitlements] = None, ): - self.offering=offering - self.entitlements=entitlements + self.offering = offering + self.entitlements = entitlements def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "offering": self.offering, - "entitlements": self.entitlements - }.items() if value is not None} + "offering": self.offering, + "entitlements": self.entitlements, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -30,7 +34,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CatalogEntry( - offering=payload.get('offering'), - entitlements=payload.get('entitlements') - ) - + offering=payload.get("offering"), entitlements=payload.get("entitlements") + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/catalog_entry_entitlements.py b/sendgrid/rest/api/account_provisioning/v3/models/catalog_entry_entitlements.py index eaa3f1d5..64598d22 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/catalog_entry_entitlements.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/catalog_entry_entitlements.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CatalogEntryEntitlements: def __init__( - self, - email_sends_max_monthly: Optional[int]=None, - ip_count: Optional[int]=None, - teammates_max_total: Optional[int]=None, - users_max_total: Optional[int]=None + self, + email_sends_max_monthly: Optional[int] = None, + ip_count: Optional[int] = None, + teammates_max_total: Optional[int] = None, + users_max_total: Optional[int] = None, ): - self.email_sends_max_monthly=email_sends_max_monthly - self.ip_count=ip_count - self.teammates_max_total=teammates_max_total - self.users_max_total=users_max_total + self.email_sends_max_monthly = email_sends_max_monthly + self.ip_count = ip_count + self.teammates_max_total = teammates_max_total + self.users_max_total = users_max_total def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "email_sends_max_monthly": self.email_sends_max_monthly, - "ip_count": self.ip_count, - "teammates_max_total": self.teammates_max_total, - "users_max_total": self.users_max_total - }.items() if value is not None} + "email_sends_max_monthly": self.email_sends_max_monthly, + "ip_count": self.ip_count, + "teammates_max_total": self.teammates_max_total, + "users_max_total": self.users_max_total, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CatalogEntryEntitlements( - email_sends_max_monthly=payload.get('email_sends_max_monthly'), - ip_count=payload.get('ip_count'), - teammates_max_total=payload.get('teammates_max_total'), - users_max_total=payload.get('users_max_total') - ) - + email_sends_max_monthly=payload.get("email_sends_max_monthly"), + ip_count=payload.get("ip_count"), + teammates_max_total=payload.get("teammates_max_total"), + users_max_total=payload.get("users_max_total"), + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/create_account_params.py b/sendgrid/rest/api/account_provisioning/v3/models/create_account_params.py index 00051968..7f220d54 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/create_account_params.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/create_account_params.py @@ -1,27 +1,31 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_v1 import AccountProvisioningOfferingV1 -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_profile import AccountProvisioningProfile - +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_v1 import ( + AccountProvisioningOfferingV1, +) +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_profile import ( + AccountProvisioningProfile, +) class CreateAccountParams: def __init__( - self, - profile: Optional[AccountProvisioningProfile]=None, - offerings: Optional[List[AccountProvisioningOfferingV1]]=None + self, + profile: Optional[AccountProvisioningProfile] = None, + offerings: Optional[List[AccountProvisioningOfferingV1]] = None, ): - self.profile=profile - self.offerings=offerings + self.profile = profile + self.offerings = offerings def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "profile": self.profile, - "offerings": self.offerings - }.items() if value is not None} + "profile": self.profile, + "offerings": self.offerings, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -30,7 +34,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateAccountParams( - profile=payload.get('profile'), - offerings=payload.get('offerings') - ) - + profile=payload.get("profile"), offerings=payload.get("offerings") + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/error_response.py b/sendgrid/rest/api/account_provisioning/v3/models/error_response.py index 1b742d94..961d1df8 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/error_response.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/error_response.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponse: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - error_id: Optional[str]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + error_id: Optional[str] = None, ): - self.message=message - self.field=field - self.error_id=error_id + self.message = message + self.field = field + self.error_id = error_id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "error_id": self.error_id - }.items() if value is not None} + "message": self.message, + "field": self.field, + "error_id": self.error_id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponse( - message=payload.get('message'), - field=payload.get('field'), - error_id=payload.get('error_id') - ) - + message=payload.get("message"), + field=payload.get("field"), + error_id=payload.get("error_id"), + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/offerings_to_add.py b/sendgrid/rest/api/account_provisioning/v3/models/offerings_to_add.py index 86763256..30c5237d 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/offerings_to_add.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/offerings_to_add.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_v1 import AccountProvisioningOfferingV1 - +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_v1 import ( + AccountProvisioningOfferingV1, +) class OfferingsToAdd: - def __init__( - self, - offerings: Optional[List[AccountProvisioningOfferingV1]]=None - ): - self.offerings=offerings + def __init__(self, offerings: Optional[List[AccountProvisioningOfferingV1]] = None): + self.offerings = offerings def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "offerings": self.offerings - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"offerings": self.offerings}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return OfferingsToAdd( - offerings=payload.get('offerings') - ) - + return OfferingsToAdd(offerings=payload.get("offerings")) diff --git a/sendgrid/rest/api/account_provisioning/v3/models/state.py b/sendgrid/rest/api/account_provisioning/v3/models/state.py index 877134c2..6e11eb0e 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/state.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/state.py @@ -1,14 +1,10 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class State(Enum): - ACTIVATED='activated' - DEACTIVATED='deactivated' - SUSPENDED='suspended' - BANNED='banned' - INDETERMINATE='indeterminate' - + ACTIVATED = "activated" + DEACTIVATED = "deactivated" + SUSPENDED = "suspended" + BANNED = "banned" + INDETERMINATE = "indeterminate" diff --git a/sendgrid/rest/api/account_provisioning/v3/models/state1.py b/sendgrid/rest/api/account_provisioning/v3/models/state1.py index 2b8b24ce..718901c4 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/state1.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/state1.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class State1(Enum): - ACTIVATED='activated' - DEACTIVATED='deactivated' - + ACTIVATED = "activated" + DEACTIVATED = "deactivated" diff --git a/sendgrid/rest/api/account_provisioning/v3/models/type.py b/sendgrid/rest/api/account_provisioning/v3/models/type.py index 17a4b9ff..9bfff196 100644 --- a/sendgrid/rest/api/account_provisioning/v3/models/type.py +++ b/sendgrid/rest/api/account_provisioning/v3/models/type.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Type(Enum): - PACKAGE='package' - ADDON='addon' - + PACKAGE = "package" + ADDON = "addon" diff --git a/sendgrid/rest/api/account_provisioning/v3/update_account_offering.py b/sendgrid/rest/api/account_provisioning/v3/update_account_offering.py index 34a3326c..2b4a8208 100644 --- a/sendgrid/rest/api/account_provisioning/v3/update_account_offering.py +++ b/sendgrid/rest/api/account_provisioning/v3/update_account_offering.py @@ -12,52 +12,49 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_offering_list import AccountProvisioningOfferingList -from sendgrid.rest.api.account_provisioning.v3.models.offerings_to_add import OfferingsToAdd +from sendgrid.rest.api.account_provisioning.v3.models.offerings_to_add import ( + OfferingsToAdd, +) + class UpdateAccountOffering: def __init__(self, client) -> None: self.client = client - + def send( self, - account_id: str, - offerings_to_add: Optional[OfferingsToAdd] = None, - + account_id: str, + offerings_to_add: Optional[OfferingsToAdd] = None, ): - path='/v3/partners/accounts/{accountID}/offerings' + path = "/v3/partners/accounts/{accountID}/offerings" path = path.format( - account_id=account_id, + account_id=account_id, ) data = None if offerings_to_add: data = offerings_to_add.to_dict() - request = Request( - method='PUT', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/account_provisioning/v3/update_account_state.py b/sendgrid/rest/api/account_provisioning/v3/update_account_state.py index 5eab9ff5..7dc9440b 100644 --- a/sendgrid/rest/api/account_provisioning/v3/update_account_state.py +++ b/sendgrid/rest/api/account_provisioning/v3/update_account_state.py @@ -12,51 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_state_write import AccountProvisioningStateWrite +from sendgrid.rest.api.account_provisioning.v3.models.account_provisioning_state_write import ( + AccountProvisioningStateWrite, +) + class UpdateAccountState: def __init__(self, client) -> None: self.client = client - + def send( self, - account_id: str, - account_provisioning_state_write: Optional[AccountProvisioningStateWrite] = None, - + account_id: str, + account_provisioning_state_write: Optional[ + AccountProvisioningStateWrite + ] = None, ): - path='/v3/partners/accounts/{accountID}/state' + path = "/v3/partners/accounts/{accountID}/state" path = path.format( - account_id=account_id, + account_id=account_id, ) data = None if account_provisioning_state_write: data = account_provisioning_state_write.to_dict() - request = Request( - method='PUT', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/alerts/v3/__init__.py b/sendgrid/rest/api/alerts/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/alerts/v3/__init__.py +++ b/sendgrid/rest/api/alerts/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/alerts/v3/create_alert.py b/sendgrid/rest/api/alerts/v3/create_alert.py index e889b8bc..6455cc23 100644 --- a/sendgrid/rest/api/alerts/v3/create_alert.py +++ b/sendgrid/rest/api/alerts/v3/create_alert.py @@ -12,55 +12,52 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.alerts.v3.models.create_alert201_response import CreateAlert201Response from sendgrid.rest.api.alerts.v3.models.create_alert_request import CreateAlertRequest + class CreateAlert: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - create_alert_request: Optional[CreateAlertRequest] = None, - + on_behalf_of: Optional[str] = None, + create_alert_request: Optional[CreateAlertRequest] = None, ): - path='/v3/alerts' + path = "/v3/alerts" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if create_alert_request: data = create_alert_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/alerts/v3/delete_alert.py b/sendgrid/rest/api/alerts/v3/delete_alert.py index ce2f8fd6..f33d05bc 100644 --- a/sendgrid/rest/api/alerts/v3/delete_alert.py +++ b/sendgrid/rest/api/alerts/v3/delete_alert.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteAlert: def __init__(self, client) -> None: self.client = client - + def send( self, - alert_id: int, - on_behalf_of: Optional[str] = None, - + alert_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/alerts/{alert_id}' + path = "/v3/alerts/{alert_id}" path = path.format( - alert_id=alert_id, + alert_id=alert_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/alerts/v3/get_alert.py b/sendgrid/rest/api/alerts/v3/get_alert.py index b6273546..492e599f 100644 --- a/sendgrid/rest/api/alerts/v3/get_alert.py +++ b/sendgrid/rest/api/alerts/v3/get_alert.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.alerts.v3.models.get_alert200_response import GetAlert200Response + class GetAlert: def __init__(self, client) -> None: self.client = client - + def send( self, - alert_id: int, - on_behalf_of: Optional[str] = None, - + alert_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/alerts/{alert_id}' + path = "/v3/alerts/{alert_id}" path = path.format( - alert_id=alert_id, + alert_id=alert_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/alerts/v3/list_alert.py b/sendgrid/rest/api/alerts/v3/list_alert.py index c2b9ff65..22711d49 100644 --- a/sendgrid/rest/api/alerts/v3/list_alert.py +++ b/sendgrid/rest/api/alerts/v3/list_alert.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.alerts.v3.models.list_alert200_response_inner import ListAlert200ResponseInner + class ListAlert: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/alerts' + path = "/v3/alerts" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/alerts/v3/models/__init__.py b/sendgrid/rest/api/alerts/v3/models/__init__.py index 65f93d88..e75a6dfc 100644 --- a/sendgrid/rest/api/alerts/v3/models/__init__.py +++ b/sendgrid/rest/api/alerts/v3/models/__init__.py @@ -11,19 +11,40 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.alerts.v3.models.create_alert201_response import CreateAlert201Response +from sendgrid.rest.api.alerts.v3.models.create_alert201_response import ( + CreateAlert201Response, +) from sendgrid.rest.api.alerts.v3.models.create_alert_request import CreateAlertRequest from sendgrid.rest.api.alerts.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.alerts.v3.models.error_response_errors_inner import ErrorResponseErrorsInner +from sendgrid.rest.api.alerts.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) from sendgrid.rest.api.alerts.v3.models.get_alert200_response import GetAlert200Response -from sendgrid.rest.api.alerts.v3.models.list_alert200_response_inner import ListAlert200ResponseInner +from sendgrid.rest.api.alerts.v3.models.list_alert200_response_inner import ( + ListAlert200ResponseInner, +) from sendgrid.rest.api.alerts.v3.models.type import Type from sendgrid.rest.api.alerts.v3.models.type1 import Type1 from sendgrid.rest.api.alerts.v3.models.type2 import Type2 from sendgrid.rest.api.alerts.v3.models.type3 import Type3 -from sendgrid.rest.api.alerts.v3.models.update_alert200_response import UpdateAlert200Response +from sendgrid.rest.api.alerts.v3.models.update_alert200_response import ( + UpdateAlert200Response, +) from sendgrid.rest.api.alerts.v3.models.update_alert_request import UpdateAlertRequest -__all__ = [ 'CreateAlert201Response', 'CreateAlertRequest', 'ErrorResponse', 'ErrorResponseErrorsInner', 'GetAlert200Response', 'ListAlert200ResponseInner', 'Type', 'Type1', 'Type2', 'Type3', 'UpdateAlert200Response', 'UpdateAlertRequest' ] -# Testing code \ No newline at end of file + +__all__ = [ + "CreateAlert201Response", + "CreateAlertRequest", + "ErrorResponse", + "ErrorResponseErrorsInner", + "GetAlert200Response", + "ListAlert200ResponseInner", + "Type", + "Type1", + "Type2", + "Type3", + "UpdateAlert200Response", + "UpdateAlertRequest", +] +# Testing code diff --git a/sendgrid/rest/api/alerts/v3/models/create_alert201_response.py b/sendgrid/rest/api/alerts/v3/models/create_alert201_response.py index 0c0fa5a8..620fc224 100644 --- a/sendgrid/rest/api/alerts/v3/models/create_alert201_response.py +++ b/sendgrid/rest/api/alerts/v3/models/create_alert201_response.py @@ -1,40 +1,40 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateAlert201Response: def __init__( - self, - created_at: Optional[int]=None, - email_to: Optional[str]=None, - frequency: Optional[str]=None, - id: Optional[int]=None, - type: Optional[str]=None, - updated_at: Optional[int]=None, - percentage: Optional[int]=None + self, + created_at: Optional[int] = None, + email_to: Optional[str] = None, + frequency: Optional[str] = None, + id: Optional[int] = None, + type: Optional[str] = None, + updated_at: Optional[int] = None, + percentage: Optional[int] = None, ): - self.created_at=created_at - self.email_to=email_to - self.frequency=frequency - self.id=id - self.type=type - self.updated_at=updated_at - self.percentage=percentage + self.created_at = created_at + self.email_to = email_to + self.frequency = frequency + self.id = id + self.type = type + self.updated_at = updated_at + self.percentage = percentage def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "created_at": self.created_at, - "email_to": self.email_to, - "frequency": self.frequency, - "id": self.id, - "type": self.type, - "updated_at": self.updated_at, - "percentage": self.percentage - }.items() if value is not None} + "created_at": self.created_at, + "email_to": self.email_to, + "frequency": self.frequency, + "id": self.id, + "type": self.type, + "updated_at": self.updated_at, + "percentage": self.percentage, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -43,12 +43,11 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateAlert201Response( - created_at=payload.get('created_at'), - email_to=payload.get('email_to'), - frequency=payload.get('frequency'), - id=payload.get('id'), - type=payload.get('type'), - updated_at=payload.get('updated_at'), - percentage=payload.get('percentage') - ) - + created_at=payload.get("created_at"), + email_to=payload.get("email_to"), + frequency=payload.get("frequency"), + id=payload.get("id"), + type=payload.get("type"), + updated_at=payload.get("updated_at"), + percentage=payload.get("percentage"), + ) diff --git a/sendgrid/rest/api/alerts/v3/models/create_alert_request.py b/sendgrid/rest/api/alerts/v3/models/create_alert_request.py index d968c461..7ff0c3d7 100644 --- a/sendgrid/rest/api/alerts/v3/models/create_alert_request.py +++ b/sendgrid/rest/api/alerts/v3/models/create_alert_request.py @@ -1,32 +1,32 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.alerts.v3.models.type import Type - class CreateAlertRequest: def __init__( - self, - type: Optional[Type]=None, - email_to: Optional[str]=None, - frequency: Optional[str]=None, - percentage: Optional[int]=None + self, + type: Optional[Type] = None, + email_to: Optional[str] = None, + frequency: Optional[str] = None, + percentage: Optional[int] = None, ): - self.type=type - self.email_to=email_to - self.frequency=frequency - self.percentage=percentage + self.type = type + self.email_to = email_to + self.frequency = frequency + self.percentage = percentage def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "type": self.type, - "email_to": self.email_to, - "frequency": self.frequency, - "percentage": self.percentage - }.items() if value is not None} + "type": self.type, + "email_to": self.email_to, + "frequency": self.frequency, + "percentage": self.percentage, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -35,9 +35,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateAlertRequest( - type=payload.get('type'), - email_to=payload.get('email_to'), - frequency=payload.get('frequency'), - percentage=payload.get('percentage') - ) - + type=payload.get("type"), + email_to=payload.get("email_to"), + frequency=payload.get("frequency"), + percentage=payload.get("percentage"), + ) diff --git a/sendgrid/rest/api/alerts/v3/models/error_response.py b/sendgrid/rest/api/alerts/v3/models/error_response.py index 1df985ce..3d092049 100644 --- a/sendgrid/rest/api/alerts/v3/models/error_response.py +++ b/sendgrid/rest/api/alerts/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.alerts.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.alerts.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/alerts/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/alerts/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/alerts/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/alerts/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/alerts/v3/models/get_alert200_response.py b/sendgrid/rest/api/alerts/v3/models/get_alert200_response.py index 3b1a3da0..a4d85560 100644 --- a/sendgrid/rest/api/alerts/v3/models/get_alert200_response.py +++ b/sendgrid/rest/api/alerts/v3/models/get_alert200_response.py @@ -1,41 +1,41 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.alerts.v3.models.type2 import Type2 - class GetAlert200Response: def __init__( - self, - created_at: Optional[int]=None, - email_to: Optional[str]=None, - frequency: Optional[str]=None, - id: Optional[int]=None, - type: Optional[Type2]=None, - updated_at: Optional[int]=None, - percentage: Optional[int]=None + self, + created_at: Optional[int] = None, + email_to: Optional[str] = None, + frequency: Optional[str] = None, + id: Optional[int] = None, + type: Optional[Type2] = None, + updated_at: Optional[int] = None, + percentage: Optional[int] = None, ): - self.created_at=created_at - self.email_to=email_to - self.frequency=frequency - self.id=id - self.type=type - self.updated_at=updated_at - self.percentage=percentage + self.created_at = created_at + self.email_to = email_to + self.frequency = frequency + self.id = id + self.type = type + self.updated_at = updated_at + self.percentage = percentage def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "created_at": self.created_at, - "email_to": self.email_to, - "frequency": self.frequency, - "id": self.id, - "type": self.type, - "updated_at": self.updated_at, - "percentage": self.percentage - }.items() if value is not None} + "created_at": self.created_at, + "email_to": self.email_to, + "frequency": self.frequency, + "id": self.id, + "type": self.type, + "updated_at": self.updated_at, + "percentage": self.percentage, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -44,12 +44,11 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetAlert200Response( - created_at=payload.get('created_at'), - email_to=payload.get('email_to'), - frequency=payload.get('frequency'), - id=payload.get('id'), - type=payload.get('type'), - updated_at=payload.get('updated_at'), - percentage=payload.get('percentage') - ) - + created_at=payload.get("created_at"), + email_to=payload.get("email_to"), + frequency=payload.get("frequency"), + id=payload.get("id"), + type=payload.get("type"), + updated_at=payload.get("updated_at"), + percentage=payload.get("percentage"), + ) diff --git a/sendgrid/rest/api/alerts/v3/models/list_alert200_response_inner.py b/sendgrid/rest/api/alerts/v3/models/list_alert200_response_inner.py index a80205f0..591d9135 100644 --- a/sendgrid/rest/api/alerts/v3/models/list_alert200_response_inner.py +++ b/sendgrid/rest/api/alerts/v3/models/list_alert200_response_inner.py @@ -1,41 +1,41 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.alerts.v3.models.type1 import Type1 - class ListAlert200ResponseInner: def __init__( - self, - created_at: Optional[int]=None, - email_to: Optional[str]=None, - id: Optional[int]=None, - percentage: Optional[int]=None, - type: Optional[Type1]=None, - updated_at: Optional[int]=None, - frequency: Optional[str]=None + self, + created_at: Optional[int] = None, + email_to: Optional[str] = None, + id: Optional[int] = None, + percentage: Optional[int] = None, + type: Optional[Type1] = None, + updated_at: Optional[int] = None, + frequency: Optional[str] = None, ): - self.created_at=created_at - self.email_to=email_to - self.id=id - self.percentage=percentage - self.type=type - self.updated_at=updated_at - self.frequency=frequency + self.created_at = created_at + self.email_to = email_to + self.id = id + self.percentage = percentage + self.type = type + self.updated_at = updated_at + self.frequency = frequency def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "created_at": self.created_at, - "email_to": self.email_to, - "id": self.id, - "percentage": self.percentage, - "type": self.type, - "updated_at": self.updated_at, - "frequency": self.frequency - }.items() if value is not None} + "created_at": self.created_at, + "email_to": self.email_to, + "id": self.id, + "percentage": self.percentage, + "type": self.type, + "updated_at": self.updated_at, + "frequency": self.frequency, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -44,12 +44,11 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListAlert200ResponseInner( - created_at=payload.get('created_at'), - email_to=payload.get('email_to'), - id=payload.get('id'), - percentage=payload.get('percentage'), - type=payload.get('type'), - updated_at=payload.get('updated_at'), - frequency=payload.get('frequency') - ) - + created_at=payload.get("created_at"), + email_to=payload.get("email_to"), + id=payload.get("id"), + percentage=payload.get("percentage"), + type=payload.get("type"), + updated_at=payload.get("updated_at"), + frequency=payload.get("frequency"), + ) diff --git a/sendgrid/rest/api/alerts/v3/models/type.py b/sendgrid/rest/api/alerts/v3/models/type.py index 45f193cc..8b42dd10 100644 --- a/sendgrid/rest/api/alerts/v3/models/type.py +++ b/sendgrid/rest/api/alerts/v3/models/type.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Type(Enum): - STATS_NOTIFICATION='stats_notification' - USAGE_LIMIT='usage_limit' - + STATS_NOTIFICATION = "stats_notification" + USAGE_LIMIT = "usage_limit" diff --git a/sendgrid/rest/api/alerts/v3/models/type1.py b/sendgrid/rest/api/alerts/v3/models/type1.py index 50aa9d7d..78a241e6 100644 --- a/sendgrid/rest/api/alerts/v3/models/type1.py +++ b/sendgrid/rest/api/alerts/v3/models/type1.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Type1(Enum): - USAGE_LIMIT='usage_limit' - STATS_NOTIFICATION='stats_notification' - + USAGE_LIMIT = "usage_limit" + STATS_NOTIFICATION = "stats_notification" diff --git a/sendgrid/rest/api/alerts/v3/models/type2.py b/sendgrid/rest/api/alerts/v3/models/type2.py index 53e0fda7..ab8659c7 100644 --- a/sendgrid/rest/api/alerts/v3/models/type2.py +++ b/sendgrid/rest/api/alerts/v3/models/type2.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Type2(Enum): - USAGE_LIMIT='usage_limit' - STATS_NOTIFICATION='stats_notification' - + USAGE_LIMIT = "usage_limit" + STATS_NOTIFICATION = "stats_notification" diff --git a/sendgrid/rest/api/alerts/v3/models/type3.py b/sendgrid/rest/api/alerts/v3/models/type3.py index 68c0ab09..4ee55606 100644 --- a/sendgrid/rest/api/alerts/v3/models/type3.py +++ b/sendgrid/rest/api/alerts/v3/models/type3.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Type3(Enum): - USAGE_LIMIT='usage_limit' - STATS_NOTIFICATION='stats_notification' - + USAGE_LIMIT = "usage_limit" + STATS_NOTIFICATION = "stats_notification" diff --git a/sendgrid/rest/api/alerts/v3/models/update_alert200_response.py b/sendgrid/rest/api/alerts/v3/models/update_alert200_response.py index 8a085bed..84b710fa 100644 --- a/sendgrid/rest/api/alerts/v3/models/update_alert200_response.py +++ b/sendgrid/rest/api/alerts/v3/models/update_alert200_response.py @@ -1,41 +1,41 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.alerts.v3.models.type3 import Type3 - class UpdateAlert200Response: def __init__( - self, - created_at: Optional[int]=None, - email_to: Optional[str]=None, - frequency: Optional[str]=None, - id: Optional[int]=None, - type: Optional[Type3]=None, - updated_at: Optional[int]=None, - percentage: Optional[int]=None + self, + created_at: Optional[int] = None, + email_to: Optional[str] = None, + frequency: Optional[str] = None, + id: Optional[int] = None, + type: Optional[Type3] = None, + updated_at: Optional[int] = None, + percentage: Optional[int] = None, ): - self.created_at=created_at - self.email_to=email_to - self.frequency=frequency - self.id=id - self.type=type - self.updated_at=updated_at - self.percentage=percentage + self.created_at = created_at + self.email_to = email_to + self.frequency = frequency + self.id = id + self.type = type + self.updated_at = updated_at + self.percentage = percentage def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "created_at": self.created_at, - "email_to": self.email_to, - "frequency": self.frequency, - "id": self.id, - "type": self.type, - "updated_at": self.updated_at, - "percentage": self.percentage - }.items() if value is not None} + "created_at": self.created_at, + "email_to": self.email_to, + "frequency": self.frequency, + "id": self.id, + "type": self.type, + "updated_at": self.updated_at, + "percentage": self.percentage, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -44,12 +44,11 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateAlert200Response( - created_at=payload.get('created_at'), - email_to=payload.get('email_to'), - frequency=payload.get('frequency'), - id=payload.get('id'), - type=payload.get('type'), - updated_at=payload.get('updated_at'), - percentage=payload.get('percentage') - ) - + created_at=payload.get("created_at"), + email_to=payload.get("email_to"), + frequency=payload.get("frequency"), + id=payload.get("id"), + type=payload.get("type"), + updated_at=payload.get("updated_at"), + percentage=payload.get("percentage"), + ) diff --git a/sendgrid/rest/api/alerts/v3/models/update_alert_request.py b/sendgrid/rest/api/alerts/v3/models/update_alert_request.py index f4199f4a..f73f8dea 100644 --- a/sendgrid/rest/api/alerts/v3/models/update_alert_request.py +++ b/sendgrid/rest/api/alerts/v3/models/update_alert_request.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateAlertRequest: def __init__( - self, - email_to: Optional[str]=None, - frequency: Optional[str]=None, - percentage: Optional[int]=None + self, + email_to: Optional[str] = None, + frequency: Optional[str] = None, + percentage: Optional[int] = None, ): - self.email_to=email_to - self.frequency=frequency - self.percentage=percentage + self.email_to = email_to + self.frequency = frequency + self.percentage = percentage def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "email_to": self.email_to, - "frequency": self.frequency, - "percentage": self.percentage - }.items() if value is not None} + "email_to": self.email_to, + "frequency": self.frequency, + "percentage": self.percentage, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateAlertRequest( - email_to=payload.get('email_to'), - frequency=payload.get('frequency'), - percentage=payload.get('percentage') - ) - + email_to=payload.get("email_to"), + frequency=payload.get("frequency"), + percentage=payload.get("percentage"), + ) diff --git a/sendgrid/rest/api/alerts/v3/update_alert.py b/sendgrid/rest/api/alerts/v3/update_alert.py index 2a3b1656..65ed4a0f 100644 --- a/sendgrid/rest/api/alerts/v3/update_alert.py +++ b/sendgrid/rest/api/alerts/v3/update_alert.py @@ -12,59 +12,56 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.alerts.v3.models.update_alert200_response import UpdateAlert200Response from sendgrid.rest.api.alerts.v3.models.update_alert_request import UpdateAlertRequest + class UpdateAlert: def __init__(self, client) -> None: self.client = client - + def send( self, - alert_id: int, - on_behalf_of: Optional[str] = None, - update_alert_request: Optional[UpdateAlertRequest] = None, - + alert_id: int, + on_behalf_of: Optional[str] = None, + update_alert_request: Optional[UpdateAlertRequest] = None, ): - path='/v3/alerts/{alert_id}' + path = "/v3/alerts/{alert_id}" path = path.format( - alert_id=alert_id, + alert_id=alert_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_alert_request: data = update_alert_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/api_keys/v3/__init__.py b/sendgrid/rest/api/api_keys/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/api_keys/v3/__init__.py +++ b/sendgrid/rest/api/api_keys/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/api_keys/v3/create_api_key.py b/sendgrid/rest/api/api_keys/v3/create_api_key.py index b6d5e6de..26e97a1c 100644 --- a/sendgrid/rest/api/api_keys/v3/create_api_key.py +++ b/sendgrid/rest/api/api_keys/v3/create_api_key.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.api_keys.v3.models.create_api_key201_response import CreateApiKey201Response -from sendgrid.rest.api.api_keys.v3.models.create_api_key_request import CreateApiKeyRequest +from sendgrid.rest.api.api_keys.v3.models.create_api_key_request import ( + CreateApiKeyRequest, +) + class CreateApiKey: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - create_api_key_request: Optional[CreateApiKeyRequest] = None, - + on_behalf_of: Optional[str] = None, + create_api_key_request: Optional[CreateApiKeyRequest] = None, ): - path='/v3/api_keys' + path = "/v3/api_keys" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if create_api_key_request: data = create_api_key_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/api_keys/v3/delete_api_key.py b/sendgrid/rest/api/api_keys/v3/delete_api_key.py index 904c8085..6158b285 100644 --- a/sendgrid/rest/api/api_keys/v3/delete_api_key.py +++ b/sendgrid/rest/api/api_keys/v3/delete_api_key.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteApiKey: def __init__(self, client) -> None: self.client = client - + def send( self, - api_key_id: str, - on_behalf_of: Optional[str] = None, - + api_key_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/api_keys/{api_key_id}' + path = "/v3/api_keys/{api_key_id}" path = path.format( - api_key_id=api_key_id, + api_key_id=api_key_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/api_keys/v3/get_api_key.py b/sendgrid/rest/api/api_keys/v3/get_api_key.py index ccb18df2..07ddd4e9 100644 --- a/sendgrid/rest/api/api_keys/v3/get_api_key.py +++ b/sendgrid/rest/api/api_keys/v3/get_api_key.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.api_keys.v3.models.get_api_key200_response import GetApiKey200Response + class GetApiKey: def __init__(self, client) -> None: self.client = client - + def send( self, - api_key_id: str, - on_behalf_of: Optional[str] = None, - + api_key_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/api_keys/{api_key_id}' + path = "/v3/api_keys/{api_key_id}" path = path.format( - api_key_id=api_key_id, + api_key_id=api_key_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/api_keys/v3/list_api_key.py b/sendgrid/rest/api/api_keys/v3/list_api_key.py index 02902365..2bfcab9d 100644 --- a/sendgrid/rest/api/api_keys/v3/list_api_key.py +++ b/sendgrid/rest/api/api_keys/v3/list_api_key.py @@ -12,51 +12,48 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.api_keys.v3.models.list_api_key200_response import ListApiKey200Response + class ListApiKey: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - limit: Optional[int] = None, - + on_behalf_of: Optional[str] = None, + limit: Optional[int] = None, ): - path='/v3/api_keys' + path = "/v3/api_keys" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/api_keys/v3/models/__init__.py b/sendgrid/rest/api/api_keys/v3/models/__init__.py index 7e89908c..d07b9ac1 100644 --- a/sendgrid/rest/api/api_keys/v3/models/__init__.py +++ b/sendgrid/rest/api/api_keys/v3/models/__init__.py @@ -11,17 +11,44 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.api_keys.v3.models.api_key_response import ApiKeyResponse -from sendgrid.rest.api.api_keys.v3.models.api_key_scopes_response import ApiKeyScopesResponse -from sendgrid.rest.api.api_keys.v3.models.create_api_key201_response import CreateApiKey201Response -from sendgrid.rest.api.api_keys.v3.models.create_api_key_request import CreateApiKeyRequest +from sendgrid.rest.api.api_keys.v3.models.api_key_scopes_response import ( + ApiKeyScopesResponse, +) +from sendgrid.rest.api.api_keys.v3.models.create_api_key201_response import ( + CreateApiKey201Response, +) +from sendgrid.rest.api.api_keys.v3.models.create_api_key_request import ( + CreateApiKeyRequest, +) from sendgrid.rest.api.api_keys.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.api_keys.v3.models.error_response_errors_inner import ErrorResponseErrorsInner -from sendgrid.rest.api.api_keys.v3.models.get_api_key200_response import GetApiKey200Response -from sendgrid.rest.api.api_keys.v3.models.list_api_key200_response import ListApiKey200Response -from sendgrid.rest.api.api_keys.v3.models.update_api_key_name_request import UpdateApiKeyNameRequest -from sendgrid.rest.api.api_keys.v3.models.update_api_key_request import UpdateApiKeyRequest -__all__ = [ 'ApiKeyResponse', 'ApiKeyScopesResponse', 'CreateApiKey201Response', 'CreateApiKeyRequest', 'ErrorResponse', 'ErrorResponseErrorsInner', 'GetApiKey200Response', 'ListApiKey200Response', 'UpdateApiKeyNameRequest', 'UpdateApiKeyRequest' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.api_keys.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) +from sendgrid.rest.api.api_keys.v3.models.get_api_key200_response import ( + GetApiKey200Response, +) +from sendgrid.rest.api.api_keys.v3.models.list_api_key200_response import ( + ListApiKey200Response, +) +from sendgrid.rest.api.api_keys.v3.models.update_api_key_name_request import ( + UpdateApiKeyNameRequest, +) +from sendgrid.rest.api.api_keys.v3.models.update_api_key_request import ( + UpdateApiKeyRequest, +) + +__all__ = [ + "ApiKeyResponse", + "ApiKeyScopesResponse", + "CreateApiKey201Response", + "CreateApiKeyRequest", + "ErrorResponse", + "ErrorResponseErrorsInner", + "GetApiKey200Response", + "ListApiKey200Response", + "UpdateApiKeyNameRequest", + "UpdateApiKeyRequest", +] +# Testing code diff --git a/sendgrid/rest/api/api_keys/v3/models/api_key_response.py b/sendgrid/rest/api/api_keys/v3/models/api_key_response.py index 4a3804e5..7f743812 100644 --- a/sendgrid/rest/api/api_keys/v3/models/api_key_response.py +++ b/sendgrid/rest/api/api_keys/v3/models/api_key_response.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ApiKeyResponse: - def __init__( - self, - api_key_id: Optional[str]=None, - name: Optional[str]=None - ): - self.api_key_id=api_key_id - self.name=name + def __init__(self, api_key_id: Optional[str] = None, name: Optional[str] = None): + self.api_key_id = api_key_id + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "api_key_id": self.api_key_id, - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"api_key_id": self.api_key_id, "name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ApiKeyResponse( - api_key_id=payload.get('api_key_id'), - name=payload.get('name') - ) - + api_key_id=payload.get("api_key_id"), name=payload.get("name") + ) diff --git a/sendgrid/rest/api/api_keys/v3/models/api_key_scopes_response.py b/sendgrid/rest/api/api_keys/v3/models/api_key_scopes_response.py index 02a93ee8..c5851dbe 100644 --- a/sendgrid/rest/api/api_keys/v3/models/api_key_scopes_response.py +++ b/sendgrid/rest/api/api_keys/v3/models/api_key_scopes_response.py @@ -1,28 +1,28 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ApiKeyScopesResponse: def __init__( - self, - scopes: Optional[List[str]]=None, - api_key_id: Optional[str]=None, - name: Optional[str]=None + self, + scopes: Optional[List[str]] = None, + api_key_id: Optional[str] = None, + name: Optional[str] = None, ): - self.scopes=scopes - self.api_key_id=api_key_id - self.name=name + self.scopes = scopes + self.api_key_id = api_key_id + self.name = name def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "scopes": self.scopes, - "api_key_id": self.api_key_id, - "name": self.name - }.items() if value is not None} + "scopes": self.scopes, + "api_key_id": self.api_key_id, + "name": self.name, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ApiKeyScopesResponse( - scopes=payload.get('scopes'), - api_key_id=payload.get('api_key_id'), - name=payload.get('name') - ) - + scopes=payload.get("scopes"), + api_key_id=payload.get("api_key_id"), + name=payload.get("name"), + ) diff --git a/sendgrid/rest/api/api_keys/v3/models/create_api_key201_response.py b/sendgrid/rest/api/api_keys/v3/models/create_api_key201_response.py index 15075872..7974fc95 100644 --- a/sendgrid/rest/api/api_keys/v3/models/create_api_key201_response.py +++ b/sendgrid/rest/api/api_keys/v3/models/create_api_key201_response.py @@ -1,31 +1,31 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateApiKey201Response: def __init__( - self, - api_key: Optional[str]=None, - api_key_id: Optional[str]=None, - name: Optional[str]=None, - scopes: Optional[List[str]]=None + self, + api_key: Optional[str] = None, + api_key_id: Optional[str] = None, + name: Optional[str] = None, + scopes: Optional[List[str]] = None, ): - self.api_key=api_key - self.api_key_id=api_key_id - self.name=name - self.scopes=scopes + self.api_key = api_key + self.api_key_id = api_key_id + self.name = name + self.scopes = scopes def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "api_key": self.api_key, - "api_key_id": self.api_key_id, - "name": self.name, - "scopes": self.scopes - }.items() if value is not None} + "api_key": self.api_key, + "api_key_id": self.api_key_id, + "name": self.name, + "scopes": self.scopes, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateApiKey201Response( - api_key=payload.get('api_key'), - api_key_id=payload.get('api_key_id'), - name=payload.get('name'), - scopes=payload.get('scopes') - ) - + api_key=payload.get("api_key"), + api_key_id=payload.get("api_key_id"), + name=payload.get("name"), + scopes=payload.get("scopes"), + ) diff --git a/sendgrid/rest/api/api_keys/v3/models/create_api_key_request.py b/sendgrid/rest/api/api_keys/v3/models/create_api_key_request.py index 1c96c102..35c17c3b 100644 --- a/sendgrid/rest/api/api_keys/v3/models/create_api_key_request.py +++ b/sendgrid/rest/api/api_keys/v3/models/create_api_key_request.py @@ -1,25 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateApiKeyRequest: - def __init__( - self, - name: Optional[str]=None, - scopes: Optional[List[str]]=None - ): - self.name=name - self.scopes=scopes + def __init__(self, name: Optional[str] = None, scopes: Optional[List[str]] = None): + self.name = name + self.scopes = scopes def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name, - "scopes": self.scopes - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name, "scopes": self.scopes}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateApiKeyRequest( - name=payload.get('name'), - scopes=payload.get('scopes') - ) - + name=payload.get("name"), scopes=payload.get("scopes") + ) diff --git a/sendgrid/rest/api/api_keys/v3/models/error_response.py b/sendgrid/rest/api/api_keys/v3/models/error_response.py index 8d120a9d..bd528b72 100644 --- a/sendgrid/rest/api/api_keys/v3/models/error_response.py +++ b/sendgrid/rest/api/api_keys/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.api_keys.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.api_keys.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/api_keys/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/api_keys/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/api_keys/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/api_keys/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/api_keys/v3/models/get_api_key200_response.py b/sendgrid/rest/api/api_keys/v3/models/get_api_key200_response.py index e24cc6f8..5524458c 100644 --- a/sendgrid/rest/api/api_keys/v3/models/get_api_key200_response.py +++ b/sendgrid/rest/api/api_keys/v3/models/get_api_key200_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.api_keys.v3.models.api_key_scopes_response import ApiKeyScopesResponse - +from sendgrid.rest.api.api_keys.v3.models.api_key_scopes_response import ( + ApiKeyScopesResponse, +) class GetApiKey200Response: - def __init__( - self, - result: Optional[List[ApiKeyScopesResponse]]=None - ): - self.result=result + def __init__(self, result: Optional[List[ApiKeyScopesResponse]] = None): + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetApiKey200Response( - result=payload.get('result') - ) - + return GetApiKey200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/api_keys/v3/models/list_api_key200_response.py b/sendgrid/rest/api/api_keys/v3/models/list_api_key200_response.py index 89e0123c..f166ba2a 100644 --- a/sendgrid/rest/api/api_keys/v3/models/list_api_key200_response.py +++ b/sendgrid/rest/api/api_keys/v3/models/list_api_key200_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.api_keys.v3.models.api_key_response import ApiKeyResponse - class ListApiKey200Response: - def __init__( - self, - result: Optional[List[ApiKeyResponse]]=None - ): - self.result=result + def __init__(self, result: Optional[List[ApiKeyResponse]] = None): + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListApiKey200Response( - result=payload.get('result') - ) - + return ListApiKey200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/api_keys/v3/models/update_api_key_name_request.py b/sendgrid/rest/api/api_keys/v3/models/update_api_key_name_request.py index 59cc6546..cbf12e0e 100644 --- a/sendgrid/rest/api/api_keys/v3/models/update_api_key_name_request.py +++ b/sendgrid/rest/api/api_keys/v3/models/update_api_key_name_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateApiKeyNameRequest: - def __init__( - self, - name: Optional[str]=None - ): - self.name=name + def __init__(self, name: Optional[str] = None): + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateApiKeyNameRequest( - name=payload.get('name') - ) - + return UpdateApiKeyNameRequest(name=payload.get("name")) diff --git a/sendgrid/rest/api/api_keys/v3/models/update_api_key_request.py b/sendgrid/rest/api/api_keys/v3/models/update_api_key_request.py index fce938b9..a7c04ed4 100644 --- a/sendgrid/rest/api/api_keys/v3/models/update_api_key_request.py +++ b/sendgrid/rest/api/api_keys/v3/models/update_api_key_request.py @@ -1,25 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateApiKeyRequest: - def __init__( - self, - name: Optional[str]=None, - scopes: Optional[List[str]]=None - ): - self.name=name - self.scopes=scopes + def __init__(self, name: Optional[str] = None, scopes: Optional[List[str]] = None): + self.name = name + self.scopes = scopes def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name, - "scopes": self.scopes - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name, "scopes": self.scopes}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateApiKeyRequest( - name=payload.get('name'), - scopes=payload.get('scopes') - ) - + name=payload.get("name"), scopes=payload.get("scopes") + ) diff --git a/sendgrid/rest/api/api_keys/v3/update_api_key.py b/sendgrid/rest/api/api_keys/v3/update_api_key.py index ffdd84de..a8a2faaf 100644 --- a/sendgrid/rest/api/api_keys/v3/update_api_key.py +++ b/sendgrid/rest/api/api_keys/v3/update_api_key.py @@ -12,59 +12,58 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.api_keys.v3.models.api_key_response import ApiKeyResponse -from sendgrid.rest.api.api_keys.v3.models.update_api_key_request import UpdateApiKeyRequest +from sendgrid.rest.api.api_keys.v3.models.update_api_key_request import ( + UpdateApiKeyRequest, +) + class UpdateApiKey: def __init__(self, client) -> None: self.client = client - + def send( self, - api_key_id: str, - on_behalf_of: Optional[str] = None, - update_api_key_request: Optional[UpdateApiKeyRequest] = None, - + api_key_id: str, + on_behalf_of: Optional[str] = None, + update_api_key_request: Optional[UpdateApiKeyRequest] = None, ): - path='/v3/api_keys/{api_key_id}' + path = "/v3/api_keys/{api_key_id}" path = path.format( - api_key_id=api_key_id, + api_key_id=api_key_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_api_key_request: data = update_api_key_request.to_dict() - request = Request( - method='PUT', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/api_keys/v3/update_api_key_name.py b/sendgrid/rest/api/api_keys/v3/update_api_key_name.py index 415b1593..0b0bd4fe 100644 --- a/sendgrid/rest/api/api_keys/v3/update_api_key_name.py +++ b/sendgrid/rest/api/api_keys/v3/update_api_key_name.py @@ -12,59 +12,58 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.api_keys.v3.models.api_key_response import ApiKeyResponse -from sendgrid.rest.api.api_keys.v3.models.update_api_key_name_request import UpdateApiKeyNameRequest +from sendgrid.rest.api.api_keys.v3.models.update_api_key_name_request import ( + UpdateApiKeyNameRequest, +) + class UpdateApiKeyName: def __init__(self, client) -> None: self.client = client - + def send( self, - api_key_id: str, - on_behalf_of: Optional[str] = None, - update_api_key_name_request: Optional[UpdateApiKeyNameRequest] = None, - + api_key_id: str, + on_behalf_of: Optional[str] = None, + update_api_key_name_request: Optional[UpdateApiKeyNameRequest] = None, ): - path='/v3/api_keys/{api_key_id}' + path = "/v3/api_keys/{api_key_id}" path = path.format( - api_key_id=api_key_id, + api_key_id=api_key_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_api_key_name_request: data = update_api_key_name_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/__init__.py b/sendgrid/rest/api/domain_authentication/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/domain_authentication/v3/__init__.py +++ b/sendgrid/rest/api/domain_authentication/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/domain_authentication/v3/add_ip_to_authenticated_domain.py b/sendgrid/rest/api/domain_authentication/v3/add_ip_to_authenticated_domain.py index 9389940a..338adcd4 100644 --- a/sendgrid/rest/api/domain_authentication/v3/add_ip_to_authenticated_domain.py +++ b/sendgrid/rest/api/domain_authentication/v3/add_ip_to_authenticated_domain.py @@ -12,59 +12,60 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.domain_authentication.v3.models.add_ip_to_authenticated_domain_request import AddIpToAuthenticatedDomainRequest -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf import AuthenticatedDomainSpf +from sendgrid.rest.api.domain_authentication.v3.models.add_ip_to_authenticated_domain_request import ( + AddIpToAuthenticatedDomainRequest, +) + class AddIpToAuthenticatedDomain: def __init__(self, client) -> None: self.client = client - + def send( self, - id: int, - on_behalf_of: Optional[str] = None, - add_ip_to_authenticated_domain_request: Optional[AddIpToAuthenticatedDomainRequest] = None, - + id: int, + on_behalf_of: Optional[str] = None, + add_ip_to_authenticated_domain_request: Optional[ + AddIpToAuthenticatedDomainRequest + ] = None, ): - path='/v3/whitelabel/domains/{id}/ips' + path = "/v3/whitelabel/domains/{id}/ips" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if add_ip_to_authenticated_domain_request: data = add_ip_to_authenticated_domain_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/associate_subuser_with_domain.py b/sendgrid/rest/api/domain_authentication/v3/associate_subuser_with_domain.py index 066f237f..8972b9b6 100644 --- a/sendgrid/rest/api/domain_authentication/v3/associate_subuser_with_domain.py +++ b/sendgrid/rest/api/domain_authentication/v3/associate_subuser_with_domain.py @@ -12,53 +12,52 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.domain_authentication.v3.models.associate_subuser_with_domain_request import AssociateSubuserWithDomainRequest -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf import AuthenticatedDomainSpf +from sendgrid.rest.api.domain_authentication.v3.models.associate_subuser_with_domain_request import ( + AssociateSubuserWithDomainRequest, +) + class AssociateSubuserWithDomain: def __init__(self, client) -> None: self.client = client - + def send( self, - domain_id: int, - associate_subuser_with_domain_request: Optional[AssociateSubuserWithDomainRequest] = None, - + domain_id: int, + associate_subuser_with_domain_request: Optional[ + AssociateSubuserWithDomainRequest + ] = None, ): - path='/v3/whitelabel/domains/{domain_id}/subuser' + path = "/v3/whitelabel/domains/{domain_id}/subuser" path = path.format( - domain_id=domain_id, + domain_id=domain_id, ) data = None if associate_subuser_with_domain_request: data = associate_subuser_with_domain_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/associate_subuser_with_domain_multiple.py b/sendgrid/rest/api/domain_authentication/v3/associate_subuser_with_domain_multiple.py index a0816f40..e898efd8 100644 --- a/sendgrid/rest/api/domain_authentication/v3/associate_subuser_with_domain_multiple.py +++ b/sendgrid/rest/api/domain_authentication/v3/associate_subuser_with_domain_multiple.py @@ -12,53 +12,52 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.domain_authentication.v3.models.associate_subuser_with_domain_request import AssociateSubuserWithDomainRequest -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf import AuthenticatedDomainSpf +from sendgrid.rest.api.domain_authentication.v3.models.associate_subuser_with_domain_request import ( + AssociateSubuserWithDomainRequest, +) + class AssociateSubuserWithDomainMultiple: def __init__(self, client) -> None: self.client = client - + def send( self, - domain_id: int, - associate_subuser_with_domain_request: Optional[AssociateSubuserWithDomainRequest] = None, - + domain_id: int, + associate_subuser_with_domain_request: Optional[ + AssociateSubuserWithDomainRequest + ] = None, ): - path='/v3/whitelabel/domains/{domain_id}/subuser:add' + path = "/v3/whitelabel/domains/{domain_id}/subuser:add" path = path.format( - domain_id=domain_id, + domain_id=domain_id, ) data = None if associate_subuser_with_domain_request: data = associate_subuser_with_domain_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/authenticate_domain.py b/sendgrid/rest/api/domain_authentication/v3/authenticate_domain.py index 383f2107..b46e8e69 100644 --- a/sendgrid/rest/api/domain_authentication/v3/authenticate_domain.py +++ b/sendgrid/rest/api/domain_authentication/v3/authenticate_domain.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.domain_authentication.v3.models.authenticate_domain_request import AuthenticateDomainRequest -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain import AuthenticatedDomain +from sendgrid.rest.api.domain_authentication.v3.models.authenticate_domain_request import ( + AuthenticateDomainRequest, +) + class AuthenticateDomain: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - authenticate_domain_request: Optional[AuthenticateDomainRequest] = None, - + on_behalf_of: Optional[str] = None, + authenticate_domain_request: Optional[AuthenticateDomainRequest] = None, ): - path='/v3/whitelabel/domains' + path = "/v3/whitelabel/domains" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if authenticate_domain_request: data = authenticate_domain_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/delete_authenticated_domain.py b/sendgrid/rest/api/domain_authentication/v3/delete_authenticated_domain.py index 66f80fba..0fdde88e 100644 --- a/sendgrid/rest/api/domain_authentication/v3/delete_authenticated_domain.py +++ b/sendgrid/rest/api/domain_authentication/v3/delete_authenticated_domain.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteAuthenticatedDomain: def __init__(self, client) -> None: self.client = client - + def send( self, - domain_id: str, - on_behalf_of: Optional[str] = None, - + domain_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/whitelabel/domains/{domain_id}' + path = "/v3/whitelabel/domains/{domain_id}" path = path.format( - domain_id=domain_id, + domain_id=domain_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/delete_ip_from_authenticated_domain.py b/sendgrid/rest/api/domain_authentication/v3/delete_ip_from_authenticated_domain.py index db615062..83cc8227 100644 --- a/sendgrid/rest/api/domain_authentication/v3/delete_ip_from_authenticated_domain.py +++ b/sendgrid/rest/api/domain_authentication/v3/delete_ip_from_authenticated_domain.py @@ -12,56 +12,53 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf import AuthenticatedDomainSpf + class DeleteIpFromAuthenticatedDomain: def __init__(self, client) -> None: self.client = client - + def send( self, - id: int, - ip: str, - on_behalf_of: Optional[str] = None, - + id: int, + ip: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/whitelabel/domains/{id}/ips/{ip}' + path = "/v3/whitelabel/domains/{id}/ips/{ip}" path = path.format( - id=id, - ip=ip, + id=id, + ip=ip, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/disassociate_authenticated_domain_from_user.py b/sendgrid/rest/api/domain_authentication/v3/disassociate_authenticated_domain_from_user.py index f41c511c..65c69a27 100644 --- a/sendgrid/rest/api/domain_authentication/v3/disassociate_authenticated_domain_from_user.py +++ b/sendgrid/rest/api/domain_authentication/v3/disassociate_authenticated_domain_from_user.py @@ -12,45 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated + class DisassociateAuthenticatedDomainFromUser: def __init__(self, client) -> None: self.client = client - + def send( self, - username: Optional[str] = None, - + username: Optional[str] = None, ): - path='/v3/whitelabel/domains/subuser' + path = "/v3/whitelabel/domains/subuser" data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/disassociate_subuser_from_domain.py b/sendgrid/rest/api/domain_authentication/v3/disassociate_subuser_from_domain.py index b5858cf1..ff18a693 100644 --- a/sendgrid/rest/api/domain_authentication/v3/disassociate_subuser_from_domain.py +++ b/sendgrid/rest/api/domain_authentication/v3/disassociate_subuser_from_domain.py @@ -12,49 +12,45 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated + class DisassociateSubuserFromDomain: def __init__(self, client) -> None: self.client = client - + def send( self, - domain_id: int, - username: Optional[str] = None, - + domain_id: int, + username: Optional[str] = None, ): - path='/v3/whitelabel/domains/{domain_id}/subuser' + path = "/v3/whitelabel/domains/{domain_id}/subuser" path = path.format( - domain_id=domain_id, + domain_id=domain_id, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/email_dns_record.py b/sendgrid/rest/api/domain_authentication/v3/email_dns_record.py index dcbc9fe2..04bd15e4 100644 --- a/sendgrid/rest/api/domain_authentication/v3/email_dns_record.py +++ b/sendgrid/rest/api/domain_authentication/v3/email_dns_record.py @@ -12,46 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.domain_authentication.v3.models.email_dns_record_request import EmailDnsRecordRequest +from sendgrid.rest.api.domain_authentication.v3.models.email_dns_record_request import ( + EmailDnsRecordRequest, +) + class EmailDnsRecord: def __init__(self, client) -> None: self.client = client - + def send( self, - email_dns_record_request: Optional[EmailDnsRecordRequest] = None, - + email_dns_record_request: Optional[EmailDnsRecordRequest] = None, ): - path='/v3/whitelabel/dns/email' + path = "/v3/whitelabel/dns/email" data = None if email_dns_record_request: data = email_dns_record_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/get_authenticated_domain.py b/sendgrid/rest/api/domain_authentication/v3/get_authenticated_domain.py index 3f014ab9..6f1991f3 100644 --- a/sendgrid/rest/api/domain_authentication/v3/get_authenticated_domain.py +++ b/sendgrid/rest/api/domain_authentication/v3/get_authenticated_domain.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain import AuthenticatedDomain + class GetAuthenticatedDomain: def __init__(self, client) -> None: self.client = client - + def send( self, - domain_id: str, - on_behalf_of: Optional[str] = None, - + domain_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/whitelabel/domains/{domain_id}' + path = "/v3/whitelabel/domains/{domain_id}" path = path.format( - domain_id=domain_id, + domain_id=domain_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/list_all_authenticated_domain_with_user.py b/sendgrid/rest/api/domain_authentication/v3/list_all_authenticated_domain_with_user.py index 5e5e976c..d5817219 100644 --- a/sendgrid/rest/api/domain_authentication/v3/list_all_authenticated_domain_with_user.py +++ b/sendgrid/rest/api/domain_authentication/v3/list_all_authenticated_domain_with_user.py @@ -12,45 +12,39 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner import ListAllAuthenticatedDomainWithUser200ResponseInner class ListAllAuthenticatedDomainWithUser: def __init__(self, client) -> None: self.client = client - + def send( self, - username: Optional[str] = None, - + username: Optional[str] = None, ): - path='/v3/whitelabel/domains/subuser/all' + path = "/v3/whitelabel/domains/subuser/all" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/list_authenticated_domain.py b/sendgrid/rest/api/domain_authentication/v3/list_authenticated_domain.py index 972849eb..02a0e9d8 100644 --- a/sendgrid/rest/api/domain_authentication/v3/list_authenticated_domain.py +++ b/sendgrid/rest/api/domain_authentication/v3/list_authenticated_domain.py @@ -12,55 +12,52 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.domain_authentication.v3.models.object import object + class ListAuthenticatedDomain: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - exclude_subusers: Optional[bool] = None, - username: Optional[str] = None, - domain: Optional[str] = None, - + on_behalf_of: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + exclude_subusers: Optional[bool] = None, + username: Optional[str] = None, + domain: Optional[str] = None, ): - path='/v3/whitelabel/domains' + path = "/v3/whitelabel/domains" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/list_authenticated_domain_with_user.py b/sendgrid/rest/api/domain_authentication/v3/list_authenticated_domain_with_user.py index 27936250..aef419de 100644 --- a/sendgrid/rest/api/domain_authentication/v3/list_authenticated_domain_with_user.py +++ b/sendgrid/rest/api/domain_authentication/v3/list_authenticated_domain_with_user.py @@ -12,45 +12,39 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf import AuthenticatedDomainSpf class ListAuthenticatedDomainWithUser: def __init__(self, client) -> None: self.client = client - + def send( self, - username: Optional[str] = None, - + username: Optional[str] = None, ): - path='/v3/whitelabel/domains/subuser' + path = "/v3/whitelabel/domains/subuser" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/list_default_authenticated_domain.py b/sendgrid/rest/api/domain_authentication/v3/list_default_authenticated_domain.py index 48b41fb2..45838bd5 100644 --- a/sendgrid/rest/api/domain_authentication/v3/list_default_authenticated_domain.py +++ b/sendgrid/rest/api/domain_authentication/v3/list_default_authenticated_domain.py @@ -12,51 +12,48 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.domain_authentication.v3.models.object import object + class ListDefaultAuthenticatedDomain: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - domain: Optional[str] = None, - + on_behalf_of: Optional[str] = None, + domain: Optional[str] = None, ): - path='/v3/whitelabel/domains/default' + path = "/v3/whitelabel/domains/default" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/__init__.py b/sendgrid/rest/api/domain_authentication/v3/models/__init__.py index 12d61657..dd56796a 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/__init__.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/__init__.py @@ -11,32 +11,108 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.domain_authentication.v3.models.add_ip_to_authenticated_domain_request import AddIpToAuthenticatedDomainRequest -from sendgrid.rest.api.domain_authentication.v3.models.associate_subuser_with_domain_request import AssociateSubuserWithDomainRequest -from sendgrid.rest.api.domain_authentication.v3.models.authenticate_domain_request import AuthenticateDomainRequest -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain import AuthenticatedDomain -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf import AuthenticatedDomainSpf -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns import AuthenticatedDomainSpfDns -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_dkim import AuthenticatedDomainSpfDnsDkim -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_domain_spf import AuthenticatedDomainSpfDnsDomainSpf -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_mail_server import AuthenticatedDomainSpfDnsMailServer -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_subdomain_spf import AuthenticatedDomainSpfDnsSubdomainSpf -from sendgrid.rest.api.domain_authentication.v3.models.email_dns_record400_response import EmailDnsRecord400Response -from sendgrid.rest.api.domain_authentication.v3.models.email_dns_record400_response_errors import EmailDnsRecord400ResponseErrors -from sendgrid.rest.api.domain_authentication.v3.models.email_dns_record_request import EmailDnsRecordRequest -from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner import ListAllAuthenticatedDomainWithUser200ResponseInner -from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns import ListAllAuthenticatedDomainWithUser200ResponseInnerDns -from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns_dkim1 import ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1 -from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns_mail_cname import ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname -from sendgrid.rest.api.domain_authentication.v3.models.update_authenticated_domain_request import UpdateAuthenticatedDomainRequest -from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response import ValidateAuthenticatedDomain200Response -from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results import ValidateAuthenticatedDomain200ResponseValidationResults -from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results_dkim1 import ValidateAuthenticatedDomain200ResponseValidationResultsDkim1 -from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results_mail_cname import ValidateAuthenticatedDomain200ResponseValidationResultsMailCname -from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results_spf import ValidateAuthenticatedDomain200ResponseValidationResultsSpf -from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain500_response import ValidateAuthenticatedDomain500Response -from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain500_response_errors_inner import ValidateAuthenticatedDomain500ResponseErrorsInner -__all__ = [ 'AddIpToAuthenticatedDomainRequest', 'AssociateSubuserWithDomainRequest', 'AuthenticateDomainRequest', 'AuthenticatedDomain', 'AuthenticatedDomainSpf', 'AuthenticatedDomainSpfDns', 'AuthenticatedDomainSpfDnsDkim', 'AuthenticatedDomainSpfDnsDomainSpf', 'AuthenticatedDomainSpfDnsMailServer', 'AuthenticatedDomainSpfDnsSubdomainSpf', 'EmailDnsRecord400Response', 'EmailDnsRecord400ResponseErrors', 'EmailDnsRecordRequest', 'ListAllAuthenticatedDomainWithUser200ResponseInner', 'ListAllAuthenticatedDomainWithUser200ResponseInnerDns', 'ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1', 'ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname', 'UpdateAuthenticatedDomainRequest', 'ValidateAuthenticatedDomain200Response', 'ValidateAuthenticatedDomain200ResponseValidationResults', 'ValidateAuthenticatedDomain200ResponseValidationResultsDkim1', 'ValidateAuthenticatedDomain200ResponseValidationResultsMailCname', 'ValidateAuthenticatedDomain200ResponseValidationResultsSpf', 'ValidateAuthenticatedDomain500Response', 'ValidateAuthenticatedDomain500ResponseErrorsInner' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.domain_authentication.v3.models.add_ip_to_authenticated_domain_request import ( + AddIpToAuthenticatedDomainRequest, +) +from sendgrid.rest.api.domain_authentication.v3.models.associate_subuser_with_domain_request import ( + AssociateSubuserWithDomainRequest, +) +from sendgrid.rest.api.domain_authentication.v3.models.authenticate_domain_request import ( + AuthenticateDomainRequest, +) +from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain import ( + AuthenticatedDomain, +) +from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf import ( + AuthenticatedDomainSpf, +) +from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns import ( + AuthenticatedDomainSpfDns, +) +from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_dkim import ( + AuthenticatedDomainSpfDnsDkim, +) +from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_domain_spf import ( + AuthenticatedDomainSpfDnsDomainSpf, +) +from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_mail_server import ( + AuthenticatedDomainSpfDnsMailServer, +) +from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_subdomain_spf import ( + AuthenticatedDomainSpfDnsSubdomainSpf, +) +from sendgrid.rest.api.domain_authentication.v3.models.email_dns_record400_response import ( + EmailDnsRecord400Response, +) +from sendgrid.rest.api.domain_authentication.v3.models.email_dns_record400_response_errors import ( + EmailDnsRecord400ResponseErrors, +) +from sendgrid.rest.api.domain_authentication.v3.models.email_dns_record_request import ( + EmailDnsRecordRequest, +) +from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner import ( + ListAllAuthenticatedDomainWithUser200ResponseInner, +) +from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns import ( + ListAllAuthenticatedDomainWithUser200ResponseInnerDns, +) +from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns_dkim1 import ( + ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1, +) +from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns_mail_cname import ( + ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname, +) +from sendgrid.rest.api.domain_authentication.v3.models.update_authenticated_domain_request import ( + UpdateAuthenticatedDomainRequest, +) +from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response import ( + ValidateAuthenticatedDomain200Response, +) +from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results import ( + ValidateAuthenticatedDomain200ResponseValidationResults, +) +from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results_dkim1 import ( + ValidateAuthenticatedDomain200ResponseValidationResultsDkim1, +) +from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results_mail_cname import ( + ValidateAuthenticatedDomain200ResponseValidationResultsMailCname, +) +from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results_spf import ( + ValidateAuthenticatedDomain200ResponseValidationResultsSpf, +) +from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain500_response import ( + ValidateAuthenticatedDomain500Response, +) +from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain500_response_errors_inner import ( + ValidateAuthenticatedDomain500ResponseErrorsInner, +) + +__all__ = [ + "AddIpToAuthenticatedDomainRequest", + "AssociateSubuserWithDomainRequest", + "AuthenticateDomainRequest", + "AuthenticatedDomain", + "AuthenticatedDomainSpf", + "AuthenticatedDomainSpfDns", + "AuthenticatedDomainSpfDnsDkim", + "AuthenticatedDomainSpfDnsDomainSpf", + "AuthenticatedDomainSpfDnsMailServer", + "AuthenticatedDomainSpfDnsSubdomainSpf", + "EmailDnsRecord400Response", + "EmailDnsRecord400ResponseErrors", + "EmailDnsRecordRequest", + "ListAllAuthenticatedDomainWithUser200ResponseInner", + "ListAllAuthenticatedDomainWithUser200ResponseInnerDns", + "ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1", + "ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname", + "UpdateAuthenticatedDomainRequest", + "ValidateAuthenticatedDomain200Response", + "ValidateAuthenticatedDomain200ResponseValidationResults", + "ValidateAuthenticatedDomain200ResponseValidationResultsDkim1", + "ValidateAuthenticatedDomain200ResponseValidationResultsMailCname", + "ValidateAuthenticatedDomain200ResponseValidationResultsSpf", + "ValidateAuthenticatedDomain500Response", + "ValidateAuthenticatedDomain500ResponseErrorsInner", +] +# Testing code diff --git a/sendgrid/rest/api/domain_authentication/v3/models/add_ip_to_authenticated_domain_request.py b/sendgrid/rest/api/domain_authentication/v3/models/add_ip_to_authenticated_domain_request.py index ed28cf6a..47d55699 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/add_ip_to_authenticated_domain_request.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/add_ip_to_authenticated_domain_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AddIpToAuthenticatedDomainRequest: - def __init__( - self, - ip: Optional[str]=None - ): - self.ip=ip + def __init__(self, ip: Optional[str] = None): + self.ip = ip def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ip": self.ip - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ip": self.ip}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AddIpToAuthenticatedDomainRequest( - ip=payload.get('ip') - ) - + return AddIpToAuthenticatedDomainRequest(ip=payload.get("ip")) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/associate_subuser_with_domain_request.py b/sendgrid/rest/api/domain_authentication/v3/models/associate_subuser_with_domain_request.py index a32d9b37..9b373203 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/associate_subuser_with_domain_request.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/associate_subuser_with_domain_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AssociateSubuserWithDomainRequest: - def __init__( - self, - username: Optional[str]=None - ): - self.username=username + def __init__(self, username: Optional[str] = None): + self.username = username def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "username": self.username - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"username": self.username}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AssociateSubuserWithDomainRequest( - username=payload.get('username') - ) - + return AssociateSubuserWithDomainRequest(username=payload.get("username")) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/authenticate_domain_request.py b/sendgrid/rest/api/domain_authentication/v3/models/authenticate_domain_request.py index 9072babf..0eea54e5 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/authenticate_domain_request.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/authenticate_domain_request.py @@ -1,46 +1,46 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AuthenticateDomainRequest: def __init__( - self, - domain: Optional[str]=None, - subdomain: Optional[str]=None, - username: Optional[str]=None, - ips: Optional[List[str]]=None, - custom_spf: Optional[bool]=None, - default: Optional[bool]=None, - automatic_security: Optional[bool]=None, - custom_dkim_selector: Optional[str]=None, - region: Optional[str]=None + self, + domain: Optional[str] = None, + subdomain: Optional[str] = None, + username: Optional[str] = None, + ips: Optional[List[str]] = None, + custom_spf: Optional[bool] = None, + default: Optional[bool] = None, + automatic_security: Optional[bool] = None, + custom_dkim_selector: Optional[str] = None, + region: Optional[str] = None, ): - self.domain=domain - self.subdomain=subdomain - self.username=username - self.ips=ips - self.custom_spf=custom_spf - self.default=default - self.automatic_security=automatic_security - self.custom_dkim_selector=custom_dkim_selector - self.region=region + self.domain = domain + self.subdomain = subdomain + self.username = username + self.ips = ips + self.custom_spf = custom_spf + self.default = default + self.automatic_security = automatic_security + self.custom_dkim_selector = custom_dkim_selector + self.region = region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "domain": self.domain, - "subdomain": self.subdomain, - "username": self.username, - "ips": self.ips, - "custom_spf": self.custom_spf, - "default": self.default, - "automatic_security": self.automatic_security, - "custom_dkim_selector": self.custom_dkim_selector, - "region": self.region - }.items() if value is not None} + "domain": self.domain, + "subdomain": self.subdomain, + "username": self.username, + "ips": self.ips, + "custom_spf": self.custom_spf, + "default": self.default, + "automatic_security": self.automatic_security, + "custom_dkim_selector": self.custom_dkim_selector, + "region": self.region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -49,14 +49,13 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AuthenticateDomainRequest( - domain=payload.get('domain'), - subdomain=payload.get('subdomain'), - username=payload.get('username'), - ips=payload.get('ips'), - custom_spf=payload.get('custom_spf'), - default=payload.get('default'), - automatic_security=payload.get('automatic_security'), - custom_dkim_selector=payload.get('custom_dkim_selector'), - region=payload.get('region') - ) - + domain=payload.get("domain"), + subdomain=payload.get("subdomain"), + username=payload.get("username"), + ips=payload.get("ips"), + custom_spf=payload.get("custom_spf"), + default=payload.get("default"), + automatic_security=payload.get("automatic_security"), + custom_dkim_selector=payload.get("custom_dkim_selector"), + region=payload.get("region"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain.py b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain.py index 4f784f33..b64cd0e0 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain.py @@ -1,56 +1,58 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns import ListAllAuthenticatedDomainWithUser200ResponseInnerDns - +from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns import ( + ListAllAuthenticatedDomainWithUser200ResponseInnerDns, +) class AuthenticatedDomain: def __init__( - self, - id: Optional[float]=None, - user_id: Optional[float]=None, - subdomain: Optional[str]=None, - domain: Optional[str]=None, - username: Optional[str]=None, - ips: Optional[List[str]]=None, - custom_spf: Optional[bool]=None, - default: Optional[bool]=None, - legacy: Optional[bool]=None, - automatic_security: Optional[bool]=None, - valid: Optional[bool]=None, - dns: Optional[ListAllAuthenticatedDomainWithUser200ResponseInnerDns]=None + self, + id: Optional[float] = None, + user_id: Optional[float] = None, + subdomain: Optional[str] = None, + domain: Optional[str] = None, + username: Optional[str] = None, + ips: Optional[List[str]] = None, + custom_spf: Optional[bool] = None, + default: Optional[bool] = None, + legacy: Optional[bool] = None, + automatic_security: Optional[bool] = None, + valid: Optional[bool] = None, + dns: Optional[ListAllAuthenticatedDomainWithUser200ResponseInnerDns] = None, ): - self.id=id - self.user_id=user_id - self.subdomain=subdomain - self.domain=domain - self.username=username - self.ips=ips - self.custom_spf=custom_spf - self.default=default - self.legacy=legacy - self.automatic_security=automatic_security - self.valid=valid - self.dns=dns + self.id = id + self.user_id = user_id + self.subdomain = subdomain + self.domain = domain + self.username = username + self.ips = ips + self.custom_spf = custom_spf + self.default = default + self.legacy = legacy + self.automatic_security = automatic_security + self.valid = valid + self.dns = dns def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "user_id": self.user_id, - "subdomain": self.subdomain, - "domain": self.domain, - "username": self.username, - "ips": self.ips, - "custom_spf": self.custom_spf, - "default": self.default, - "legacy": self.legacy, - "automatic_security": self.automatic_security, - "valid": self.valid, - "dns": self.dns - }.items() if value is not None} + "id": self.id, + "user_id": self.user_id, + "subdomain": self.subdomain, + "domain": self.domain, + "username": self.username, + "ips": self.ips, + "custom_spf": self.custom_spf, + "default": self.default, + "legacy": self.legacy, + "automatic_security": self.automatic_security, + "valid": self.valid, + "dns": self.dns, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -59,17 +61,16 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AuthenticatedDomain( - id=payload.get('id'), - user_id=payload.get('user_id'), - subdomain=payload.get('subdomain'), - domain=payload.get('domain'), - username=payload.get('username'), - ips=payload.get('ips'), - custom_spf=payload.get('custom_spf'), - default=payload.get('default'), - legacy=payload.get('legacy'), - automatic_security=payload.get('automatic_security'), - valid=payload.get('valid'), - dns=payload.get('dns') - ) - + id=payload.get("id"), + user_id=payload.get("user_id"), + subdomain=payload.get("subdomain"), + domain=payload.get("domain"), + username=payload.get("username"), + ips=payload.get("ips"), + custom_spf=payload.get("custom_spf"), + default=payload.get("default"), + legacy=payload.get("legacy"), + automatic_security=payload.get("automatic_security"), + valid=payload.get("valid"), + dns=payload.get("dns"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf.py b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf.py index 03f602c6..f1dc2b08 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf.py @@ -1,56 +1,58 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns import AuthenticatedDomainSpfDns - +from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns import ( + AuthenticatedDomainSpfDns, +) class AuthenticatedDomainSpf: def __init__( - self, - id: Optional[int]=None, - domain: Optional[str]=None, - subdomain: Optional[str]=None, - username: Optional[str]=None, - user_id: Optional[int]=None, - ips: Optional[List[object]]=None, - custom_spf: Optional[bool]=None, - default: Optional[bool]=None, - legacy: Optional[bool]=None, - automatic_security: Optional[bool]=None, - valid: Optional[bool]=None, - dns: Optional[AuthenticatedDomainSpfDns]=None + self, + id: Optional[int] = None, + domain: Optional[str] = None, + subdomain: Optional[str] = None, + username: Optional[str] = None, + user_id: Optional[int] = None, + ips: Optional[List[object]] = None, + custom_spf: Optional[bool] = None, + default: Optional[bool] = None, + legacy: Optional[bool] = None, + automatic_security: Optional[bool] = None, + valid: Optional[bool] = None, + dns: Optional[AuthenticatedDomainSpfDns] = None, ): - self.id=id - self.domain=domain - self.subdomain=subdomain - self.username=username - self.user_id=user_id - self.ips=ips - self.custom_spf=custom_spf - self.default=default - self.legacy=legacy - self.automatic_security=automatic_security - self.valid=valid - self.dns=dns + self.id = id + self.domain = domain + self.subdomain = subdomain + self.username = username + self.user_id = user_id + self.ips = ips + self.custom_spf = custom_spf + self.default = default + self.legacy = legacy + self.automatic_security = automatic_security + self.valid = valid + self.dns = dns def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "domain": self.domain, - "subdomain": self.subdomain, - "username": self.username, - "user_id": self.user_id, - "ips": self.ips, - "custom_spf": self.custom_spf, - "default": self.default, - "legacy": self.legacy, - "automatic_security": self.automatic_security, - "valid": self.valid, - "dns": self.dns - }.items() if value is not None} + "id": self.id, + "domain": self.domain, + "subdomain": self.subdomain, + "username": self.username, + "user_id": self.user_id, + "ips": self.ips, + "custom_spf": self.custom_spf, + "default": self.default, + "legacy": self.legacy, + "automatic_security": self.automatic_security, + "valid": self.valid, + "dns": self.dns, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -59,17 +61,16 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AuthenticatedDomainSpf( - id=payload.get('id'), - domain=payload.get('domain'), - subdomain=payload.get('subdomain'), - username=payload.get('username'), - user_id=payload.get('user_id'), - ips=payload.get('ips'), - custom_spf=payload.get('custom_spf'), - default=payload.get('default'), - legacy=payload.get('legacy'), - automatic_security=payload.get('automatic_security'), - valid=payload.get('valid'), - dns=payload.get('dns') - ) - + id=payload.get("id"), + domain=payload.get("domain"), + subdomain=payload.get("subdomain"), + username=payload.get("username"), + user_id=payload.get("user_id"), + ips=payload.get("ips"), + custom_spf=payload.get("custom_spf"), + default=payload.get("default"), + legacy=payload.get("legacy"), + automatic_security=payload.get("automatic_security"), + valid=payload.get("valid"), + dns=payload.get("dns"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns.py b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns.py index 67915e3d..756e3c42 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns.py @@ -1,35 +1,43 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_dkim import AuthenticatedDomainSpfDnsDkim -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_domain_spf import AuthenticatedDomainSpfDnsDomainSpf -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_mail_server import AuthenticatedDomainSpfDnsMailServer -from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_subdomain_spf import AuthenticatedDomainSpfDnsSubdomainSpf - +from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_dkim import ( + AuthenticatedDomainSpfDnsDkim, +) +from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_domain_spf import ( + AuthenticatedDomainSpfDnsDomainSpf, +) +from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_mail_server import ( + AuthenticatedDomainSpfDnsMailServer, +) +from sendgrid.rest.api.domain_authentication.v3.models.authenticated_domain_spf_dns_subdomain_spf import ( + AuthenticatedDomainSpfDnsSubdomainSpf, +) class AuthenticatedDomainSpfDns: def __init__( - self, - mail_server: Optional[AuthenticatedDomainSpfDnsMailServer]=None, - subdomain_spf: Optional[AuthenticatedDomainSpfDnsSubdomainSpf]=None, - domain_spf: Optional[AuthenticatedDomainSpfDnsDomainSpf]=None, - dkim: Optional[AuthenticatedDomainSpfDnsDkim]=None + self, + mail_server: Optional[AuthenticatedDomainSpfDnsMailServer] = None, + subdomain_spf: Optional[AuthenticatedDomainSpfDnsSubdomainSpf] = None, + domain_spf: Optional[AuthenticatedDomainSpfDnsDomainSpf] = None, + dkim: Optional[AuthenticatedDomainSpfDnsDkim] = None, ): - self.mail_server=mail_server - self.subdomain_spf=subdomain_spf - self.domain_spf=domain_spf - self.dkim=dkim + self.mail_server = mail_server + self.subdomain_spf = subdomain_spf + self.domain_spf = domain_spf + self.dkim = dkim def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "mail_server": self.mail_server, - "subdomain_spf": self.subdomain_spf, - "domain_spf": self.domain_spf, - "dkim": self.dkim - }.items() if value is not None} + "mail_server": self.mail_server, + "subdomain_spf": self.subdomain_spf, + "domain_spf": self.domain_spf, + "dkim": self.dkim, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -38,9 +46,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AuthenticatedDomainSpfDns( - mail_server=payload.get('mail_server'), - subdomain_spf=payload.get('subdomain_spf'), - domain_spf=payload.get('domain_spf'), - dkim=payload.get('dkim') - ) - + mail_server=payload.get("mail_server"), + subdomain_spf=payload.get("subdomain_spf"), + domain_spf=payload.get("domain_spf"), + dkim=payload.get("dkim"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_dkim.py b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_dkim.py index 08a2df96..498da59f 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_dkim.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_dkim.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AuthenticatedDomainSpfDnsDkim: def __init__( - self, - host: Optional[str]=None, - type: Optional[str]=None, - data: Optional[str]=None, - valid: Optional[bool]=None + self, + host: Optional[str] = None, + type: Optional[str] = None, + data: Optional[str] = None, + valid: Optional[bool] = None, ): - self.host=host - self.type=type - self.data=data - self.valid=valid + self.host = host + self.type = type + self.data = data + self.valid = valid def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "host": self.host, - "type": self.type, - "data": self.data, - "valid": self.valid - }.items() if value is not None} + "host": self.host, + "type": self.type, + "data": self.data, + "valid": self.valid, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AuthenticatedDomainSpfDnsDkim( - host=payload.get('host'), - type=payload.get('type'), - data=payload.get('data'), - valid=payload.get('valid') - ) - + host=payload.get("host"), + type=payload.get("type"), + data=payload.get("data"), + valid=payload.get("valid"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_domain_spf.py b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_domain_spf.py index 06bed705..6e3c1c45 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_domain_spf.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_domain_spf.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AuthenticatedDomainSpfDnsDomainSpf: def __init__( - self, - host: Optional[str]=None, - type: Optional[str]=None, - data: Optional[str]=None, - valid: Optional[bool]=None + self, + host: Optional[str] = None, + type: Optional[str] = None, + data: Optional[str] = None, + valid: Optional[bool] = None, ): - self.host=host - self.type=type - self.data=data - self.valid=valid + self.host = host + self.type = type + self.data = data + self.valid = valid def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "host": self.host, - "type": self.type, - "data": self.data, - "valid": self.valid - }.items() if value is not None} + "host": self.host, + "type": self.type, + "data": self.data, + "valid": self.valid, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AuthenticatedDomainSpfDnsDomainSpf( - host=payload.get('host'), - type=payload.get('type'), - data=payload.get('data'), - valid=payload.get('valid') - ) - + host=payload.get("host"), + type=payload.get("type"), + data=payload.get("data"), + valid=payload.get("valid"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_mail_server.py b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_mail_server.py index 24139497..5f843aee 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_mail_server.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_mail_server.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AuthenticatedDomainSpfDnsMailServer: def __init__( - self, - host: Optional[str]=None, - type: Optional[str]=None, - data: Optional[str]=None, - valid: Optional[bool]=None + self, + host: Optional[str] = None, + type: Optional[str] = None, + data: Optional[str] = None, + valid: Optional[bool] = None, ): - self.host=host - self.type=type - self.data=data - self.valid=valid + self.host = host + self.type = type + self.data = data + self.valid = valid def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "host": self.host, - "type": self.type, - "data": self.data, - "valid": self.valid - }.items() if value is not None} + "host": self.host, + "type": self.type, + "data": self.data, + "valid": self.valid, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AuthenticatedDomainSpfDnsMailServer( - host=payload.get('host'), - type=payload.get('type'), - data=payload.get('data'), - valid=payload.get('valid') - ) - + host=payload.get("host"), + type=payload.get("type"), + data=payload.get("data"), + valid=payload.get("valid"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_subdomain_spf.py b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_subdomain_spf.py index 345e3bc0..24c3061d 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_subdomain_spf.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/authenticated_domain_spf_dns_subdomain_spf.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AuthenticatedDomainSpfDnsSubdomainSpf: def __init__( - self, - host: Optional[str]=None, - type: Optional[str]=None, - data: Optional[str]=None, - valid: Optional[bool]=None + self, + host: Optional[str] = None, + type: Optional[str] = None, + data: Optional[str] = None, + valid: Optional[bool] = None, ): - self.host=host - self.type=type - self.data=data - self.valid=valid + self.host = host + self.type = type + self.data = data + self.valid = valid def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "host": self.host, - "type": self.type, - "data": self.data, - "valid": self.valid - }.items() if value is not None} + "host": self.host, + "type": self.type, + "data": self.data, + "valid": self.valid, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AuthenticatedDomainSpfDnsSubdomainSpf( - host=payload.get('host'), - type=payload.get('type'), - data=payload.get('data'), - valid=payload.get('valid') - ) - + host=payload.get("host"), + type=payload.get("type"), + data=payload.get("data"), + valid=payload.get("valid"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/email_dns_record400_response.py b/sendgrid/rest/api/domain_authentication/v3/models/email_dns_record400_response.py index 217de7a7..645aff93 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/email_dns_record400_response.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/email_dns_record400_response.py @@ -1,23 +1,20 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.domain_authentication.v3.models.email_dns_record400_response_errors import EmailDnsRecord400ResponseErrors - +from sendgrid.rest.api.domain_authentication.v3.models.email_dns_record400_response_errors import ( + EmailDnsRecord400ResponseErrors, +) class EmailDnsRecord400Response: - def __init__( - self, - errors: Optional[EmailDnsRecord400ResponseErrors]=None - ): - self.errors=errors + def __init__(self, errors: Optional[EmailDnsRecord400ResponseErrors] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return EmailDnsRecord400Response( - errors=payload.get('errors') - ) - + return EmailDnsRecord400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/email_dns_record400_response_errors.py b/sendgrid/rest/api/domain_authentication/v3/models/email_dns_record400_response_errors.py index ed29fe48..d8000638 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/email_dns_record400_response_errors.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/email_dns_record400_response_errors.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class EmailDnsRecord400ResponseErrors: - def __init__( - self, - error: Optional[str]=None, - field: Optional[str]=None - ): - self.error=error - self.field=field + def __init__(self, error: Optional[str] = None, field: Optional[str] = None): + self.error = error + self.field = field def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "error": self.error, - "field": self.field - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"error": self.error, "field": self.field}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return EmailDnsRecord400ResponseErrors( - error=payload.get('error'), - field=payload.get('field') - ) - + error=payload.get("error"), field=payload.get("field") + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/email_dns_record_request.py b/sendgrid/rest/api/domain_authentication/v3/models/email_dns_record_request.py index 11a0037c..ac17c6c4 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/email_dns_record_request.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/email_dns_record_request.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class EmailDnsRecordRequest: def __init__( - self, - link_id: Optional[int]=None, - domain_id: Optional[int]=None, - email: Optional[str]=None, - message: Optional[str]=None + self, + link_id: Optional[int] = None, + domain_id: Optional[int] = None, + email: Optional[str] = None, + message: Optional[str] = None, ): - self.link_id=link_id - self.domain_id=domain_id - self.email=email - self.message=message + self.link_id = link_id + self.domain_id = domain_id + self.email = email + self.message = message def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "link_id": self.link_id, - "domain_id": self.domain_id, - "email": self.email, - "message": self.message - }.items() if value is not None} + "link_id": self.link_id, + "domain_id": self.domain_id, + "email": self.email, + "message": self.message, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return EmailDnsRecordRequest( - link_id=payload.get('link_id'), - domain_id=payload.get('domain_id'), - email=payload.get('email'), - message=payload.get('message') - ) - + link_id=payload.get("link_id"), + domain_id=payload.get("domain_id"), + email=payload.get("email"), + message=payload.get("message"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner.py b/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner.py index bda08635..71e3aebd 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner.py @@ -1,56 +1,58 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns import ListAllAuthenticatedDomainWithUser200ResponseInnerDns - +from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns import ( + ListAllAuthenticatedDomainWithUser200ResponseInnerDns, +) class ListAllAuthenticatedDomainWithUser200ResponseInner: def __init__( - self, - id: Optional[float]=None, - user_id: Optional[float]=None, - subdomain: Optional[str]=None, - domain: Optional[str]=None, - username: Optional[str]=None, - ips: Optional[List[str]]=None, - custom_spf: Optional[bool]=None, - default: Optional[bool]=None, - legacy: Optional[bool]=None, - automatic_security: Optional[bool]=None, - valid: Optional[bool]=None, - dns: Optional[ListAllAuthenticatedDomainWithUser200ResponseInnerDns]=None + self, + id: Optional[float] = None, + user_id: Optional[float] = None, + subdomain: Optional[str] = None, + domain: Optional[str] = None, + username: Optional[str] = None, + ips: Optional[List[str]] = None, + custom_spf: Optional[bool] = None, + default: Optional[bool] = None, + legacy: Optional[bool] = None, + automatic_security: Optional[bool] = None, + valid: Optional[bool] = None, + dns: Optional[ListAllAuthenticatedDomainWithUser200ResponseInnerDns] = None, ): - self.id=id - self.user_id=user_id - self.subdomain=subdomain - self.domain=domain - self.username=username - self.ips=ips - self.custom_spf=custom_spf - self.default=default - self.legacy=legacy - self.automatic_security=automatic_security - self.valid=valid - self.dns=dns + self.id = id + self.user_id = user_id + self.subdomain = subdomain + self.domain = domain + self.username = username + self.ips = ips + self.custom_spf = custom_spf + self.default = default + self.legacy = legacy + self.automatic_security = automatic_security + self.valid = valid + self.dns = dns def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "user_id": self.user_id, - "subdomain": self.subdomain, - "domain": self.domain, - "username": self.username, - "ips": self.ips, - "custom_spf": self.custom_spf, - "default": self.default, - "legacy": self.legacy, - "automatic_security": self.automatic_security, - "valid": self.valid, - "dns": self.dns - }.items() if value is not None} + "id": self.id, + "user_id": self.user_id, + "subdomain": self.subdomain, + "domain": self.domain, + "username": self.username, + "ips": self.ips, + "custom_spf": self.custom_spf, + "default": self.default, + "legacy": self.legacy, + "automatic_security": self.automatic_security, + "valid": self.valid, + "dns": self.dns, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -59,17 +61,16 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListAllAuthenticatedDomainWithUser200ResponseInner( - id=payload.get('id'), - user_id=payload.get('user_id'), - subdomain=payload.get('subdomain'), - domain=payload.get('domain'), - username=payload.get('username'), - ips=payload.get('ips'), - custom_spf=payload.get('custom_spf'), - default=payload.get('default'), - legacy=payload.get('legacy'), - automatic_security=payload.get('automatic_security'), - valid=payload.get('valid'), - dns=payload.get('dns') - ) - + id=payload.get("id"), + user_id=payload.get("user_id"), + subdomain=payload.get("subdomain"), + domain=payload.get("domain"), + username=payload.get("username"), + ips=payload.get("ips"), + custom_spf=payload.get("custom_spf"), + default=payload.get("default"), + legacy=payload.get("legacy"), + automatic_security=payload.get("automatic_security"), + valid=payload.get("valid"), + dns=payload.get("dns"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner_dns.py b/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner_dns.py index 75449dc7..7310d31c 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner_dns.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner_dns.py @@ -1,30 +1,40 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns_dkim1 import ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1 -from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns_mail_cname import ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname - +from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns_dkim1 import ( + ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1, +) +from sendgrid.rest.api.domain_authentication.v3.models.list_all_authenticated_domain_with_user200_response_inner_dns_mail_cname import ( + ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname, +) class ListAllAuthenticatedDomainWithUser200ResponseInnerDns: def __init__( - self, - mail_cname: Optional[ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname]=None, - dkim1: Optional[ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1]=None, - dkim2: Optional[ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1]=None + self, + mail_cname: Optional[ + ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname + ] = None, + dkim1: Optional[ + ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1 + ] = None, + dkim2: Optional[ + ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1 + ] = None, ): - self.mail_cname=mail_cname - self.dkim1=dkim1 - self.dkim2=dkim2 + self.mail_cname = mail_cname + self.dkim1 = dkim1 + self.dkim2 = dkim2 def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "mail_cname": self.mail_cname, - "dkim1": self.dkim1, - "dkim2": self.dkim2 - }.items() if value is not None} + "mail_cname": self.mail_cname, + "dkim1": self.dkim1, + "dkim2": self.dkim2, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -33,8 +43,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListAllAuthenticatedDomainWithUser200ResponseInnerDns( - mail_cname=payload.get('mail_cname'), - dkim1=payload.get('dkim1'), - dkim2=payload.get('dkim2') - ) - + mail_cname=payload.get("mail_cname"), + dkim1=payload.get("dkim1"), + dkim2=payload.get("dkim2"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner_dns_dkim1.py b/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner_dns_dkim1.py index d6cafd7d..c386dfef 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner_dns_dkim1.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner_dns_dkim1.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1: def __init__( - self, - valid: Optional[bool]=None, - type: Optional[str]=None, - host: Optional[str]=None, - data: Optional[str]=None + self, + valid: Optional[bool] = None, + type: Optional[str] = None, + host: Optional[str] = None, + data: Optional[str] = None, ): - self.valid=valid - self.type=type - self.host=host - self.data=data + self.valid = valid + self.type = type + self.host = host + self.data = data def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "valid": self.valid, - "type": self.type, - "host": self.host, - "data": self.data - }.items() if value is not None} + "valid": self.valid, + "type": self.type, + "host": self.host, + "data": self.data, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1( - valid=payload.get('valid'), - type=payload.get('type'), - host=payload.get('host'), - data=payload.get('data') - ) - + valid=payload.get("valid"), + type=payload.get("type"), + host=payload.get("host"), + data=payload.get("data"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner_dns_mail_cname.py b/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner_dns_mail_cname.py index cdf2347d..264e1309 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner_dns_mail_cname.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/list_all_authenticated_domain_with_user200_response_inner_dns_mail_cname.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname: def __init__( - self, - valid: Optional[bool]=None, - type: Optional[str]=None, - host: Optional[str]=None, - data: Optional[str]=None + self, + valid: Optional[bool] = None, + type: Optional[str] = None, + host: Optional[str] = None, + data: Optional[str] = None, ): - self.valid=valid - self.type=type - self.host=host - self.data=data + self.valid = valid + self.type = type + self.host = host + self.data = data def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "valid": self.valid, - "type": self.type, - "host": self.host, - "data": self.data - }.items() if value is not None} + "valid": self.valid, + "type": self.type, + "host": self.host, + "data": self.data, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname( - valid=payload.get('valid'), - type=payload.get('type'), - host=payload.get('host'), - data=payload.get('data') - ) - + valid=payload.get("valid"), + type=payload.get("type"), + host=payload.get("host"), + data=payload.get("data"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/update_authenticated_domain_request.py b/sendgrid/rest/api/domain_authentication/v3/models/update_authenticated_domain_request.py index 1d618ac8..8e5d3479 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/update_authenticated_domain_request.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/update_authenticated_domain_request.py @@ -1,25 +1,23 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateAuthenticatedDomainRequest: def __init__( - self, - default: Optional[bool]=None, - custom_spf: Optional[bool]=None + self, default: Optional[bool] = None, custom_spf: Optional[bool] = None ): - self.default=default - self.custom_spf=custom_spf + self.default = default + self.custom_spf = custom_spf def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "default": self.default, - "custom_spf": self.custom_spf - }.items() if value is not None} + "default": self.default, + "custom_spf": self.custom_spf, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +26,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateAuthenticatedDomainRequest( - default=payload.get('default'), - custom_spf=payload.get('custom_spf') - ) - + default=payload.get("default"), custom_spf=payload.get("custom_spf") + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response.py b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response.py index 2c8ed5b8..383a2bab 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response.py @@ -1,29 +1,33 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results import ValidateAuthenticatedDomain200ResponseValidationResults - +from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results import ( + ValidateAuthenticatedDomain200ResponseValidationResults, +) class ValidateAuthenticatedDomain200Response: def __init__( - self, - id: Optional[int]=None, - valid: Optional[bool]=None, - validation_results: Optional[ValidateAuthenticatedDomain200ResponseValidationResults]=None + self, + id: Optional[int] = None, + valid: Optional[bool] = None, + validation_results: Optional[ + ValidateAuthenticatedDomain200ResponseValidationResults + ] = None, ): - self.id=id - self.valid=valid - self.validation_results=validation_results + self.id = id + self.valid = valid + self.validation_results = validation_results def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "valid": self.valid, - "validation_results": self.validation_results - }.items() if value is not None} + "id": self.id, + "valid": self.valid, + "validation_results": self.validation_results, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +36,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateAuthenticatedDomain200Response( - id=payload.get('id'), - valid=payload.get('valid'), - validation_results=payload.get('validation_results') - ) - + id=payload.get("id"), + valid=payload.get("valid"), + validation_results=payload.get("validation_results"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results.py b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results.py index 5480150f..8a4848f0 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results.py @@ -1,34 +1,48 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results_dkim1 import ValidateAuthenticatedDomain200ResponseValidationResultsDkim1 -from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results_mail_cname import ValidateAuthenticatedDomain200ResponseValidationResultsMailCname -from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results_spf import ValidateAuthenticatedDomain200ResponseValidationResultsSpf - +from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results_dkim1 import ( + ValidateAuthenticatedDomain200ResponseValidationResultsDkim1, +) +from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results_mail_cname import ( + ValidateAuthenticatedDomain200ResponseValidationResultsMailCname, +) +from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response_validation_results_spf import ( + ValidateAuthenticatedDomain200ResponseValidationResultsSpf, +) class ValidateAuthenticatedDomain200ResponseValidationResults: def __init__( - self, - mail_cname: Optional[ValidateAuthenticatedDomain200ResponseValidationResultsMailCname]=None, - dkim1: Optional[ValidateAuthenticatedDomain200ResponseValidationResultsDkim1]=None, - dkim2: Optional[ValidateAuthenticatedDomain200ResponseValidationResultsDkim1]=None, - spf: Optional[ValidateAuthenticatedDomain200ResponseValidationResultsSpf]=None + self, + mail_cname: Optional[ + ValidateAuthenticatedDomain200ResponseValidationResultsMailCname + ] = None, + dkim1: Optional[ + ValidateAuthenticatedDomain200ResponseValidationResultsDkim1 + ] = None, + dkim2: Optional[ + ValidateAuthenticatedDomain200ResponseValidationResultsDkim1 + ] = None, + spf: Optional[ + ValidateAuthenticatedDomain200ResponseValidationResultsSpf + ] = None, ): - self.mail_cname=mail_cname - self.dkim1=dkim1 - self.dkim2=dkim2 - self.spf=spf + self.mail_cname = mail_cname + self.dkim1 = dkim1 + self.dkim2 = dkim2 + self.spf = spf def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "mail_cname": self.mail_cname, - "dkim1": self.dkim1, - "dkim2": self.dkim2, - "spf": self.spf - }.items() if value is not None} + "mail_cname": self.mail_cname, + "dkim1": self.dkim1, + "dkim2": self.dkim2, + "spf": self.spf, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -37,9 +51,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateAuthenticatedDomain200ResponseValidationResults( - mail_cname=payload.get('mail_cname'), - dkim1=payload.get('dkim1'), - dkim2=payload.get('dkim2'), - spf=payload.get('spf') - ) - + mail_cname=payload.get("mail_cname"), + dkim1=payload.get("dkim1"), + dkim2=payload.get("dkim2"), + spf=payload.get("spf"), + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results_dkim1.py b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results_dkim1.py index a6adb905..f034933e 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results_dkim1.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results_dkim1.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ValidateAuthenticatedDomain200ResponseValidationResultsDkim1: - def __init__( - self, - valid: Optional[bool]=None, - reason: Optional[str]=None - ): - self.valid=valid - self.reason=reason + def __init__(self, valid: Optional[bool] = None, reason: Optional[str] = None): + self.valid = valid + self.reason = reason def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "valid": self.valid, - "reason": self.reason - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"valid": self.valid, "reason": self.reason}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateAuthenticatedDomain200ResponseValidationResultsDkim1( - valid=payload.get('valid'), - reason=payload.get('reason') - ) - + valid=payload.get("valid"), reason=payload.get("reason") + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results_mail_cname.py b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results_mail_cname.py index 081c24ba..0e66924f 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results_mail_cname.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results_mail_cname.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ValidateAuthenticatedDomain200ResponseValidationResultsMailCname: - def __init__( - self, - valid: Optional[bool]=None, - reason: Optional[str]=None - ): - self.valid=valid - self.reason=reason + def __init__(self, valid: Optional[bool] = None, reason: Optional[str] = None): + self.valid = valid + self.reason = reason def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "valid": self.valid, - "reason": self.reason - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"valid": self.valid, "reason": self.reason}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateAuthenticatedDomain200ResponseValidationResultsMailCname( - valid=payload.get('valid'), - reason=payload.get('reason') - ) - + valid=payload.get("valid"), reason=payload.get("reason") + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results_spf.py b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results_spf.py index 8797d02d..6cb772c0 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results_spf.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain200_response_validation_results_spf.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ValidateAuthenticatedDomain200ResponseValidationResultsSpf: - def __init__( - self, - valid: Optional[bool]=None, - reason: Optional[str]=None - ): - self.valid=valid - self.reason=reason + def __init__(self, valid: Optional[bool] = None, reason: Optional[str] = None): + self.valid = valid + self.reason = reason def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "valid": self.valid, - "reason": self.reason - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"valid": self.valid, "reason": self.reason}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateAuthenticatedDomain200ResponseValidationResultsSpf( - valid=payload.get('valid'), - reason=payload.get('reason') - ) - + valid=payload.get("valid"), reason=payload.get("reason") + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain500_response.py b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain500_response.py index ca6f601b..26e80140 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain500_response.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain500_response.py @@ -1,23 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain500_response_errors_inner import ValidateAuthenticatedDomain500ResponseErrorsInner - +from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain500_response_errors_inner import ( + ValidateAuthenticatedDomain500ResponseErrorsInner, +) class ValidateAuthenticatedDomain500Response: def __init__( - self, - errors: Optional[List[ValidateAuthenticatedDomain500ResponseErrorsInner]]=None + self, + errors: Optional[ + List[ValidateAuthenticatedDomain500ResponseErrorsInner] + ] = None, ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ValidateAuthenticatedDomain500Response( - errors=payload.get('errors') - ) - + return ValidateAuthenticatedDomain500Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain500_response_errors_inner.py b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain500_response_errors_inner.py index e50411b5..8164eecd 100644 --- a/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain500_response_errors_inner.py +++ b/sendgrid/rest/api/domain_authentication/v3/models/validate_authenticated_domain500_response_errors_inner.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ValidateAuthenticatedDomain500ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,6 +20,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateAuthenticatedDomain500ResponseErrorsInner( - message=payload.get('message') - ) - + message=payload.get("message") + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/update_authenticated_domain.py b/sendgrid/rest/api/domain_authentication/v3/update_authenticated_domain.py index 2ad4d751..9c897db7 100644 --- a/sendgrid/rest/api/domain_authentication/v3/update_authenticated_domain.py +++ b/sendgrid/rest/api/domain_authentication/v3/update_authenticated_domain.py @@ -12,59 +12,60 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.domain_authentication.v3.models.update_authenticated_domain_request import UpdateAuthenticatedDomainRequest -from sendgrid.rest.api.domain_authentication.v3.models.object import object +from sendgrid.rest.api.domain_authentication.v3.models.update_authenticated_domain_request import ( + UpdateAuthenticatedDomainRequest, +) + class UpdateAuthenticatedDomain: def __init__(self, client) -> None: self.client = client - + def send( self, - domain_id: str, - on_behalf_of: Optional[str] = None, - update_authenticated_domain_request: Optional[UpdateAuthenticatedDomainRequest] = None, - + domain_id: str, + on_behalf_of: Optional[str] = None, + update_authenticated_domain_request: Optional[ + UpdateAuthenticatedDomainRequest + ] = None, ): - path='/v3/whitelabel/domains/{domain_id}' + path = "/v3/whitelabel/domains/{domain_id}" path = path.format( - domain_id=domain_id, + domain_id=domain_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_authenticated_domain_request: data = update_authenticated_domain_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/domain_authentication/v3/validate_authenticated_domain.py b/sendgrid/rest/api/domain_authentication/v3/validate_authenticated_domain.py index 5a2daeea..995e82d8 100644 --- a/sendgrid/rest/api/domain_authentication/v3/validate_authenticated_domain.py +++ b/sendgrid/rest/api/domain_authentication/v3/validate_authenticated_domain.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.domain_authentication.v3.models.validate_authenticated_domain200_response import ValidateAuthenticatedDomain200Response + class ValidateAuthenticatedDomain: def __init__(self, client) -> None: self.client = client - + def send( self, - id: int, - on_behalf_of: Optional[str] = None, - + id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/whitelabel/domains/{id}/validate' + path = "/v3/whitelabel/domains/{id}/validate" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='POST', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/email_activity/v3/__init__.py b/sendgrid/rest/api/email_activity/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/email_activity/v3/__init__.py +++ b/sendgrid/rest/api/email_activity/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/email_activity/v3/download_csv.py b/sendgrid/rest/api/email_activity/v3/download_csv.py index e112ad97..9a3498a6 100644 --- a/sendgrid/rest/api/email_activity/v3/download_csv.py +++ b/sendgrid/rest/api/email_activity/v3/download_csv.py @@ -12,48 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.email_activity.v3.models.download_csv200_response import DownloadCsv200Response class DownloadCsv: def __init__(self, client) -> None: self.client = client - + def send( self, - download_uuid: str, - + download_uuid: str, ): - path='/v3/messages/download/{download_uuid}' + path = "/v3/messages/download/{download_uuid}" path = path.format( - download_uuid=download_uuid, + download_uuid=download_uuid, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/email_activity/v3/get_message.py b/sendgrid/rest/api/email_activity/v3/get_message.py index 1837fd0d..cdd1196c 100644 --- a/sendgrid/rest/api/email_activity/v3/get_message.py +++ b/sendgrid/rest/api/email_activity/v3/get_message.py @@ -12,48 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.email_activity.v3.models.message import Message class GetMessage: def __init__(self, client) -> None: self.client = client - + def send( self, - msg_id: str, - + msg_id: str, ): - path='/v3/messages/{msg_id}' + path = "/v3/messages/{msg_id}" path = path.format( - msg_id=msg_id, + msg_id=msg_id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/email_activity/v3/list_message.py b/sendgrid/rest/api/email_activity/v3/list_message.py index 147cf59b..6b75764e 100644 --- a/sendgrid/rest/api/email_activity/v3/list_message.py +++ b/sendgrid/rest/api/email_activity/v3/list_message.py @@ -12,47 +12,42 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing import Optional, Union -from typing_extensions import Annotated -from sendgrid.rest.api.email_activity.v3.models.list_message200_response import ListMessage200Response +from typing import Optional + class ListMessage: def __init__(self, client) -> None: self.client = client - + def send( self, - query: Optional[str] = None, - limit: Optional[float] = None, - + query: Optional[str] = None, + limit: Optional[float] = None, ): - path='/v3/messages' + path = "/v3/messages" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/email_activity/v3/models/__init__.py b/sendgrid/rest/api/email_activity/v3/models/__init__.py index 80fcc393..341cb7d6 100644 --- a/sendgrid/rest/api/email_activity/v3/models/__init__.py +++ b/sendgrid/rest/api/email_activity/v3/models/__init__.py @@ -11,30 +11,74 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.email_activity.v3.models.abbv_message import AbbvMessage from sendgrid.rest.api.email_activity.v3.models.bounce_type import BounceType from sendgrid.rest.api.email_activity.v3.models.bounce_type1 import BounceType1 -from sendgrid.rest.api.email_activity.v3.models.download_csv200_response import DownloadCsv200Response -from sendgrid.rest.api.email_activity.v3.models.email_activity_response_base_props import EmailActivityResponseBaseProps +from sendgrid.rest.api.email_activity.v3.models.download_csv200_response import ( + DownloadCsv200Response, +) +from sendgrid.rest.api.email_activity.v3.models.email_activity_response_base_props import ( + EmailActivityResponseBaseProps, +) from sendgrid.rest.api.email_activity.v3.models.event import Event from sendgrid.rest.api.email_activity.v3.models.event_name import EventName from sendgrid.rest.api.email_activity.v3.models.event_name1 import EventName1 -from sendgrid.rest.api.email_activity.v3.models.get_message404_response import GetMessage404Response -from sendgrid.rest.api.email_activity.v3.models.get_message404_response_errors_inner import GetMessage404ResponseErrorsInner -from sendgrid.rest.api.email_activity.v3.models.list_message200_response import ListMessage200Response -from sendgrid.rest.api.email_activity.v3.models.list_message400_response import ListMessage400Response -from sendgrid.rest.api.email_activity.v3.models.list_message400_response_errors_inner import ListMessage400ResponseErrorsInner -from sendgrid.rest.api.email_activity.v3.models.list_message429_response import ListMessage429Response -from sendgrid.rest.api.email_activity.v3.models.list_message429_response_errors_inner import ListMessage429ResponseErrorsInner +from sendgrid.rest.api.email_activity.v3.models.get_message404_response import ( + GetMessage404Response, +) +from sendgrid.rest.api.email_activity.v3.models.get_message404_response_errors_inner import ( + GetMessage404ResponseErrorsInner, +) +from sendgrid.rest.api.email_activity.v3.models.list_message200_response import ( + ListMessage200Response, +) +from sendgrid.rest.api.email_activity.v3.models.list_message400_response import ( + ListMessage400Response, +) +from sendgrid.rest.api.email_activity.v3.models.list_message400_response_errors_inner import ( + ListMessage400ResponseErrorsInner, +) +from sendgrid.rest.api.email_activity.v3.models.list_message429_response import ( + ListMessage429Response, +) +from sendgrid.rest.api.email_activity.v3.models.list_message429_response_errors_inner import ( + ListMessage429ResponseErrorsInner, +) from sendgrid.rest.api.email_activity.v3.models.message import Message from sendgrid.rest.api.email_activity.v3.models.outbound_ip_type import OutboundIpType from sendgrid.rest.api.email_activity.v3.models.outbound_ip_type1 import OutboundIpType1 -from sendgrid.rest.api.email_activity.v3.models.request_csv202_response import RequestCsv202Response +from sendgrid.rest.api.email_activity.v3.models.request_csv202_response import ( + RequestCsv202Response, +) from sendgrid.rest.api.email_activity.v3.models.status import Status from sendgrid.rest.api.email_activity.v3.models.status1 import Status1 from sendgrid.rest.api.email_activity.v3.models.status2 import Status2 from sendgrid.rest.api.email_activity.v3.models.status3 import Status3 -__all__ = [ 'AbbvMessage', 'BounceType', 'BounceType1', 'DownloadCsv200Response', 'EmailActivityResponseBaseProps', 'Event', 'EventName', 'EventName1', 'GetMessage404Response', 'GetMessage404ResponseErrorsInner', 'ListMessage200Response', 'ListMessage400Response', 'ListMessage400ResponseErrorsInner', 'ListMessage429Response', 'ListMessage429ResponseErrorsInner', 'Message', 'OutboundIpType', 'OutboundIpType1', 'RequestCsv202Response', 'Status', 'Status1', 'Status2', 'Status3' ] -# Testing code \ No newline at end of file + +__all__ = [ + "AbbvMessage", + "BounceType", + "BounceType1", + "DownloadCsv200Response", + "EmailActivityResponseBaseProps", + "Event", + "EventName", + "EventName1", + "GetMessage404Response", + "GetMessage404ResponseErrorsInner", + "ListMessage200Response", + "ListMessage400Response", + "ListMessage400ResponseErrorsInner", + "ListMessage429Response", + "ListMessage429ResponseErrorsInner", + "Message", + "OutboundIpType", + "OutboundIpType1", + "RequestCsv202Response", + "Status", + "Status1", + "Status2", + "Status3", +] +# Testing code diff --git a/sendgrid/rest/api/email_activity/v3/models/abbv_message.py b/sendgrid/rest/api/email_activity/v3/models/abbv_message.py index 654a526b..2a4a3e9f 100644 --- a/sendgrid/rest/api/email_activity/v3/models/abbv_message.py +++ b/sendgrid/rest/api/email_activity/v3/models/abbv_message.py @@ -1,44 +1,44 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.email_activity.v3.models.status import Status - class AbbvMessage: def __init__( - self, - from_email: Optional[str]=None, - msg_id: Optional[str]=None, - subject: Optional[str]=None, - to_email: Optional[str]=None, - status: Optional[Status]=None, - opens_count: Optional[int]=None, - clicks_count: Optional[int]=None, - last_event_time: Optional[str]=None + self, + from_email: Optional[str] = None, + msg_id: Optional[str] = None, + subject: Optional[str] = None, + to_email: Optional[str] = None, + status: Optional[Status] = None, + opens_count: Optional[int] = None, + clicks_count: Optional[int] = None, + last_event_time: Optional[str] = None, ): - self.from_email=from_email - self.msg_id=msg_id - self.subject=subject - self.to_email=to_email - self.status=status - self.opens_count=opens_count - self.clicks_count=clicks_count - self.last_event_time=last_event_time + self.from_email = from_email + self.msg_id = msg_id + self.subject = subject + self.to_email = to_email + self.status = status + self.opens_count = opens_count + self.clicks_count = clicks_count + self.last_event_time = last_event_time def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "from_email": self.from_email, - "msg_id": self.msg_id, - "subject": self.subject, - "to_email": self.to_email, - "status": self.status, - "opens_count": self.opens_count, - "clicks_count": self.clicks_count, - "last_event_time": self.last_event_time - }.items() if value is not None} + "from_email": self.from_email, + "msg_id": self.msg_id, + "subject": self.subject, + "to_email": self.to_email, + "status": self.status, + "opens_count": self.opens_count, + "clicks_count": self.clicks_count, + "last_event_time": self.last_event_time, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -47,13 +47,12 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AbbvMessage( - from_email=payload.get('from_email'), - msg_id=payload.get('msg_id'), - subject=payload.get('subject'), - to_email=payload.get('to_email'), - status=payload.get('status'), - opens_count=payload.get('opens_count'), - clicks_count=payload.get('clicks_count'), - last_event_time=payload.get('last_event_time') - ) - + from_email=payload.get("from_email"), + msg_id=payload.get("msg_id"), + subject=payload.get("subject"), + to_email=payload.get("to_email"), + status=payload.get("status"), + opens_count=payload.get("opens_count"), + clicks_count=payload.get("clicks_count"), + last_event_time=payload.get("last_event_time"), + ) diff --git a/sendgrid/rest/api/email_activity/v3/models/bounce_type.py b/sendgrid/rest/api/email_activity/v3/models/bounce_type.py index a42c22b5..bdce8d77 100644 --- a/sendgrid/rest/api/email_activity/v3/models/bounce_type.py +++ b/sendgrid/rest/api/email_activity/v3/models/bounce_type.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class BounceType(Enum): - SOFT='soft' - HARD='hard' - + SOFT = "soft" + HARD = "hard" diff --git a/sendgrid/rest/api/email_activity/v3/models/bounce_type1.py b/sendgrid/rest/api/email_activity/v3/models/bounce_type1.py index 08aa7376..3c2483c4 100644 --- a/sendgrid/rest/api/email_activity/v3/models/bounce_type1.py +++ b/sendgrid/rest/api/email_activity/v3/models/bounce_type1.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class BounceType1(Enum): - SOFT='soft' - HARD='hard' - + SOFT = "soft" + HARD = "hard" diff --git a/sendgrid/rest/api/email_activity/v3/models/download_csv200_response.py b/sendgrid/rest/api/email_activity/v3/models/download_csv200_response.py index 2ae53c61..b7603d16 100644 --- a/sendgrid/rest/api/email_activity/v3/models/download_csv200_response.py +++ b/sendgrid/rest/api/email_activity/v3/models/download_csv200_response.py @@ -1,25 +1,21 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DownloadCsv200Response: - def __init__( - self, - presigned_url: Optional[str]=None, - csv: Optional[str]=None - ): - self.presigned_url=presigned_url - self.csv=csv + def __init__(self, presigned_url: Optional[str] = None, csv: Optional[str] = None): + self.presigned_url = presigned_url + self.csv = csv def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "presigned_url": self.presigned_url, - "csv": self.csv - }.items() if value is not None} + "presigned_url": self.presigned_url, + "csv": self.csv, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +24,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return DownloadCsv200Response( - presigned_url=payload.get('presigned_url'), - csv=payload.get('csv') - ) - + presigned_url=payload.get("presigned_url"), csv=payload.get("csv") + ) diff --git a/sendgrid/rest/api/email_activity/v3/models/email_activity_response_base_props.py b/sendgrid/rest/api/email_activity/v3/models/email_activity_response_base_props.py index 5c56cdcc..f2e3b5b1 100644 --- a/sendgrid/rest/api/email_activity/v3/models/email_activity_response_base_props.py +++ b/sendgrid/rest/api/email_activity/v3/models/email_activity_response_base_props.py @@ -1,35 +1,35 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.email_activity.v3.models.status3 import Status3 - class EmailActivityResponseBaseProps: def __init__( - self, - from_email: Optional[str]=None, - msg_id: Optional[str]=None, - subject: Optional[str]=None, - to_email: Optional[str]=None, - status: Optional[Status3]=None + self, + from_email: Optional[str] = None, + msg_id: Optional[str] = None, + subject: Optional[str] = None, + to_email: Optional[str] = None, + status: Optional[Status3] = None, ): - self.from_email=from_email - self.msg_id=msg_id - self.subject=subject - self.to_email=to_email - self.status=status + self.from_email = from_email + self.msg_id = msg_id + self.subject = subject + self.to_email = to_email + self.status = status def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "from_email": self.from_email, - "msg_id": self.msg_id, - "subject": self.subject, - "to_email": self.to_email, - "status": self.status - }.items() if value is not None} + "from_email": self.from_email, + "msg_id": self.msg_id, + "subject": self.subject, + "to_email": self.to_email, + "status": self.status, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -38,10 +38,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return EmailActivityResponseBaseProps( - from_email=payload.get('from_email'), - msg_id=payload.get('msg_id'), - subject=payload.get('subject'), - to_email=payload.get('to_email'), - status=payload.get('status') - ) - + from_email=payload.get("from_email"), + msg_id=payload.get("msg_id"), + subject=payload.get("subject"), + to_email=payload.get("to_email"), + status=payload.get("status"), + ) diff --git a/sendgrid/rest/api/email_activity/v3/models/event.py b/sendgrid/rest/api/email_activity/v3/models/event.py index 053b3c62..6a28f23c 100644 --- a/sendgrid/rest/api/email_activity/v3/models/event.py +++ b/sendgrid/rest/api/email_activity/v3/models/event.py @@ -1,45 +1,45 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.email_activity.v3.models.bounce_type import BounceType from sendgrid.rest.api.email_activity.v3.models.event_name import EventName - class Event: def __init__( - self, - event_name: Optional[EventName]=None, - processed: Optional[str]=None, - reason: Optional[str]=None, - attempt_num: Optional[int]=None, - url: Optional[str]=None, - bounce_type: Optional[BounceType]=None, - http_user_agent: Optional[str]=None, - mx_server: Optional[str]=None + self, + event_name: Optional[EventName] = None, + processed: Optional[str] = None, + reason: Optional[str] = None, + attempt_num: Optional[int] = None, + url: Optional[str] = None, + bounce_type: Optional[BounceType] = None, + http_user_agent: Optional[str] = None, + mx_server: Optional[str] = None, ): - self.event_name=event_name - self.processed=processed - self.reason=reason - self.attempt_num=attempt_num - self.url=url - self.bounce_type=bounce_type - self.http_user_agent=http_user_agent - self.mx_server=mx_server + self.event_name = event_name + self.processed = processed + self.reason = reason + self.attempt_num = attempt_num + self.url = url + self.bounce_type = bounce_type + self.http_user_agent = http_user_agent + self.mx_server = mx_server def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "event_name": self.event_name, - "processed": self.processed, - "reason": self.reason, - "attempt_num": self.attempt_num, - "url": self.url, - "bounce_type": self.bounce_type, - "http_user_agent": self.http_user_agent, - "mx_server": self.mx_server - }.items() if value is not None} + "event_name": self.event_name, + "processed": self.processed, + "reason": self.reason, + "attempt_num": self.attempt_num, + "url": self.url, + "bounce_type": self.bounce_type, + "http_user_agent": self.http_user_agent, + "mx_server": self.mx_server, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -48,13 +48,12 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Event( - event_name=payload.get('event_name'), - processed=payload.get('processed'), - reason=payload.get('reason'), - attempt_num=payload.get('attempt_num'), - url=payload.get('url'), - bounce_type=payload.get('bounce_type'), - http_user_agent=payload.get('http_user_agent'), - mx_server=payload.get('mx_server') - ) - + event_name=payload.get("event_name"), + processed=payload.get("processed"), + reason=payload.get("reason"), + attempt_num=payload.get("attempt_num"), + url=payload.get("url"), + bounce_type=payload.get("bounce_type"), + http_user_agent=payload.get("http_user_agent"), + mx_server=payload.get("mx_server"), + ) diff --git a/sendgrid/rest/api/email_activity/v3/models/event_name.py b/sendgrid/rest/api/email_activity/v3/models/event_name.py index 235ee656..50ee84b9 100644 --- a/sendgrid/rest/api/email_activity/v3/models/event_name.py +++ b/sendgrid/rest/api/email_activity/v3/models/event_name.py @@ -1,20 +1,16 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class EventName(Enum): - BOUNCED='bounced' - OPENED='opened' - CLICKED='clicked' - PROCESSED='processed' - DROPPED='dropped' - DELIVERED='delivered' - DEFERRED='deferred' - SPAM_REPORT='spam_report' - UNSUBSCRIBE='unsubscribe' - GROUP_UNSUBSCRIBE='group_unsubscribe' - GROUP_RESUBSCRIBE='group_resubscribe' - + BOUNCED = "bounced" + OPENED = "opened" + CLICKED = "clicked" + PROCESSED = "processed" + DROPPED = "dropped" + DELIVERED = "delivered" + DEFERRED = "deferred" + SPAM_REPORT = "spam_report" + UNSUBSCRIBE = "unsubscribe" + GROUP_UNSUBSCRIBE = "group_unsubscribe" + GROUP_RESUBSCRIBE = "group_resubscribe" diff --git a/sendgrid/rest/api/email_activity/v3/models/event_name1.py b/sendgrid/rest/api/email_activity/v3/models/event_name1.py index 1351e57d..e20bb5dc 100644 --- a/sendgrid/rest/api/email_activity/v3/models/event_name1.py +++ b/sendgrid/rest/api/email_activity/v3/models/event_name1.py @@ -1,20 +1,16 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class EventName1(Enum): - BOUNCED='bounced' - OPENED='opened' - CLICKED='clicked' - PROCESSED='processed' - DROPPED='dropped' - DELIVERED='delivered' - DEFERRED='deferred' - SPAM_REPORT='spam_report' - UNSUBSCRIBE='unsubscribe' - GROUP_UNSUBSCRIBE='group_unsubscribe' - GROUP_RESUBSCRIBE='group_resubscribe' - + BOUNCED = "bounced" + OPENED = "opened" + CLICKED = "clicked" + PROCESSED = "processed" + DROPPED = "dropped" + DELIVERED = "delivered" + DEFERRED = "deferred" + SPAM_REPORT = "spam_report" + UNSUBSCRIBE = "unsubscribe" + GROUP_UNSUBSCRIBE = "group_unsubscribe" + GROUP_RESUBSCRIBE = "group_resubscribe" diff --git a/sendgrid/rest/api/email_activity/v3/models/get_message404_response.py b/sendgrid/rest/api/email_activity/v3/models/get_message404_response.py index 16e706ab..fcd14f7b 100644 --- a/sendgrid/rest/api/email_activity/v3/models/get_message404_response.py +++ b/sendgrid/rest/api/email_activity/v3/models/get_message404_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.email_activity.v3.models.get_message404_response_errors_inner import GetMessage404ResponseErrorsInner - +from sendgrid.rest.api.email_activity.v3.models.get_message404_response_errors_inner import ( + GetMessage404ResponseErrorsInner, +) class GetMessage404Response: - def __init__( - self, - errors: Optional[List[GetMessage404ResponseErrorsInner]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[GetMessage404ResponseErrorsInner]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetMessage404Response( - errors=payload.get('errors') - ) - + return GetMessage404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/email_activity/v3/models/get_message404_response_errors_inner.py b/sendgrid/rest/api/email_activity/v3/models/get_message404_response_errors_inner.py index d5f3a467..51564da8 100644 --- a/sendgrid/rest/api/email_activity/v3/models/get_message404_response_errors_inner.py +++ b/sendgrid/rest/api/email_activity/v3/models/get_message404_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GetMessage404ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None - ): - self.message=message - self.field=field + def __init__(self, message: Optional[str] = None, field: Optional[str] = None): + self.message = message + self.field = field def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message, - "field": self.field - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message, "field": self.field}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetMessage404ResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field') - ) - + message=payload.get("message"), field=payload.get("field") + ) diff --git a/sendgrid/rest/api/email_activity/v3/models/list_message200_response.py b/sendgrid/rest/api/email_activity/v3/models/list_message200_response.py index f51e310b..ae9d3751 100644 --- a/sendgrid/rest/api/email_activity/v3/models/list_message200_response.py +++ b/sendgrid/rest/api/email_activity/v3/models/list_message200_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.email_activity.v3.models.abbv_message import AbbvMessage - class ListMessage200Response: - def __init__( - self, - messages: Optional[List[AbbvMessage]]=None - ): - self.messages=messages + def __init__(self, messages: Optional[List[AbbvMessage]] = None): + self.messages = messages def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "messages": self.messages - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"messages": self.messages}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListMessage200Response( - messages=payload.get('messages') - ) - + return ListMessage200Response(messages=payload.get("messages")) diff --git a/sendgrid/rest/api/email_activity/v3/models/list_message400_response.py b/sendgrid/rest/api/email_activity/v3/models/list_message400_response.py index 833db210..db425523 100644 --- a/sendgrid/rest/api/email_activity/v3/models/list_message400_response.py +++ b/sendgrid/rest/api/email_activity/v3/models/list_message400_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.email_activity.v3.models.list_message400_response_errors_inner import ListMessage400ResponseErrorsInner - +from sendgrid.rest.api.email_activity.v3.models.list_message400_response_errors_inner import ( + ListMessage400ResponseErrorsInner, +) class ListMessage400Response: def __init__( - self, - errors: Optional[List[ListMessage400ResponseErrorsInner]]=None + self, errors: Optional[List[ListMessage400ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListMessage400Response( - errors=payload.get('errors') - ) - + return ListMessage400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/email_activity/v3/models/list_message400_response_errors_inner.py b/sendgrid/rest/api/email_activity/v3/models/list_message400_response_errors_inner.py index 8b864c0b..95273db2 100644 --- a/sendgrid/rest/api/email_activity/v3/models/list_message400_response_errors_inner.py +++ b/sendgrid/rest/api/email_activity/v3/models/list_message400_response_errors_inner.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListMessage400ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListMessage400ResponseErrorsInner( - message=payload.get('message') - ) - + return ListMessage400ResponseErrorsInner(message=payload.get("message")) diff --git a/sendgrid/rest/api/email_activity/v3/models/list_message429_response.py b/sendgrid/rest/api/email_activity/v3/models/list_message429_response.py index d43dfe88..62cabc97 100644 --- a/sendgrid/rest/api/email_activity/v3/models/list_message429_response.py +++ b/sendgrid/rest/api/email_activity/v3/models/list_message429_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.email_activity.v3.models.list_message429_response_errors_inner import ListMessage429ResponseErrorsInner - +from sendgrid.rest.api.email_activity.v3.models.list_message429_response_errors_inner import ( + ListMessage429ResponseErrorsInner, +) class ListMessage429Response: def __init__( - self, - errors: Optional[List[ListMessage429ResponseErrorsInner]]=None + self, errors: Optional[List[ListMessage429ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListMessage429Response( - errors=payload.get('errors') - ) - + return ListMessage429Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/email_activity/v3/models/list_message429_response_errors_inner.py b/sendgrid/rest/api/email_activity/v3/models/list_message429_response_errors_inner.py index 810d333d..c01d1b04 100644 --- a/sendgrid/rest/api/email_activity/v3/models/list_message429_response_errors_inner.py +++ b/sendgrid/rest/api/email_activity/v3/models/list_message429_response_errors_inner.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListMessage429ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListMessage429ResponseErrorsInner( - message=payload.get('message') - ) - + return ListMessage429ResponseErrorsInner(message=payload.get("message")) diff --git a/sendgrid/rest/api/email_activity/v3/models/message.py b/sendgrid/rest/api/email_activity/v3/models/message.py index 649cce03..13029610 100644 --- a/sendgrid/rest/api/email_activity/v3/models/message.py +++ b/sendgrid/rest/api/email_activity/v3/models/message.py @@ -1,67 +1,67 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.email_activity.v3.models.event import Event from sendgrid.rest.api.email_activity.v3.models.outbound_ip_type import OutboundIpType from sendgrid.rest.api.email_activity.v3.models.status3 import Status3 - class Message: def __init__( - self, - from_email: Optional[str]=None, - msg_id: Optional[str]=None, - subject: Optional[str]=None, - to_email: Optional[str]=None, - status: Optional[Status3]=None, - template_id: Optional[str]=None, - asm_group_id: Optional[int]=None, - teammate: Optional[str]=None, - api_key_id: Optional[str]=None, - events: Optional[List[Event]]=None, - originating_ip: Optional[str]=None, - categories: Optional[List[str]]=None, - unique_args: Optional[str]=None, - outbound_ip: Optional[str]=None, - outbound_ip_type: Optional[OutboundIpType]=None + self, + from_email: Optional[str] = None, + msg_id: Optional[str] = None, + subject: Optional[str] = None, + to_email: Optional[str] = None, + status: Optional[Status3] = None, + template_id: Optional[str] = None, + asm_group_id: Optional[int] = None, + teammate: Optional[str] = None, + api_key_id: Optional[str] = None, + events: Optional[List[Event]] = None, + originating_ip: Optional[str] = None, + categories: Optional[List[str]] = None, + unique_args: Optional[str] = None, + outbound_ip: Optional[str] = None, + outbound_ip_type: Optional[OutboundIpType] = None, ): - self.from_email=from_email - self.msg_id=msg_id - self.subject=subject - self.to_email=to_email - self.status=status - self.template_id=template_id - self.asm_group_id=asm_group_id - self.teammate=teammate - self.api_key_id=api_key_id - self.events=events - self.originating_ip=originating_ip - self.categories=categories - self.unique_args=unique_args - self.outbound_ip=outbound_ip - self.outbound_ip_type=outbound_ip_type + self.from_email = from_email + self.msg_id = msg_id + self.subject = subject + self.to_email = to_email + self.status = status + self.template_id = template_id + self.asm_group_id = asm_group_id + self.teammate = teammate + self.api_key_id = api_key_id + self.events = events + self.originating_ip = originating_ip + self.categories = categories + self.unique_args = unique_args + self.outbound_ip = outbound_ip + self.outbound_ip_type = outbound_ip_type def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "from_email": self.from_email, - "msg_id": self.msg_id, - "subject": self.subject, - "to_email": self.to_email, - "status": self.status, - "template_id": self.template_id, - "asm_group_id": self.asm_group_id, - "teammate": self.teammate, - "api_key_id": self.api_key_id, - "events": self.events, - "originating_ip": self.originating_ip, - "categories": self.categories, - "unique_args": self.unique_args, - "outbound_ip": self.outbound_ip, - "outbound_ip_type": self.outbound_ip_type - }.items() if value is not None} + "from_email": self.from_email, + "msg_id": self.msg_id, + "subject": self.subject, + "to_email": self.to_email, + "status": self.status, + "template_id": self.template_id, + "asm_group_id": self.asm_group_id, + "teammate": self.teammate, + "api_key_id": self.api_key_id, + "events": self.events, + "originating_ip": self.originating_ip, + "categories": self.categories, + "unique_args": self.unique_args, + "outbound_ip": self.outbound_ip, + "outbound_ip_type": self.outbound_ip_type, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -70,20 +70,19 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Message( - from_email=payload.get('from_email'), - msg_id=payload.get('msg_id'), - subject=payload.get('subject'), - to_email=payload.get('to_email'), - status=payload.get('status'), - template_id=payload.get('template_id'), - asm_group_id=payload.get('asm_group_id'), - teammate=payload.get('teammate'), - api_key_id=payload.get('api_key_id'), - events=payload.get('events'), - originating_ip=payload.get('originating_ip'), - categories=payload.get('categories'), - unique_args=payload.get('unique_args'), - outbound_ip=payload.get('outbound_ip'), - outbound_ip_type=payload.get('outbound_ip_type') - ) - + from_email=payload.get("from_email"), + msg_id=payload.get("msg_id"), + subject=payload.get("subject"), + to_email=payload.get("to_email"), + status=payload.get("status"), + template_id=payload.get("template_id"), + asm_group_id=payload.get("asm_group_id"), + teammate=payload.get("teammate"), + api_key_id=payload.get("api_key_id"), + events=payload.get("events"), + originating_ip=payload.get("originating_ip"), + categories=payload.get("categories"), + unique_args=payload.get("unique_args"), + outbound_ip=payload.get("outbound_ip"), + outbound_ip_type=payload.get("outbound_ip_type"), + ) diff --git a/sendgrid/rest/api/email_activity/v3/models/outbound_ip_type.py b/sendgrid/rest/api/email_activity/v3/models/outbound_ip_type.py index c05ece1b..b655556d 100644 --- a/sendgrid/rest/api/email_activity/v3/models/outbound_ip_type.py +++ b/sendgrid/rest/api/email_activity/v3/models/outbound_ip_type.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class OutboundIpType(Enum): - DEDICATED='dedicated' - SHARED='shared' - + DEDICATED = "dedicated" + SHARED = "shared" diff --git a/sendgrid/rest/api/email_activity/v3/models/outbound_ip_type1.py b/sendgrid/rest/api/email_activity/v3/models/outbound_ip_type1.py index f4f1660e..cfb75cfb 100644 --- a/sendgrid/rest/api/email_activity/v3/models/outbound_ip_type1.py +++ b/sendgrid/rest/api/email_activity/v3/models/outbound_ip_type1.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class OutboundIpType1(Enum): - DEDICATED='dedicated' - SHARED='shared' - + DEDICATED = "dedicated" + SHARED = "shared" diff --git a/sendgrid/rest/api/email_activity/v3/models/request_csv202_response.py b/sendgrid/rest/api/email_activity/v3/models/request_csv202_response.py index ac86c6b5..bef128d9 100644 --- a/sendgrid/rest/api/email_activity/v3/models/request_csv202_response.py +++ b/sendgrid/rest/api/email_activity/v3/models/request_csv202_response.py @@ -1,26 +1,19 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.email_activity.v3.models.status2 import Status2 - class RequestCsv202Response: - def __init__( - self, - status: Optional[Status2]=None, - message: Optional[str]=None - ): - self.status=status - self.message=message + def __init__(self, status: Optional[Status2] = None, message: Optional[str] = None): + self.status = status + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "status": self.status, - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"status": self.status, "message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +22,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return RequestCsv202Response( - status=payload.get('status'), - message=payload.get('message') - ) - + status=payload.get("status"), message=payload.get("message") + ) diff --git a/sendgrid/rest/api/email_activity/v3/models/status.py b/sendgrid/rest/api/email_activity/v3/models/status.py index a442f21c..4d4c31c8 100644 --- a/sendgrid/rest/api/email_activity/v3/models/status.py +++ b/sendgrid/rest/api/email_activity/v3/models/status.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Status(Enum): - PROCESSED='processed' - DELIVERED='delivered' - NOT_DELIVERED='not_delivered' - + PROCESSED = "processed" + DELIVERED = "delivered" + NOT_DELIVERED = "not_delivered" diff --git a/sendgrid/rest/api/email_activity/v3/models/status1.py b/sendgrid/rest/api/email_activity/v3/models/status1.py index b43f0601..1bf58363 100644 --- a/sendgrid/rest/api/email_activity/v3/models/status1.py +++ b/sendgrid/rest/api/email_activity/v3/models/status1.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Status1(Enum): - PROCESSED='processed' - NOT_DELIVERED='not_delivered' - DELIVERED='delivered' - + PROCESSED = "processed" + NOT_DELIVERED = "not_delivered" + DELIVERED = "delivered" diff --git a/sendgrid/rest/api/email_activity/v3/models/status2.py b/sendgrid/rest/api/email_activity/v3/models/status2.py index e7caf9ad..52d9ceba 100644 --- a/sendgrid/rest/api/email_activity/v3/models/status2.py +++ b/sendgrid/rest/api/email_activity/v3/models/status2.py @@ -1,10 +1,6 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Status2(Enum): - PENDING='pending' - + PENDING = "pending" diff --git a/sendgrid/rest/api/email_activity/v3/models/status3.py b/sendgrid/rest/api/email_activity/v3/models/status3.py index d1699cfb..505b7fe8 100644 --- a/sendgrid/rest/api/email_activity/v3/models/status3.py +++ b/sendgrid/rest/api/email_activity/v3/models/status3.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Status3(Enum): - PROCESSED='processed' - DELIVERED='delivered' - NOT_DELIVERED='not_delivered' - + PROCESSED = "processed" + DELIVERED = "delivered" + NOT_DELIVERED = "not_delivered" diff --git a/sendgrid/rest/api/email_activity/v3/request_csv.py b/sendgrid/rest/api/email_activity/v3/request_csv.py index 18c0e397..40223cc8 100644 --- a/sendgrid/rest/api/email_activity/v3/request_csv.py +++ b/sendgrid/rest/api/email_activity/v3/request_csv.py @@ -12,46 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.email_activity.v3.models.request_csv202_response import RequestCsv202Response + class RequestCsv: def __init__(self, client) -> None: self.client = client - + def send( self, - query: Optional[str] = None, - + query: Optional[str] = None, ): - path='/v3/messages/download' + path = "/v3/messages/download" data = None - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/email_validation/v3/__init__.py b/sendgrid/rest/api/email_validation/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/email_validation/v3/__init__.py +++ b/sendgrid/rest/api/email_validation/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/email_validation/v3/get_email_job_for_verification.py b/sendgrid/rest/api/email_validation/v3/get_email_job_for_verification.py index a73f0553..9a825758 100644 --- a/sendgrid/rest/api/email_validation/v3/get_email_job_for_verification.py +++ b/sendgrid/rest/api/email_validation/v3/get_email_job_for_verification.py @@ -12,48 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs_job_id200_response import GetValidationsEmailJobsJobId200Response class GetEmailJobForVerification: def __init__(self, client) -> None: self.client = client - + def send( self, - job_id: str, - + job_id: str, ): - path='/v3/validations/email/jobs/{job_id}' + path = "/v3/validations/email/jobs/{job_id}" path = path.format( - job_id=job_id, + job_id=job_id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/email_validation/v3/get_validations_email_jobs.py b/sendgrid/rest/api/email_validation/v3/get_validations_email_jobs.py index e34d3e0f..05761432 100644 --- a/sendgrid/rest/api/email_validation/v3/get_validations_email_jobs.py +++ b/sendgrid/rest/api/email_validation/v3/get_validations_email_jobs.py @@ -12,42 +12,37 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs200_response import GetValidationsEmailJobs200Response class GetValidationsEmailJobs: def __init__(self, client) -> None: self.client = client - + def send( self, - ): - path='/v3/validations/email/jobs' + path = "/v3/validations/email/jobs" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/email_validation/v3/list_email_job_for_verification.py b/sendgrid/rest/api/email_validation/v3/list_email_job_for_verification.py index 6215f43f..2b5e257f 100644 --- a/sendgrid/rest/api/email_validation/v3/list_email_job_for_verification.py +++ b/sendgrid/rest/api/email_validation/v3/list_email_job_for_verification.py @@ -12,47 +12,48 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.email_validation.v3.models.list_email_job_for_verification_request import ListEmailJobForVerificationRequest -from sendgrid.rest.api.email_validation.v3.models.put_validations_email_jobs200_response import PutValidationsEmailJobs200Response +from sendgrid.rest.api.email_validation.v3.models.list_email_job_for_verification_request import ( + ListEmailJobForVerificationRequest, +) + class ListEmailJobForVerification: def __init__(self, client) -> None: self.client = client - + def send( self, - list_email_job_for_verification_request: Optional[ListEmailJobForVerificationRequest] = None, - + list_email_job_for_verification_request: Optional[ + ListEmailJobForVerificationRequest + ] = None, ): - path='/v3/validations/email/jobs' + path = "/v3/validations/email/jobs" data = None if list_email_job_for_verification_request: data = list_email_job_for_verification_request.to_dict() - request = Request( - method='PUT', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/email_validation/v3/models/__init__.py b/sendgrid/rest/api/email_validation/v3/models/__init__.py index 87ccf330..9c8657b9 100644 --- a/sendgrid/rest/api/email_validation/v3/models/__init__.py +++ b/sendgrid/rest/api/email_validation/v3/models/__init__.py @@ -11,28 +11,82 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.email_validation.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.email_validation.v3.models.error_response_errors_inner import ErrorResponseErrorsInner +from sendgrid.rest.api.email_validation.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) from sendgrid.rest.api.email_validation.v3.models.file_type import FileType -from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs200_response import GetValidationsEmailJobs200Response -from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs200_response_result_inner import GetValidationsEmailJobs200ResponseResultInner -from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs_job_id200_response import GetValidationsEmailJobsJobId200Response -from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs_job_id200_response_result import GetValidationsEmailJobsJobId200ResponseResult -from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs_job_id200_response_result_errors_inner import GetValidationsEmailJobsJobId200ResponseResultErrorsInner -from sendgrid.rest.api.email_validation.v3.models.list_email_job_for_verification_request import ListEmailJobForVerificationRequest -from sendgrid.rest.api.email_validation.v3.models.put_validations_email_jobs200_response import PutValidationsEmailJobs200Response -from sendgrid.rest.api.email_validation.v3.models.put_validations_email_jobs200_response_upload_headers_inner import PutValidationsEmailJobs200ResponseUploadHeadersInner +from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs200_response import ( + GetValidationsEmailJobs200Response, +) +from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs200_response_result_inner import ( + GetValidationsEmailJobs200ResponseResultInner, +) +from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs_job_id200_response import ( + GetValidationsEmailJobsJobId200Response, +) +from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs_job_id200_response_result import ( + GetValidationsEmailJobsJobId200ResponseResult, +) +from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs_job_id200_response_result_errors_inner import ( + GetValidationsEmailJobsJobId200ResponseResultErrorsInner, +) +from sendgrid.rest.api.email_validation.v3.models.list_email_job_for_verification_request import ( + ListEmailJobForVerificationRequest, +) +from sendgrid.rest.api.email_validation.v3.models.put_validations_email_jobs200_response import ( + PutValidationsEmailJobs200Response, +) +from sendgrid.rest.api.email_validation.v3.models.put_validations_email_jobs200_response_upload_headers_inner import ( + PutValidationsEmailJobs200ResponseUploadHeadersInner, +) from sendgrid.rest.api.email_validation.v3.models.status import Status from sendgrid.rest.api.email_validation.v3.models.status1 import Status1 -from sendgrid.rest.api.email_validation.v3.models.validate_email200_response import ValidateEmail200Response -from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result import ValidateEmail200ResponseResult -from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks import ValidateEmail200ResponseResultChecks -from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks_additional import ValidateEmail200ResponseResultChecksAdditional -from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks_domain import ValidateEmail200ResponseResultChecksDomain -from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks_local_part import ValidateEmail200ResponseResultChecksLocalPart -from sendgrid.rest.api.email_validation.v3.models.validate_email_request import ValidateEmailRequest +from sendgrid.rest.api.email_validation.v3.models.validate_email200_response import ( + ValidateEmail200Response, +) +from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result import ( + ValidateEmail200ResponseResult, +) +from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks import ( + ValidateEmail200ResponseResultChecks, +) +from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks_additional import ( + ValidateEmail200ResponseResultChecksAdditional, +) +from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks_domain import ( + ValidateEmail200ResponseResultChecksDomain, +) +from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks_local_part import ( + ValidateEmail200ResponseResultChecksLocalPart, +) +from sendgrid.rest.api.email_validation.v3.models.validate_email_request import ( + ValidateEmailRequest, +) from sendgrid.rest.api.email_validation.v3.models.verdict import Verdict -__all__ = [ 'ErrorResponse', 'ErrorResponseErrorsInner', 'FileType', 'GetValidationsEmailJobs200Response', 'GetValidationsEmailJobs200ResponseResultInner', 'GetValidationsEmailJobsJobId200Response', 'GetValidationsEmailJobsJobId200ResponseResult', 'GetValidationsEmailJobsJobId200ResponseResultErrorsInner', 'ListEmailJobForVerificationRequest', 'PutValidationsEmailJobs200Response', 'PutValidationsEmailJobs200ResponseUploadHeadersInner', 'Status', 'Status1', 'ValidateEmail200Response', 'ValidateEmail200ResponseResult', 'ValidateEmail200ResponseResultChecks', 'ValidateEmail200ResponseResultChecksAdditional', 'ValidateEmail200ResponseResultChecksDomain', 'ValidateEmail200ResponseResultChecksLocalPart', 'ValidateEmailRequest', 'Verdict' ] -# Testing code \ No newline at end of file + +__all__ = [ + "ErrorResponse", + "ErrorResponseErrorsInner", + "FileType", + "GetValidationsEmailJobs200Response", + "GetValidationsEmailJobs200ResponseResultInner", + "GetValidationsEmailJobsJobId200Response", + "GetValidationsEmailJobsJobId200ResponseResult", + "GetValidationsEmailJobsJobId200ResponseResultErrorsInner", + "ListEmailJobForVerificationRequest", + "PutValidationsEmailJobs200Response", + "PutValidationsEmailJobs200ResponseUploadHeadersInner", + "Status", + "Status1", + "ValidateEmail200Response", + "ValidateEmail200ResponseResult", + "ValidateEmail200ResponseResultChecks", + "ValidateEmail200ResponseResultChecksAdditional", + "ValidateEmail200ResponseResultChecksDomain", + "ValidateEmail200ResponseResultChecksLocalPart", + "ValidateEmailRequest", + "Verdict", +] +# Testing code diff --git a/sendgrid/rest/api/email_validation/v3/models/error_response.py b/sendgrid/rest/api/email_validation/v3/models/error_response.py index d49ad74f..c18d08ba 100644 --- a/sendgrid/rest/api/email_validation/v3/models/error_response.py +++ b/sendgrid/rest/api/email_validation/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.email_validation.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.email_validation.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/email_validation/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/email_validation/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/email_validation/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/email_validation/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/email_validation/v3/models/file_type.py b/sendgrid/rest/api/email_validation/v3/models/file_type.py index 0483910a..3a18dabb 100644 --- a/sendgrid/rest/api/email_validation/v3/models/file_type.py +++ b/sendgrid/rest/api/email_validation/v3/models/file_type.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class FileType(Enum): - CSV='csv' - ZIP='zip' - + CSV = "csv" + ZIP = "zip" diff --git a/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs200_response.py b/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs200_response.py index 0ea8168e..7ad211e1 100644 --- a/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs200_response.py +++ b/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs200_response.py @@ -1,23 +1,23 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs200_response_result_inner import GetValidationsEmailJobs200ResponseResultInner - +from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs200_response_result_inner import ( + GetValidationsEmailJobs200ResponseResultInner, +) class GetValidationsEmailJobs200Response: def __init__( - self, - result: Optional[List[GetValidationsEmailJobs200ResponseResultInner]]=None + self, + result: Optional[List[GetValidationsEmailJobs200ResponseResultInner]] = None, ): - self.result=result + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +25,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetValidationsEmailJobs200Response( - result=payload.get('result') - ) - + return GetValidationsEmailJobs200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs200_response_result_inner.py b/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs200_response_result_inner.py index a456bc6b..ca80c838 100644 --- a/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs200_response_result_inner.py +++ b/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs200_response_result_inner.py @@ -1,32 +1,32 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.email_validation.v3.models.status import Status - class GetValidationsEmailJobs200ResponseResultInner: def __init__( - self, - id: Optional[str]=None, - status: Optional[Status]=None, - started_at: Optional[float]=None, - finished_at: Optional[float]=None + self, + id: Optional[str] = None, + status: Optional[Status] = None, + started_at: Optional[float] = None, + finished_at: Optional[float] = None, ): - self.id=id - self.status=status - self.started_at=started_at - self.finished_at=finished_at + self.id = id + self.status = status + self.started_at = started_at + self.finished_at = finished_at def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "status": self.status, - "started_at": self.started_at, - "finished_at": self.finished_at - }.items() if value is not None} + "id": self.id, + "status": self.status, + "started_at": self.started_at, + "finished_at": self.finished_at, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -35,9 +35,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetValidationsEmailJobs200ResponseResultInner( - id=payload.get('id'), - status=payload.get('status'), - started_at=payload.get('started_at'), - finished_at=payload.get('finished_at') - ) - + id=payload.get("id"), + status=payload.get("status"), + started_at=payload.get("started_at"), + finished_at=payload.get("finished_at"), + ) diff --git a/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs_job_id200_response.py b/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs_job_id200_response.py index b31df6d4..5b3b8a79 100644 --- a/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs_job_id200_response.py +++ b/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs_job_id200_response.py @@ -1,23 +1,22 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs_job_id200_response_result import GetValidationsEmailJobsJobId200ResponseResult - +from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs_job_id200_response_result import ( + GetValidationsEmailJobsJobId200ResponseResult, +) class GetValidationsEmailJobsJobId200Response: def __init__( - self, - result: Optional[GetValidationsEmailJobsJobId200ResponseResult]=None + self, result: Optional[GetValidationsEmailJobsJobId200ResponseResult] = None ): - self.result=result + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetValidationsEmailJobsJobId200Response( - result=payload.get('result') - ) - + return GetValidationsEmailJobsJobId200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs_job_id200_response_result.py b/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs_job_id200_response_result.py index 638dcf1b..86524246 100644 --- a/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs_job_id200_response_result.py +++ b/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs_job_id200_response_result.py @@ -1,45 +1,49 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs_job_id200_response_result_errors_inner import GetValidationsEmailJobsJobId200ResponseResultErrorsInner +from sendgrid.rest.api.email_validation.v3.models.get_validations_email_jobs_job_id200_response_result_errors_inner import ( + GetValidationsEmailJobsJobId200ResponseResultErrorsInner, +) from sendgrid.rest.api.email_validation.v3.models.status1 import Status1 - class GetValidationsEmailJobsJobId200ResponseResult: def __init__( - self, - id: Optional[str]=None, - status: Optional[Status1]=None, - segments: Optional[float]=None, - segments_processed: Optional[float]=None, - is_download_available: Optional[bool]=None, - started_at: Optional[float]=None, - finished_at: Optional[float]=None, - errors: Optional[List[GetValidationsEmailJobsJobId200ResponseResultErrorsInner]]=None + self, + id: Optional[str] = None, + status: Optional[Status1] = None, + segments: Optional[float] = None, + segments_processed: Optional[float] = None, + is_download_available: Optional[bool] = None, + started_at: Optional[float] = None, + finished_at: Optional[float] = None, + errors: Optional[ + List[GetValidationsEmailJobsJobId200ResponseResultErrorsInner] + ] = None, ): - self.id=id - self.status=status - self.segments=segments - self.segments_processed=segments_processed - self.is_download_available=is_download_available - self.started_at=started_at - self.finished_at=finished_at - self.errors=errors + self.id = id + self.status = status + self.segments = segments + self.segments_processed = segments_processed + self.is_download_available = is_download_available + self.started_at = started_at + self.finished_at = finished_at + self.errors = errors def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "status": self.status, - "segments": self.segments, - "segments_processed": self.segments_processed, - "is_download_available": self.is_download_available, - "started_at": self.started_at, - "finished_at": self.finished_at, - "errors": self.errors - }.items() if value is not None} + "id": self.id, + "status": self.status, + "segments": self.segments, + "segments_processed": self.segments_processed, + "is_download_available": self.is_download_available, + "started_at": self.started_at, + "finished_at": self.finished_at, + "errors": self.errors, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -48,13 +52,12 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetValidationsEmailJobsJobId200ResponseResult( - id=payload.get('id'), - status=payload.get('status'), - segments=payload.get('segments'), - segments_processed=payload.get('segments_processed'), - is_download_available=payload.get('is_download_available'), - started_at=payload.get('started_at'), - finished_at=payload.get('finished_at'), - errors=payload.get('errors') - ) - + id=payload.get("id"), + status=payload.get("status"), + segments=payload.get("segments"), + segments_processed=payload.get("segments_processed"), + is_download_available=payload.get("is_download_available"), + started_at=payload.get("started_at"), + finished_at=payload.get("finished_at"), + errors=payload.get("errors"), + ) diff --git a/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs_job_id200_response_result_errors_inner.py b/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs_job_id200_response_result_errors_inner.py index 0e1aa8b3..9294889e 100644 --- a/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs_job_id200_response_result_errors_inner.py +++ b/sendgrid/rest/api/email_validation/v3/models/get_validations_email_jobs_job_id200_response_result_errors_inner.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GetValidationsEmailJobsJobId200ResponseResultErrorsInner: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,6 +20,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetValidationsEmailJobsJobId200ResponseResultErrorsInner( - message=payload.get('message') - ) - + message=payload.get("message") + ) diff --git a/sendgrid/rest/api/email_validation/v3/models/list_email_job_for_verification_request.py b/sendgrid/rest/api/email_validation/v3/models/list_email_job_for_verification_request.py index 7f8dc73b..0e607bfb 100644 --- a/sendgrid/rest/api/email_validation/v3/models/list_email_job_for_verification_request.py +++ b/sendgrid/rest/api/email_validation/v3/models/list_email_job_for_verification_request.py @@ -1,23 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.email_validation.v3.models.file_type import FileType - class ListEmailJobForVerificationRequest: - def __init__( - self, - file_type: Optional[FileType]=None - ): - self.file_type=file_type + def __init__(self, file_type: Optional[FileType] = None): + self.file_type = file_type def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "file_type": self.file_type - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"file_type": self.file_type}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListEmailJobForVerificationRequest( - file_type=payload.get('file_type') - ) - + return ListEmailJobForVerificationRequest(file_type=payload.get("file_type")) diff --git a/sendgrid/rest/api/email_validation/v3/models/put_validations_email_jobs200_response.py b/sendgrid/rest/api/email_validation/v3/models/put_validations_email_jobs200_response.py index 7aacb0e0..bb3997db 100644 --- a/sendgrid/rest/api/email_validation/v3/models/put_validations_email_jobs200_response.py +++ b/sendgrid/rest/api/email_validation/v3/models/put_validations_email_jobs200_response.py @@ -1,29 +1,33 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.email_validation.v3.models.put_validations_email_jobs200_response_upload_headers_inner import PutValidationsEmailJobs200ResponseUploadHeadersInner - +from sendgrid.rest.api.email_validation.v3.models.put_validations_email_jobs200_response_upload_headers_inner import ( + PutValidationsEmailJobs200ResponseUploadHeadersInner, +) class PutValidationsEmailJobs200Response: def __init__( - self, - job_id: Optional[str]=None, - upload_uri: Optional[str]=None, - upload_headers: Optional[List[PutValidationsEmailJobs200ResponseUploadHeadersInner]]=None + self, + job_id: Optional[str] = None, + upload_uri: Optional[str] = None, + upload_headers: Optional[ + List[PutValidationsEmailJobs200ResponseUploadHeadersInner] + ] = None, ): - self.job_id=job_id - self.upload_uri=upload_uri - self.upload_headers=upload_headers + self.job_id = job_id + self.upload_uri = upload_uri + self.upload_headers = upload_headers def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "job_id": self.job_id, - "upload_uri": self.upload_uri, - "upload_headers": self.upload_headers - }.items() if value is not None} + "job_id": self.job_id, + "upload_uri": self.upload_uri, + "upload_headers": self.upload_headers, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +36,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return PutValidationsEmailJobs200Response( - job_id=payload.get('job_id'), - upload_uri=payload.get('upload_uri'), - upload_headers=payload.get('upload_headers') - ) - + job_id=payload.get("job_id"), + upload_uri=payload.get("upload_uri"), + upload_headers=payload.get("upload_headers"), + ) diff --git a/sendgrid/rest/api/email_validation/v3/models/put_validations_email_jobs200_response_upload_headers_inner.py b/sendgrid/rest/api/email_validation/v3/models/put_validations_email_jobs200_response_upload_headers_inner.py index ee097cbc..090c143a 100644 --- a/sendgrid/rest/api/email_validation/v3/models/put_validations_email_jobs200_response_upload_headers_inner.py +++ b/sendgrid/rest/api/email_validation/v3/models/put_validations_email_jobs200_response_upload_headers_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class PutValidationsEmailJobs200ResponseUploadHeadersInner: - def __init__( - self, - header: Optional[str]=None, - value: Optional[str]=None - ): - self.header=header - self.value=value + def __init__(self, header: Optional[str] = None, value: Optional[str] = None): + self.header = header + self.value = value def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "header": self.header, - "value": self.value - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"header": self.header, "value": self.value}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return PutValidationsEmailJobs200ResponseUploadHeadersInner( - header=payload.get('header'), - value=payload.get('value') - ) - + header=payload.get("header"), value=payload.get("value") + ) diff --git a/sendgrid/rest/api/email_validation/v3/models/status.py b/sendgrid/rest/api/email_validation/v3/models/status.py index 5ab2677f..8c2f08b9 100644 --- a/sendgrid/rest/api/email_validation/v3/models/status.py +++ b/sendgrid/rest/api/email_validation/v3/models/status.py @@ -1,15 +1,11 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Status(Enum): - INITIATED='Initiated' - QUEUED='Queued' - READY='Ready' - PROCESSING='Processing' - DONE='Done' - ERROR='Error' - + INITIATED = "Initiated" + QUEUED = "Queued" + READY = "Ready" + PROCESSING = "Processing" + DONE = "Done" + ERROR = "Error" diff --git a/sendgrid/rest/api/email_validation/v3/models/status1.py b/sendgrid/rest/api/email_validation/v3/models/status1.py index 77caacff..832b9980 100644 --- a/sendgrid/rest/api/email_validation/v3/models/status1.py +++ b/sendgrid/rest/api/email_validation/v3/models/status1.py @@ -1,15 +1,11 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Status1(Enum): - INITIATED='Initiated' - QUEUED='Queued' - READY='Ready' - PROCESSING='Processing' - DONE='Done' - ERROR='Error' - + INITIATED = "Initiated" + QUEUED = "Queued" + READY = "Ready" + PROCESSING = "Processing" + DONE = "Done" + ERROR = "Error" diff --git a/sendgrid/rest/api/email_validation/v3/models/validate_email200_response.py b/sendgrid/rest/api/email_validation/v3/models/validate_email200_response.py index b5dbdbe6..e79d63b8 100644 --- a/sendgrid/rest/api/email_validation/v3/models/validate_email200_response.py +++ b/sendgrid/rest/api/email_validation/v3/models/validate_email200_response.py @@ -1,23 +1,20 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result import ValidateEmail200ResponseResult - +from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result import ( + ValidateEmail200ResponseResult, +) class ValidateEmail200Response: - def __init__( - self, - result: Optional[ValidateEmail200ResponseResult]=None - ): - self.result=result + def __init__(self, result: Optional[ValidateEmail200ResponseResult] = None): + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ValidateEmail200Response( - result=payload.get('result') - ) - + return ValidateEmail200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result.py b/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result.py index 8345e9df..0bb5e39b 100644 --- a/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result.py +++ b/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result.py @@ -1,48 +1,50 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks import ValidateEmail200ResponseResultChecks +from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks import ( + ValidateEmail200ResponseResultChecks, +) from sendgrid.rest.api.email_validation.v3.models.verdict import Verdict - class ValidateEmail200ResponseResult: def __init__( - self, - email: Optional[str]=None, - verdict: Optional[Verdict]=None, - score: Optional[float]=None, - local: Optional[str]=None, - host: Optional[str]=None, - suggestion: Optional[str]=None, - checks: Optional[ValidateEmail200ResponseResultChecks]=None, - source: Optional[str]=None, - ip_address: Optional[str]=None + self, + email: Optional[str] = None, + verdict: Optional[Verdict] = None, + score: Optional[float] = None, + local: Optional[str] = None, + host: Optional[str] = None, + suggestion: Optional[str] = None, + checks: Optional[ValidateEmail200ResponseResultChecks] = None, + source: Optional[str] = None, + ip_address: Optional[str] = None, ): - self.email=email - self.verdict=verdict - self.score=score - self.local=local - self.host=host - self.suggestion=suggestion - self.checks=checks - self.source=source - self.ip_address=ip_address + self.email = email + self.verdict = verdict + self.score = score + self.local = local + self.host = host + self.suggestion = suggestion + self.checks = checks + self.source = source + self.ip_address = ip_address def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "email": self.email, - "verdict": self.verdict, - "score": self.score, - "local": self.local, - "host": self.host, - "suggestion": self.suggestion, - "checks": self.checks, - "source": self.source, - "ip_address": self.ip_address - }.items() if value is not None} + "email": self.email, + "verdict": self.verdict, + "score": self.score, + "local": self.local, + "host": self.host, + "suggestion": self.suggestion, + "checks": self.checks, + "source": self.source, + "ip_address": self.ip_address, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -51,14 +53,13 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateEmail200ResponseResult( - email=payload.get('email'), - verdict=payload.get('verdict'), - score=payload.get('score'), - local=payload.get('local'), - host=payload.get('host'), - suggestion=payload.get('suggestion'), - checks=payload.get('checks'), - source=payload.get('source'), - ip_address=payload.get('ip_address') - ) - + email=payload.get("email"), + verdict=payload.get("verdict"), + score=payload.get("score"), + local=payload.get("local"), + host=payload.get("host"), + suggestion=payload.get("suggestion"), + checks=payload.get("checks"), + source=payload.get("source"), + ip_address=payload.get("ip_address"), + ) diff --git a/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks.py b/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks.py index abe872f6..b6163bbd 100644 --- a/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks.py +++ b/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks.py @@ -1,31 +1,37 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks_additional import ValidateEmail200ResponseResultChecksAdditional -from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks_domain import ValidateEmail200ResponseResultChecksDomain -from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks_local_part import ValidateEmail200ResponseResultChecksLocalPart - +from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks_additional import ( + ValidateEmail200ResponseResultChecksAdditional, +) +from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks_domain import ( + ValidateEmail200ResponseResultChecksDomain, +) +from sendgrid.rest.api.email_validation.v3.models.validate_email200_response_result_checks_local_part import ( + ValidateEmail200ResponseResultChecksLocalPart, +) class ValidateEmail200ResponseResultChecks: def __init__( - self, - domain: Optional[ValidateEmail200ResponseResultChecksDomain]=None, - local_part: Optional[ValidateEmail200ResponseResultChecksLocalPart]=None, - additional: Optional[ValidateEmail200ResponseResultChecksAdditional]=None + self, + domain: Optional[ValidateEmail200ResponseResultChecksDomain] = None, + local_part: Optional[ValidateEmail200ResponseResultChecksLocalPart] = None, + additional: Optional[ValidateEmail200ResponseResultChecksAdditional] = None, ): - self.domain=domain - self.local_part=local_part - self.additional=additional + self.domain = domain + self.local_part = local_part + self.additional = additional def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "domain": self.domain, - "local_part": self.local_part, - "additional": self.additional - }.items() if value is not None} + "domain": self.domain, + "local_part": self.local_part, + "additional": self.additional, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,8 +40,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateEmail200ResponseResultChecks( - domain=payload.get('domain'), - local_part=payload.get('local_part'), - additional=payload.get('additional') - ) - + domain=payload.get("domain"), + local_part=payload.get("local_part"), + additional=payload.get("additional"), + ) diff --git a/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks_additional.py b/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks_additional.py index c45150a6..1780941b 100644 --- a/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks_additional.py +++ b/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks_additional.py @@ -1,25 +1,25 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ValidateEmail200ResponseResultChecksAdditional: def __init__( - self, - has_known_bounces: Optional[bool]=None, - has_suspected_bounces: Optional[bool]=None + self, + has_known_bounces: Optional[bool] = None, + has_suspected_bounces: Optional[bool] = None, ): - self.has_known_bounces=has_known_bounces - self.has_suspected_bounces=has_suspected_bounces + self.has_known_bounces = has_known_bounces + self.has_suspected_bounces = has_suspected_bounces def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "has_known_bounces": self.has_known_bounces, - "has_suspected_bounces": self.has_suspected_bounces - }.items() if value is not None} + "has_known_bounces": self.has_known_bounces, + "has_suspected_bounces": self.has_suspected_bounces, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +28,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateEmail200ResponseResultChecksAdditional( - has_known_bounces=payload.get('has_known_bounces'), - has_suspected_bounces=payload.get('has_suspected_bounces') - ) - + has_known_bounces=payload.get("has_known_bounces"), + has_suspected_bounces=payload.get("has_suspected_bounces"), + ) diff --git a/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks_domain.py b/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks_domain.py index 96da2603..fb7a3286 100644 --- a/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks_domain.py +++ b/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks_domain.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ValidateEmail200ResponseResultChecksDomain: def __init__( - self, - has_valid_address_syntax: Optional[bool]=None, - has_mx_or_a_record: Optional[bool]=None, - is_suspected_disposable_address: Optional[bool]=None + self, + has_valid_address_syntax: Optional[bool] = None, + has_mx_or_a_record: Optional[bool] = None, + is_suspected_disposable_address: Optional[bool] = None, ): - self.has_valid_address_syntax=has_valid_address_syntax - self.has_mx_or_a_record=has_mx_or_a_record - self.is_suspected_disposable_address=is_suspected_disposable_address + self.has_valid_address_syntax = has_valid_address_syntax + self.has_mx_or_a_record = has_mx_or_a_record + self.is_suspected_disposable_address = is_suspected_disposable_address def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "has_valid_address_syntax": self.has_valid_address_syntax, - "has_mx_or_a_record": self.has_mx_or_a_record, - "is_suspected_disposable_address": self.is_suspected_disposable_address - }.items() if value is not None} + "has_valid_address_syntax": self.has_valid_address_syntax, + "has_mx_or_a_record": self.has_mx_or_a_record, + "is_suspected_disposable_address": self.is_suspected_disposable_address, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateEmail200ResponseResultChecksDomain( - has_valid_address_syntax=payload.get('has_valid_address_syntax'), - has_mx_or_a_record=payload.get('has_mx_or_a_record'), - is_suspected_disposable_address=payload.get('is_suspected_disposable_address') - ) - + has_valid_address_syntax=payload.get("has_valid_address_syntax"), + has_mx_or_a_record=payload.get("has_mx_or_a_record"), + is_suspected_disposable_address=payload.get( + "is_suspected_disposable_address" + ), + ) diff --git a/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks_local_part.py b/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks_local_part.py index 90f2407c..3ad81ce1 100644 --- a/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks_local_part.py +++ b/sendgrid/rest/api/email_validation/v3/models/validate_email200_response_result_checks_local_part.py @@ -1,22 +1,19 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ValidateEmail200ResponseResultChecksLocalPart: - def __init__( - self, - is_suspected_role_address: Optional[bool]=None - ): - self.is_suspected_role_address=is_suspected_role_address + def __init__(self, is_suspected_role_address: Optional[bool] = None): + self.is_suspected_role_address = is_suspected_role_address def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "is_suspected_role_address": self.is_suspected_role_address - }.items() if value is not None} + "is_suspected_role_address": self.is_suspected_role_address + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,6 +22,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateEmail200ResponseResultChecksLocalPart( - is_suspected_role_address=payload.get('is_suspected_role_address') - ) - + is_suspected_role_address=payload.get("is_suspected_role_address") + ) diff --git a/sendgrid/rest/api/email_validation/v3/models/validate_email_request.py b/sendgrid/rest/api/email_validation/v3/models/validate_email_request.py index d0071001..2a28f268 100644 --- a/sendgrid/rest/api/email_validation/v3/models/validate_email_request.py +++ b/sendgrid/rest/api/email_validation/v3/models/validate_email_request.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ValidateEmailRequest: - def __init__( - self, - email: Optional[str]=None, - source: Optional[str]=None - ): - self.email=email - self.source=source + def __init__(self, email: Optional[str] = None, source: Optional[str] = None): + self.email = email + self.source = source def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email, - "source": self.source - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email, "source": self.source}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateEmailRequest( - email=payload.get('email'), - source=payload.get('source') - ) - + email=payload.get("email"), source=payload.get("source") + ) diff --git a/sendgrid/rest/api/email_validation/v3/models/verdict.py b/sendgrid/rest/api/email_validation/v3/models/verdict.py index 6f1d0ec7..4ef9941b 100644 --- a/sendgrid/rest/api/email_validation/v3/models/verdict.py +++ b/sendgrid/rest/api/email_validation/v3/models/verdict.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Verdict(Enum): - VALID='Valid' - RISKY='Risky' - INVALID='Invalid' - + VALID = "Valid" + RISKY = "Risky" + INVALID = "Invalid" diff --git a/sendgrid/rest/api/email_validation/v3/validate_email.py b/sendgrid/rest/api/email_validation/v3/validate_email.py index f5b48c17..e9478ad9 100644 --- a/sendgrid/rest/api/email_validation/v3/validate_email.py +++ b/sendgrid/rest/api/email_validation/v3/validate_email.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.email_validation.v3.models.validate_email200_response import ValidateEmail200Response -from sendgrid.rest.api.email_validation.v3.models.validate_email_request import ValidateEmailRequest +from sendgrid.rest.api.email_validation.v3.models.validate_email_request import ( + ValidateEmailRequest, +) + class ValidateEmail: def __init__(self, client) -> None: self.client = client - + def send( self, - validate_email_request: Optional[ValidateEmailRequest] = None, - + validate_email_request: Optional[ValidateEmailRequest] = None, ): - path='/v3/validations/email' + path = "/v3/validations/email" data = None if validate_email_request: data = validate_email_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/enforced_tls/v3/__init__.py b/sendgrid/rest/api/enforced_tls/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/enforced_tls/v3/__init__.py +++ b/sendgrid/rest/api/enforced_tls/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/enforced_tls/v3/list_enforced_tls_setting.py b/sendgrid/rest/api/enforced_tls/v3/list_enforced_tls_setting.py index 7d0566a0..e8a09c8b 100644 --- a/sendgrid/rest/api/enforced_tls/v3/list_enforced_tls_setting.py +++ b/sendgrid/rest/api/enforced_tls/v3/list_enforced_tls_setting.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.enforced_tls.v3.models.enforced_tls_request_response import EnforcedTlsRequestResponse + class ListEnforcedTlsSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/user/settings/enforced_tls' + path = "/v3/user/settings/enforced_tls" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/enforced_tls/v3/models/__init__.py b/sendgrid/rest/api/enforced_tls/v3/models/__init__.py index fa54e3f4..7be2a73e 100644 --- a/sendgrid/rest/api/enforced_tls/v3/models/__init__.py +++ b/sendgrid/rest/api/enforced_tls/v3/models/__init__.py @@ -11,11 +11,20 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.enforced_tls.v3.models.enforced_tls_request_response import EnforcedTlsRequestResponse +from sendgrid.rest.api.enforced_tls.v3.models.enforced_tls_request_response import ( + EnforcedTlsRequestResponse, +) from sendgrid.rest.api.enforced_tls.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.enforced_tls.v3.models.error_response_errors_inner import ErrorResponseErrorsInner +from sendgrid.rest.api.enforced_tls.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) from sendgrid.rest.api.enforced_tls.v3.models.version import Version -__all__ = [ 'EnforcedTlsRequestResponse', 'ErrorResponse', 'ErrorResponseErrorsInner', 'Version' ] -# Testing code \ No newline at end of file + +__all__ = [ + "EnforcedTlsRequestResponse", + "ErrorResponse", + "ErrorResponseErrorsInner", + "Version", +] +# Testing code diff --git a/sendgrid/rest/api/enforced_tls/v3/models/enforced_tls_request_response.py b/sendgrid/rest/api/enforced_tls/v3/models/enforced_tls_request_response.py index 736765ce..7e51e61d 100644 --- a/sendgrid/rest/api/enforced_tls/v3/models/enforced_tls_request_response.py +++ b/sendgrid/rest/api/enforced_tls/v3/models/enforced_tls_request_response.py @@ -1,29 +1,29 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.enforced_tls.v3.models.version import Version - class EnforcedTlsRequestResponse: def __init__( - self, - require_tls: Optional[bool]=None, - require_valid_cert: Optional[bool]=None, - version: Optional[Version]=None + self, + require_tls: Optional[bool] = None, + require_valid_cert: Optional[bool] = None, + version: Optional[Version] = None, ): - self.require_tls=require_tls - self.require_valid_cert=require_valid_cert - self.version=version + self.require_tls = require_tls + self.require_valid_cert = require_valid_cert + self.version = version def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "require_tls": self.require_tls, - "require_valid_cert": self.require_valid_cert, - "version": self.version - }.items() if value is not None} + "require_tls": self.require_tls, + "require_valid_cert": self.require_valid_cert, + "version": self.version, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +32,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return EnforcedTlsRequestResponse( - require_tls=payload.get('require_tls'), - require_valid_cert=payload.get('require_valid_cert'), - version=payload.get('version') - ) - + require_tls=payload.get("require_tls"), + require_valid_cert=payload.get("require_valid_cert"), + version=payload.get("version"), + ) diff --git a/sendgrid/rest/api/enforced_tls/v3/models/error_response.py b/sendgrid/rest/api/enforced_tls/v3/models/error_response.py index 80d01f6f..b7b92c1b 100644 --- a/sendgrid/rest/api/enforced_tls/v3/models/error_response.py +++ b/sendgrid/rest/api/enforced_tls/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.enforced_tls.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.enforced_tls.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/enforced_tls/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/enforced_tls/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/enforced_tls/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/enforced_tls/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/enforced_tls/v3/update_enforced_tls_setting.py b/sendgrid/rest/api/enforced_tls/v3/update_enforced_tls_setting.py index d847c226..0f38db15 100644 --- a/sendgrid/rest/api/enforced_tls/v3/update_enforced_tls_setting.py +++ b/sendgrid/rest/api/enforced_tls/v3/update_enforced_tls_setting.py @@ -12,54 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.enforced_tls.v3.models.enforced_tls_request_response import EnforcedTlsRequestResponse +from sendgrid.rest.api.enforced_tls.v3.models.enforced_tls_request_response import ( + EnforcedTlsRequestResponse, +) + class UpdateEnforcedTlsSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - enforced_tls_request_response: Optional[EnforcedTlsRequestResponse] = None, - + on_behalf_of: Optional[str] = None, + enforced_tls_request_response: Optional[EnforcedTlsRequestResponse] = None, ): - path='/v3/user/settings/enforced_tls' + path = "/v3/user/settings/enforced_tls" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if enforced_tls_request_response: data = enforced_tls_request_response.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/integrations/v3/__init__.py b/sendgrid/rest/api/integrations/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/integrations/v3/__init__.py +++ b/sendgrid/rest/api/integrations/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/integrations/v3/add_integration.py b/sendgrid/rest/api/integrations/v3/add_integration.py index c747c0ef..c5471c33 100644 --- a/sendgrid/rest/api/integrations/v3/add_integration.py +++ b/sendgrid/rest/api/integrations/v3/add_integration.py @@ -12,46 +12,43 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from sendgrid.rest.api.integrations.v3.models.integration import Integration from sendgrid.rest.api.integrations.v3.models.integration_input import IntegrationInput + class AddIntegration: def __init__(self, client) -> None: self.client = client - + def send( self, - integration_input: Optional[IntegrationInput] = None, - + integration_input: Optional[IntegrationInput] = None, ): - path='/v3/marketing/integrations' + path = "/v3/marketing/integrations" data = None if integration_input: data = integration_input.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/integrations/v3/delete_integration.py b/sendgrid/rest/api/integrations/v3/delete_integration.py index 2fa5de30..7fa999e0 100644 --- a/sendgrid/rest/api/integrations/v3/delete_integration.py +++ b/sendgrid/rest/api/integrations/v3/delete_integration.py @@ -12,46 +12,42 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import List, Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field from typing import List -from typing_extensions import Annotated from sendgrid.rest.api.integrations.v3.models.id import Id + class DeleteIntegration: def __init__(self, client) -> None: self.client = client - + def send( self, - ids: Optional[List[Id]] = None, - + ids: Optional[List[Id]] = None, ): - path='/v3/marketing/integrations' + path = "/v3/marketing/integrations" data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/integrations/v3/find_integration_by_id.py b/sendgrid/rest/api/integrations/v3/find_integration_by_id.py index 4e71ce2a..b9d247b9 100644 --- a/sendgrid/rest/api/integrations/v3/find_integration_by_id.py +++ b/sendgrid/rest/api/integrations/v3/find_integration_by_id.py @@ -12,48 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.integrations.v3.models.integration import Integration class FindIntegrationById: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - + id: str, ): - path='/v3/marketing/integrations/{id}' + path = "/v3/marketing/integrations/{id}" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/integrations/v3/get_integrations_by_user.py b/sendgrid/rest/api/integrations/v3/get_integrations_by_user.py index 2e6a2a1e..0a9c331f 100644 --- a/sendgrid/rest/api/integrations/v3/get_integrations_by_user.py +++ b/sendgrid/rest/api/integrations/v3/get_integrations_by_user.py @@ -12,42 +12,37 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from sendgrid.rest.api.integrations.v3.models.get_integrations_by_user200_response import GetIntegrationsByUser200Response class GetIntegrationsByUser: def __init__(self, client) -> None: self.client = client - + def send( self, - ): - path='/v3/marketing/integrations' + path = "/v3/marketing/integrations" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/integrations/v3/models/__init__.py b/sendgrid/rest/api/integrations/v3/models/__init__.py index e52cdb65..84f8ddfe 100644 --- a/sendgrid/rest/api/integrations/v3/models/__init__.py +++ b/sendgrid/rest/api/integrations/v3/models/__init__.py @@ -11,38 +11,104 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.integrations.v3.models.add_integration400_response import AddIntegration400Response -from sendgrid.rest.api.integrations.v3.models.delete_integration400_response import DeleteIntegration400Response -from sendgrid.rest.api.integrations.v3.models.delete_integration404_response import DeleteIntegration404Response +from sendgrid.rest.api.integrations.v3.models.add_integration400_response import ( + AddIntegration400Response, +) +from sendgrid.rest.api.integrations.v3.models.delete_integration400_response import ( + DeleteIntegration400Response, +) +from sendgrid.rest.api.integrations.v3.models.delete_integration404_response import ( + DeleteIntegration404Response, +) from sendgrid.rest.api.integrations.v3.models.destination import Destination from sendgrid.rest.api.integrations.v3.models.destination1 import Destination1 from sendgrid.rest.api.integrations.v3.models.destination2 import Destination2 from sendgrid.rest.api.integrations.v3.models.destination3 import Destination3 -from sendgrid.rest.api.integrations.v3.models.destination_region import DestinationRegion -from sendgrid.rest.api.integrations.v3.models.destination_region1 import DestinationRegion1 -from sendgrid.rest.api.integrations.v3.models.destination_region2 import DestinationRegion2 +from sendgrid.rest.api.integrations.v3.models.destination_region import ( + DestinationRegion, +) +from sendgrid.rest.api.integrations.v3.models.destination_region1 import ( + DestinationRegion1, +) +from sendgrid.rest.api.integrations.v3.models.destination_region2 import ( + DestinationRegion2, +) from sendgrid.rest.api.integrations.v3.models.forbidden import Forbidden -from sendgrid.rest.api.integrations.v3.models.get_integrations_by_user200_response import GetIntegrationsByUser200Response -from sendgrid.rest.api.integrations.v3.models.get_integrations_by_user403_response import GetIntegrationsByUser403Response -from sendgrid.rest.api.integrations.v3.models.get_integrations_by_user500_response import GetIntegrationsByUser500Response +from sendgrid.rest.api.integrations.v3.models.get_integrations_by_user200_response import ( + GetIntegrationsByUser200Response, +) +from sendgrid.rest.api.integrations.v3.models.get_integrations_by_user403_response import ( + GetIntegrationsByUser403Response, +) +from sendgrid.rest.api.integrations.v3.models.get_integrations_by_user500_response import ( + GetIntegrationsByUser500Response, +) from sendgrid.rest.api.integrations.v3.models.id import Id from sendgrid.rest.api.integrations.v3.models.integration import Integration -from sendgrid.rest.api.integrations.v3.models.integration_filters import IntegrationFilters +from sendgrid.rest.api.integrations.v3.models.integration_filters import ( + IntegrationFilters, +) from sendgrid.rest.api.integrations.v3.models.integration_input import IntegrationInput -from sendgrid.rest.api.integrations.v3.models.integration_input_filters import IntegrationInputFilters -from sendgrid.rest.api.integrations.v3.models.integration_input_properties import IntegrationInputProperties -from sendgrid.rest.api.integrations.v3.models.integration_not_found import IntegrationNotFound +from sendgrid.rest.api.integrations.v3.models.integration_input_filters import ( + IntegrationInputFilters, +) +from sendgrid.rest.api.integrations.v3.models.integration_input_properties import ( + IntegrationInputProperties, +) +from sendgrid.rest.api.integrations.v3.models.integration_not_found import ( + IntegrationNotFound, +) from sendgrid.rest.api.integrations.v3.models.integration_patch import IntegrationPatch -from sendgrid.rest.api.integrations.v3.models.integration_patch_filters import IntegrationPatchFilters -from sendgrid.rest.api.integrations.v3.models.integration_patch_properties import IntegrationPatchProperties -from sendgrid.rest.api.integrations.v3.models.integration_properties import IntegrationProperties +from sendgrid.rest.api.integrations.v3.models.integration_patch_filters import ( + IntegrationPatchFilters, +) +from sendgrid.rest.api.integrations.v3.models.integration_patch_properties import ( + IntegrationPatchProperties, +) +from sendgrid.rest.api.integrations.v3.models.integration_properties import ( + IntegrationProperties, +) from sendgrid.rest.api.integrations.v3.models.internal_error import InternalError -from sendgrid.rest.api.integrations.v3.models.invalid_delete_request import InvalidDeleteRequest +from sendgrid.rest.api.integrations.v3.models.invalid_delete_request import ( + InvalidDeleteRequest, +) from sendgrid.rest.api.integrations.v3.models.invalid_request import InvalidRequest from sendgrid.rest.api.integrations.v3.models.items import Items from sendgrid.rest.api.integrations.v3.models.items1 import Items1 from sendgrid.rest.api.integrations.v3.models.items2 import Items2 -__all__ = [ 'AddIntegration400Response', 'DeleteIntegration400Response', 'DeleteIntegration404Response', 'Destination', 'Destination1', 'Destination2', 'Destination3', 'DestinationRegion', 'DestinationRegion1', 'DestinationRegion2', 'Forbidden', 'GetIntegrationsByUser200Response', 'GetIntegrationsByUser403Response', 'GetIntegrationsByUser500Response', 'Id', 'Integration', 'IntegrationFilters', 'IntegrationInput', 'IntegrationInputFilters', 'IntegrationInputProperties', 'IntegrationNotFound', 'IntegrationPatch', 'IntegrationPatchFilters', 'IntegrationPatchProperties', 'IntegrationProperties', 'InternalError', 'InvalidDeleteRequest', 'InvalidRequest', 'Items', 'Items1', 'Items2' ] -# Testing code \ No newline at end of file + +__all__ = [ + "AddIntegration400Response", + "DeleteIntegration400Response", + "DeleteIntegration404Response", + "Destination", + "Destination1", + "Destination2", + "Destination3", + "DestinationRegion", + "DestinationRegion1", + "DestinationRegion2", + "Forbidden", + "GetIntegrationsByUser200Response", + "GetIntegrationsByUser403Response", + "GetIntegrationsByUser500Response", + "Id", + "Integration", + "IntegrationFilters", + "IntegrationInput", + "IntegrationInputFilters", + "IntegrationInputProperties", + "IntegrationNotFound", + "IntegrationPatch", + "IntegrationPatchFilters", + "IntegrationPatchProperties", + "IntegrationProperties", + "InternalError", + "InvalidDeleteRequest", + "InvalidRequest", + "Items", + "Items1", + "Items2", +] +# Testing code diff --git a/sendgrid/rest/api/integrations/v3/models/add_integration400_response.py b/sendgrid/rest/api/integrations/v3/models/add_integration400_response.py index 2ca13279..fce225b4 100644 --- a/sendgrid/rest/api/integrations/v3/models/add_integration400_response.py +++ b/sendgrid/rest/api/integrations/v3/models/add_integration400_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.integrations.v3.models.invalid_request import InvalidRequest - class AddIntegration400Response: - def __init__( - self, - errors: Optional[List[InvalidRequest]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[InvalidRequest]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AddIntegration400Response( - errors=payload.get('errors') - ) - + return AddIntegration400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/integrations/v3/models/delete_integration400_response.py b/sendgrid/rest/api/integrations/v3/models/delete_integration400_response.py index 863f2145..e4d68f5a 100644 --- a/sendgrid/rest/api/integrations/v3/models/delete_integration400_response.py +++ b/sendgrid/rest/api/integrations/v3/models/delete_integration400_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.integrations.v3.models.invalid_delete_request import InvalidDeleteRequest - +from sendgrid.rest.api.integrations.v3.models.invalid_delete_request import ( + InvalidDeleteRequest, +) class DeleteIntegration400Response: - def __init__( - self, - errors: Optional[List[InvalidDeleteRequest]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[InvalidDeleteRequest]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DeleteIntegration400Response( - errors=payload.get('errors') - ) - + return DeleteIntegration400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/integrations/v3/models/delete_integration404_response.py b/sendgrid/rest/api/integrations/v3/models/delete_integration404_response.py index 5d75508b..947cb9f1 100644 --- a/sendgrid/rest/api/integrations/v3/models/delete_integration404_response.py +++ b/sendgrid/rest/api/integrations/v3/models/delete_integration404_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.integrations.v3.models.integration_not_found import IntegrationNotFound - +from sendgrid.rest.api.integrations.v3.models.integration_not_found import ( + IntegrationNotFound, +) class DeleteIntegration404Response: - def __init__( - self, - errors: Optional[List[IntegrationNotFound]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[IntegrationNotFound]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DeleteIntegration404Response( - errors=payload.get('errors') - ) - + return DeleteIntegration404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/integrations/v3/models/destination.py b/sendgrid/rest/api/integrations/v3/models/destination.py index 76d243ae..b20076aa 100644 --- a/sendgrid/rest/api/integrations/v3/models/destination.py +++ b/sendgrid/rest/api/integrations/v3/models/destination.py @@ -1,10 +1,6 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Destination(Enum): - SEGMENT='Segment' - + SEGMENT = "Segment" diff --git a/sendgrid/rest/api/integrations/v3/models/destination1.py b/sendgrid/rest/api/integrations/v3/models/destination1.py index e306ae48..910adf3b 100644 --- a/sendgrid/rest/api/integrations/v3/models/destination1.py +++ b/sendgrid/rest/api/integrations/v3/models/destination1.py @@ -1,10 +1,6 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Destination1(Enum): - SEGMENT='Segment' - + SEGMENT = "Segment" diff --git a/sendgrid/rest/api/integrations/v3/models/destination2.py b/sendgrid/rest/api/integrations/v3/models/destination2.py index 4f45f6c9..0652cb82 100644 --- a/sendgrid/rest/api/integrations/v3/models/destination2.py +++ b/sendgrid/rest/api/integrations/v3/models/destination2.py @@ -1,10 +1,6 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Destination2(Enum): - SEGMENT='Segment' - + SEGMENT = "Segment" diff --git a/sendgrid/rest/api/integrations/v3/models/destination3.py b/sendgrid/rest/api/integrations/v3/models/destination3.py index 72483ee3..faf62600 100644 --- a/sendgrid/rest/api/integrations/v3/models/destination3.py +++ b/sendgrid/rest/api/integrations/v3/models/destination3.py @@ -1,10 +1,6 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Destination3(Enum): - SEGMENT='Segment' - + SEGMENT = "Segment" diff --git a/sendgrid/rest/api/integrations/v3/models/destination_region.py b/sendgrid/rest/api/integrations/v3/models/destination_region.py index 24fc694d..66337614 100644 --- a/sendgrid/rest/api/integrations/v3/models/destination_region.py +++ b/sendgrid/rest/api/integrations/v3/models/destination_region.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class DestinationRegion(Enum): - EU='EU' - US='US' - + EU = "EU" + US = "US" diff --git a/sendgrid/rest/api/integrations/v3/models/destination_region1.py b/sendgrid/rest/api/integrations/v3/models/destination_region1.py index dbc66f20..6cea4e2a 100644 --- a/sendgrid/rest/api/integrations/v3/models/destination_region1.py +++ b/sendgrid/rest/api/integrations/v3/models/destination_region1.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class DestinationRegion1(Enum): - EU='EU' - US='US' - + EU = "EU" + US = "US" diff --git a/sendgrid/rest/api/integrations/v3/models/destination_region2.py b/sendgrid/rest/api/integrations/v3/models/destination_region2.py index 2ffc9b29..5fa64740 100644 --- a/sendgrid/rest/api/integrations/v3/models/destination_region2.py +++ b/sendgrid/rest/api/integrations/v3/models/destination_region2.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class DestinationRegion2(Enum): - EU='EU' - US='US' - + EU = "EU" + US = "US" diff --git a/sendgrid/rest/api/integrations/v3/models/forbidden.py b/sendgrid/rest/api/integrations/v3/models/forbidden.py index 5f1580ba..1ec4602e 100644 --- a/sendgrid/rest/api/integrations/v3/models/forbidden.py +++ b/sendgrid/rest/api/integrations/v3/models/forbidden.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class Forbidden: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return Forbidden( - message=payload.get('message') - ) - + return Forbidden(message=payload.get("message")) diff --git a/sendgrid/rest/api/integrations/v3/models/get_integrations_by_user200_response.py b/sendgrid/rest/api/integrations/v3/models/get_integrations_by_user200_response.py index 7eef3ae9..681d061a 100644 --- a/sendgrid/rest/api/integrations/v3/models/get_integrations_by_user200_response.py +++ b/sendgrid/rest/api/integrations/v3/models/get_integrations_by_user200_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.integrations.v3.models.integration import Integration - class GetIntegrationsByUser200Response: - def __init__( - self, - result: Optional[List[Integration]]=None - ): - self.result=result + def __init__(self, result: Optional[List[Integration]] = None): + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetIntegrationsByUser200Response( - result=payload.get('result') - ) - + return GetIntegrationsByUser200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/integrations/v3/models/get_integrations_by_user403_response.py b/sendgrid/rest/api/integrations/v3/models/get_integrations_by_user403_response.py index 2539e8b4..1b1fab18 100644 --- a/sendgrid/rest/api/integrations/v3/models/get_integrations_by_user403_response.py +++ b/sendgrid/rest/api/integrations/v3/models/get_integrations_by_user403_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.integrations.v3.models.forbidden import Forbidden - class GetIntegrationsByUser403Response: - def __init__( - self, - errors: Optional[List[Forbidden]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[Forbidden]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetIntegrationsByUser403Response( - errors=payload.get('errors') - ) - + return GetIntegrationsByUser403Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/integrations/v3/models/get_integrations_by_user500_response.py b/sendgrid/rest/api/integrations/v3/models/get_integrations_by_user500_response.py index 16020f2c..8a60898b 100644 --- a/sendgrid/rest/api/integrations/v3/models/get_integrations_by_user500_response.py +++ b/sendgrid/rest/api/integrations/v3/models/get_integrations_by_user500_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.integrations.v3.models.internal_error import InternalError - class GetIntegrationsByUser500Response: - def __init__( - self, - errors: Optional[List[InternalError]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[InternalError]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetIntegrationsByUser500Response( - errors=payload.get('errors') - ) - + return GetIntegrationsByUser500Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/integrations/v3/models/id.py b/sendgrid/rest/api/integrations/v3/models/id.py index ea1f172c..fcd5b588 100644 --- a/sendgrid/rest/api/integrations/v3/models/id.py +++ b/sendgrid/rest/api/integrations/v3/models/id.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class Id: - def __init__( - self, - integration_id: Optional[str]=None - ): - self.integration_id=integration_id + def __init__(self, integration_id: Optional[str] = None): + self.integration_id = integration_id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "integration_id": self.integration_id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"integration_id": self.integration_id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return Id( - integration_id=payload.get('integration_id') - ) - + return Id(integration_id=payload.get("integration_id")) diff --git a/sendgrid/rest/api/integrations/v3/models/integration.py b/sendgrid/rest/api/integrations/v3/models/integration.py index 0db1e935..dd75b3d9 100644 --- a/sendgrid/rest/api/integrations/v3/models/integration.py +++ b/sendgrid/rest/api/integrations/v3/models/integration.py @@ -1,40 +1,44 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.integrations.v3.models.destination3 import Destination3 -from sendgrid.rest.api.integrations.v3.models.integration_filters import IntegrationFilters -from sendgrid.rest.api.integrations.v3.models.integration_properties import IntegrationProperties - +from sendgrid.rest.api.integrations.v3.models.integration_filters import ( + IntegrationFilters, +) +from sendgrid.rest.api.integrations.v3.models.integration_properties import ( + IntegrationProperties, +) class Integration: def __init__( - self, - integration_id: Optional[str]=None, - user_id: Optional[str]=None, - filters: Optional[IntegrationFilters]=None, - properties: Optional[IntegrationProperties]=None, - label: Optional[str]=None, - destination: Optional[Destination3]=None + self, + integration_id: Optional[str] = None, + user_id: Optional[str] = None, + filters: Optional[IntegrationFilters] = None, + properties: Optional[IntegrationProperties] = None, + label: Optional[str] = None, + destination: Optional[Destination3] = None, ): - self.integration_id=integration_id - self.user_id=user_id - self.filters=filters - self.properties=properties - self.label=label - self.destination=destination + self.integration_id = integration_id + self.user_id = user_id + self.filters = filters + self.properties = properties + self.label = label + self.destination = destination def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "integration_id": self.integration_id, - "user_id": self.user_id, - "filters": self.filters, - "properties": self.properties, - "label": self.label, - "destination": self.destination - }.items() if value is not None} + "integration_id": self.integration_id, + "user_id": self.user_id, + "filters": self.filters, + "properties": self.properties, + "label": self.label, + "destination": self.destination, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -43,11 +47,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Integration( - integration_id=payload.get('integration_id'), - user_id=payload.get('user_id'), - filters=payload.get('filters'), - properties=payload.get('properties'), - label=payload.get('label'), - destination=payload.get('destination') - ) - + integration_id=payload.get("integration_id"), + user_id=payload.get("user_id"), + filters=payload.get("filters"), + properties=payload.get("properties"), + label=payload.get("label"), + destination=payload.get("destination"), + ) diff --git a/sendgrid/rest/api/integrations/v3/models/integration_filters.py b/sendgrid/rest/api/integrations/v3/models/integration_filters.py index 668c6343..958a68d0 100644 --- a/sendgrid/rest/api/integrations/v3/models/integration_filters.py +++ b/sendgrid/rest/api/integrations/v3/models/integration_filters.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.integrations.v3.models.items2 import Items2 - class IntegrationFilters: - def __init__( - self, - email_events: Optional[List[Items2]]=None - ): - self.email_events=email_events + def __init__(self, email_events: Optional[List[Items2]] = None): + self.email_events = email_events def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email_events": self.email_events - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email_events": self.email_events}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return IntegrationFilters( - email_events=payload.get('email_events') - ) - + return IntegrationFilters(email_events=payload.get("email_events")) diff --git a/sendgrid/rest/api/integrations/v3/models/integration_input.py b/sendgrid/rest/api/integrations/v3/models/integration_input.py index 8a6fbeea..037110ae 100644 --- a/sendgrid/rest/api/integrations/v3/models/integration_input.py +++ b/sendgrid/rest/api/integrations/v3/models/integration_input.py @@ -1,34 +1,38 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.integrations.v3.models.destination2 import Destination2 -from sendgrid.rest.api.integrations.v3.models.integration_input_filters import IntegrationInputFilters -from sendgrid.rest.api.integrations.v3.models.integration_input_properties import IntegrationInputProperties - +from sendgrid.rest.api.integrations.v3.models.integration_input_filters import ( + IntegrationInputFilters, +) +from sendgrid.rest.api.integrations.v3.models.integration_input_properties import ( + IntegrationInputProperties, +) class IntegrationInput: def __init__( - self, - destination: Optional[Destination2]=None, - filters: Optional[IntegrationInputFilters]=None, - properties: Optional[IntegrationInputProperties]=None, - label: Optional[str]=None + self, + destination: Optional[Destination2] = None, + filters: Optional[IntegrationInputFilters] = None, + properties: Optional[IntegrationInputProperties] = None, + label: Optional[str] = None, ): - self.destination=destination - self.filters=filters - self.properties=properties - self.label=label + self.destination = destination + self.filters = filters + self.properties = properties + self.label = label def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "destination": self.destination, - "filters": self.filters, - "properties": self.properties, - "label": self.label - }.items() if value is not None} + "destination": self.destination, + "filters": self.filters, + "properties": self.properties, + "label": self.label, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -37,9 +41,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return IntegrationInput( - destination=payload.get('destination'), - filters=payload.get('filters'), - properties=payload.get('properties'), - label=payload.get('label') - ) - + destination=payload.get("destination"), + filters=payload.get("filters"), + properties=payload.get("properties"), + label=payload.get("label"), + ) diff --git a/sendgrid/rest/api/integrations/v3/models/integration_input_filters.py b/sendgrid/rest/api/integrations/v3/models/integration_input_filters.py index c0b86ab1..6122e107 100644 --- a/sendgrid/rest/api/integrations/v3/models/integration_input_filters.py +++ b/sendgrid/rest/api/integrations/v3/models/integration_input_filters.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.integrations.v3.models.items1 import Items1 - class IntegrationInputFilters: - def __init__( - self, - email_events: Optional[List[Items1]]=None - ): - self.email_events=email_events + def __init__(self, email_events: Optional[List[Items1]] = None): + self.email_events = email_events def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email_events": self.email_events - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email_events": self.email_events}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return IntegrationInputFilters( - email_events=payload.get('email_events') - ) - + return IntegrationInputFilters(email_events=payload.get("email_events")) diff --git a/sendgrid/rest/api/integrations/v3/models/integration_input_properties.py b/sendgrid/rest/api/integrations/v3/models/integration_input_properties.py index 3f8d28d5..dc31cf5b 100644 --- a/sendgrid/rest/api/integrations/v3/models/integration_input_properties.py +++ b/sendgrid/rest/api/integrations/v3/models/integration_input_properties.py @@ -1,26 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.integrations.v3.models.destination_region1 import DestinationRegion1 - +from sendgrid.rest.api.integrations.v3.models.destination_region1 import ( + DestinationRegion1, +) class IntegrationInputProperties: def __init__( - self, - write_key: Optional[str]=None, - destination_region: Optional[DestinationRegion1]=None + self, + write_key: Optional[str] = None, + destination_region: Optional[DestinationRegion1] = None, ): - self.write_key=write_key - self.destination_region=destination_region + self.write_key = write_key + self.destination_region = destination_region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "write_key": self.write_key, - "destination_region": self.destination_region - }.items() if value is not None} + "write_key": self.write_key, + "destination_region": self.destination_region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +31,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return IntegrationInputProperties( - write_key=payload.get('write_key'), - destination_region=payload.get('destination_region') - ) - + write_key=payload.get("write_key"), + destination_region=payload.get("destination_region"), + ) diff --git a/sendgrid/rest/api/integrations/v3/models/integration_not_found.py b/sendgrid/rest/api/integrations/v3/models/integration_not_found.py index 4abe9b22..2b9e0e80 100644 --- a/sendgrid/rest/api/integrations/v3/models/integration_not_found.py +++ b/sendgrid/rest/api/integrations/v3/models/integration_not_found.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class IntegrationNotFound: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return IntegrationNotFound( - message=payload.get('message') - ) - + return IntegrationNotFound(message=payload.get("message")) diff --git a/sendgrid/rest/api/integrations/v3/models/integration_patch.py b/sendgrid/rest/api/integrations/v3/models/integration_patch.py index e888f9e7..8aafc750 100644 --- a/sendgrid/rest/api/integrations/v3/models/integration_patch.py +++ b/sendgrid/rest/api/integrations/v3/models/integration_patch.py @@ -1,34 +1,38 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.integrations.v3.models.destination1 import Destination1 -from sendgrid.rest.api.integrations.v3.models.integration_patch_filters import IntegrationPatchFilters -from sendgrid.rest.api.integrations.v3.models.integration_patch_properties import IntegrationPatchProperties - +from sendgrid.rest.api.integrations.v3.models.integration_patch_filters import ( + IntegrationPatchFilters, +) +from sendgrid.rest.api.integrations.v3.models.integration_patch_properties import ( + IntegrationPatchProperties, +) class IntegrationPatch: def __init__( - self, - destination: Optional[Destination1]=None, - filters: Optional[IntegrationPatchFilters]=None, - properties: Optional[IntegrationPatchProperties]=None, - label: Optional[str]=None + self, + destination: Optional[Destination1] = None, + filters: Optional[IntegrationPatchFilters] = None, + properties: Optional[IntegrationPatchProperties] = None, + label: Optional[str] = None, ): - self.destination=destination - self.filters=filters - self.properties=properties - self.label=label + self.destination = destination + self.filters = filters + self.properties = properties + self.label = label def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "destination": self.destination, - "filters": self.filters, - "properties": self.properties, - "label": self.label - }.items() if value is not None} + "destination": self.destination, + "filters": self.filters, + "properties": self.properties, + "label": self.label, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -37,9 +41,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return IntegrationPatch( - destination=payload.get('destination'), - filters=payload.get('filters'), - properties=payload.get('properties'), - label=payload.get('label') - ) - + destination=payload.get("destination"), + filters=payload.get("filters"), + properties=payload.get("properties"), + label=payload.get("label"), + ) diff --git a/sendgrid/rest/api/integrations/v3/models/integration_patch_filters.py b/sendgrid/rest/api/integrations/v3/models/integration_patch_filters.py index 10a6da99..e37790fd 100644 --- a/sendgrid/rest/api/integrations/v3/models/integration_patch_filters.py +++ b/sendgrid/rest/api/integrations/v3/models/integration_patch_filters.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.integrations.v3.models.items import Items - class IntegrationPatchFilters: - def __init__( - self, - email_events: Optional[List[Items]]=None - ): - self.email_events=email_events + def __init__(self, email_events: Optional[List[Items]] = None): + self.email_events = email_events def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email_events": self.email_events - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email_events": self.email_events}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return IntegrationPatchFilters( - email_events=payload.get('email_events') - ) - + return IntegrationPatchFilters(email_events=payload.get("email_events")) diff --git a/sendgrid/rest/api/integrations/v3/models/integration_patch_properties.py b/sendgrid/rest/api/integrations/v3/models/integration_patch_properties.py index b741bf0a..34377747 100644 --- a/sendgrid/rest/api/integrations/v3/models/integration_patch_properties.py +++ b/sendgrid/rest/api/integrations/v3/models/integration_patch_properties.py @@ -1,26 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.integrations.v3.models.destination_region import DestinationRegion - +from sendgrid.rest.api.integrations.v3.models.destination_region import ( + DestinationRegion, +) class IntegrationPatchProperties: def __init__( - self, - write_key: Optional[str]=None, - destination_region: Optional[DestinationRegion]=None + self, + write_key: Optional[str] = None, + destination_region: Optional[DestinationRegion] = None, ): - self.write_key=write_key - self.destination_region=destination_region + self.write_key = write_key + self.destination_region = destination_region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "write_key": self.write_key, - "destination_region": self.destination_region - }.items() if value is not None} + "write_key": self.write_key, + "destination_region": self.destination_region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +31,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return IntegrationPatchProperties( - write_key=payload.get('write_key'), - destination_region=payload.get('destination_region') - ) - + write_key=payload.get("write_key"), + destination_region=payload.get("destination_region"), + ) diff --git a/sendgrid/rest/api/integrations/v3/models/integration_properties.py b/sendgrid/rest/api/integrations/v3/models/integration_properties.py index 1b110c0f..e45e6ea7 100644 --- a/sendgrid/rest/api/integrations/v3/models/integration_properties.py +++ b/sendgrid/rest/api/integrations/v3/models/integration_properties.py @@ -1,26 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.integrations.v3.models.destination_region2 import DestinationRegion2 - +from sendgrid.rest.api.integrations.v3.models.destination_region2 import ( + DestinationRegion2, +) class IntegrationProperties: def __init__( - self, - write_key: Optional[str]=None, - destination_region: Optional[DestinationRegion2]=None + self, + write_key: Optional[str] = None, + destination_region: Optional[DestinationRegion2] = None, ): - self.write_key=write_key - self.destination_region=destination_region + self.write_key = write_key + self.destination_region = destination_region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "write_key": self.write_key, - "destination_region": self.destination_region - }.items() if value is not None} + "write_key": self.write_key, + "destination_region": self.destination_region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +31,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return IntegrationProperties( - write_key=payload.get('write_key'), - destination_region=payload.get('destination_region') - ) - + write_key=payload.get("write_key"), + destination_region=payload.get("destination_region"), + ) diff --git a/sendgrid/rest/api/integrations/v3/models/internal_error.py b/sendgrid/rest/api/integrations/v3/models/internal_error.py index f799b855..1848607f 100644 --- a/sendgrid/rest/api/integrations/v3/models/internal_error.py +++ b/sendgrid/rest/api/integrations/v3/models/internal_error.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class InternalError: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return InternalError( - message=payload.get('message') - ) - + return InternalError(message=payload.get("message")) diff --git a/sendgrid/rest/api/integrations/v3/models/invalid_delete_request.py b/sendgrid/rest/api/integrations/v3/models/invalid_delete_request.py index 4728ea32..47ffe01c 100644 --- a/sendgrid/rest/api/integrations/v3/models/invalid_delete_request.py +++ b/sendgrid/rest/api/integrations/v3/models/invalid_delete_request.py @@ -1,25 +1,21 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class InvalidDeleteRequest: - def __init__( - self, - message: Optional[str]=None, - parameter: Optional[str]=None - ): - self.message=message - self.parameter=parameter + def __init__(self, message: Optional[str] = None, parameter: Optional[str] = None): + self.message = message + self.parameter = parameter def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "parameter": self.parameter - }.items() if value is not None} + "message": self.message, + "parameter": self.parameter, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +24,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return InvalidDeleteRequest( - message=payload.get('message'), - parameter=payload.get('parameter') - ) - + message=payload.get("message"), parameter=payload.get("parameter") + ) diff --git a/sendgrid/rest/api/integrations/v3/models/invalid_request.py b/sendgrid/rest/api/integrations/v3/models/invalid_request.py index 9875e983..a0d127c1 100644 --- a/sendgrid/rest/api/integrations/v3/models/invalid_request.py +++ b/sendgrid/rest/api/integrations/v3/models/invalid_request.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class InvalidRequest: - def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None - ): - self.message=message - self.field=field + def __init__(self, message: Optional[str] = None, field: Optional[str] = None): + self.message = message + self.field = field def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message, - "field": self.field - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message, "field": self.field}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return InvalidRequest( - message=payload.get('message'), - field=payload.get('field') - ) - + message=payload.get("message"), field=payload.get("field") + ) diff --git a/sendgrid/rest/api/integrations/v3/models/items.py b/sendgrid/rest/api/integrations/v3/models/items.py index c7be4391..f754e3bd 100644 --- a/sendgrid/rest/api/integrations/v3/models/items.py +++ b/sendgrid/rest/api/integrations/v3/models/items.py @@ -1,21 +1,17 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Items(Enum): - DROP='drop' - PROCESSED='processed' - DEFERRED='deferred' - GROUP_UNSUBSCRIBE='group_unsubscribe' - BOUNCE='bounce' - DELIVERED='delivered' - CLICK='click' - UNSUBSCRIBE='unsubscribe' - OPEN='open' - GROUP_RESUBSCRIBE='group_resubscribe' - SPAMREPORT='spamreport' - MACHINE_OPENED='machine_opened' - + DROP = "drop" + PROCESSED = "processed" + DEFERRED = "deferred" + GROUP_UNSUBSCRIBE = "group_unsubscribe" + BOUNCE = "bounce" + DELIVERED = "delivered" + CLICK = "click" + UNSUBSCRIBE = "unsubscribe" + OPEN = "open" + GROUP_RESUBSCRIBE = "group_resubscribe" + SPAMREPORT = "spamreport" + MACHINE_OPENED = "machine_opened" diff --git a/sendgrid/rest/api/integrations/v3/models/items1.py b/sendgrid/rest/api/integrations/v3/models/items1.py index 180262e4..3ddd6a4d 100644 --- a/sendgrid/rest/api/integrations/v3/models/items1.py +++ b/sendgrid/rest/api/integrations/v3/models/items1.py @@ -1,21 +1,17 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Items1(Enum): - DROP='drop' - PROCESSED='processed' - DEFERRED='deferred' - GROUP_UNSUBSCRIBE='group_unsubscribe' - BOUNCE='bounce' - DELIVERED='delivered' - CLICK='click' - UNSUBSCRIBE='unsubscribe' - OPEN='open' - GROUP_RESUBSCRIBE='group_resubscribe' - SPAMREPORT='spamreport' - MACHINE_OPENED='machine_opened' - + DROP = "drop" + PROCESSED = "processed" + DEFERRED = "deferred" + GROUP_UNSUBSCRIBE = "group_unsubscribe" + BOUNCE = "bounce" + DELIVERED = "delivered" + CLICK = "click" + UNSUBSCRIBE = "unsubscribe" + OPEN = "open" + GROUP_RESUBSCRIBE = "group_resubscribe" + SPAMREPORT = "spamreport" + MACHINE_OPENED = "machine_opened" diff --git a/sendgrid/rest/api/integrations/v3/models/items2.py b/sendgrid/rest/api/integrations/v3/models/items2.py index b18b853b..546315ce 100644 --- a/sendgrid/rest/api/integrations/v3/models/items2.py +++ b/sendgrid/rest/api/integrations/v3/models/items2.py @@ -1,21 +1,17 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Items2(Enum): - DROP='drop' - PROCESSED='processed' - DEFERRED='deferred' - GROUP_UNSUBSCRIBE='group_unsubscribe' - BOUNCE='bounce' - DELIVERED='delivered' - CLICK='click' - UNSUBSCRIBE='unsubscribe' - OPEN='open' - GROUP_RESUBSCRIBE='group_resubscribe' - SPAMREPORT='spamreport' - MACHINE_OPENED='machine_opened' - + DROP = "drop" + PROCESSED = "processed" + DEFERRED = "deferred" + GROUP_UNSUBSCRIBE = "group_unsubscribe" + BOUNCE = "bounce" + DELIVERED = "delivered" + CLICK = "click" + UNSUBSCRIBE = "unsubscribe" + OPEN = "open" + GROUP_RESUBSCRIBE = "group_resubscribe" + SPAMREPORT = "spamreport" + MACHINE_OPENED = "machine_opened" diff --git a/sendgrid/rest/api/integrations/v3/update_integration.py b/sendgrid/rest/api/integrations/v3/update_integration.py index 718f619b..918986f1 100644 --- a/sendgrid/rest/api/integrations/v3/update_integration.py +++ b/sendgrid/rest/api/integrations/v3/update_integration.py @@ -12,52 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.integrations.v3.models.integration import Integration from sendgrid.rest.api.integrations.v3.models.integration_patch import IntegrationPatch + class UpdateIntegration: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - integration_patch: Optional[IntegrationPatch] = None, - + id: str, + integration_patch: Optional[IntegrationPatch] = None, ): - path='/v3/marketing/integrations/{id}' + path = "/v3/marketing/integrations/{id}" path = path.format( - id=id, + id=id, ) data = None if integration_patch: data = integration_patch.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_access_management/v3/__init__.py b/sendgrid/rest/api/ip_access_management/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/ip_access_management/v3/__init__.py +++ b/sendgrid/rest/api/ip_access_management/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/ip_access_management/v3/add_ip_to_allow_list.py b/sendgrid/rest/api/ip_access_management/v3/add_ip_to_allow_list.py index ef7d2e1d..37aa1f8c 100644 --- a/sendgrid/rest/api/ip_access_management/v3/add_ip_to_allow_list.py +++ b/sendgrid/rest/api/ip_access_management/v3/add_ip_to_allow_list.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_access_management.v3.models.add_ip_to_allow_list_request import AddIpToAllowListRequest -from sendgrid.rest.api.ip_access_management.v3.models.ip_access_management2xx import IpAccessManagement2xx +from sendgrid.rest.api.ip_access_management.v3.models.add_ip_to_allow_list_request import ( + AddIpToAllowListRequest, +) + class AddIpToAllowList: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - add_ip_to_allow_list_request: Optional[AddIpToAllowListRequest] = None, - + on_behalf_of: Optional[str] = None, + add_ip_to_allow_list_request: Optional[AddIpToAllowListRequest] = None, ): - path='/v3/access_settings/whitelist' + path = "/v3/access_settings/whitelist" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if add_ip_to_allow_list_request: data = add_ip_to_allow_list_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_access_management/v3/delete_allowed_ip.py b/sendgrid/rest/api/ip_access_management/v3/delete_allowed_ip.py index a0c79251..04c4f5a5 100644 --- a/sendgrid/rest/api/ip_access_management/v3/delete_allowed_ip.py +++ b/sendgrid/rest/api/ip_access_management/v3/delete_allowed_ip.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteAllowedIp: def __init__(self, client) -> None: self.client = client - + def send( self, - rule_id: str, - on_behalf_of: Optional[str] = None, - + rule_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/access_settings/whitelist/{rule_id}' + path = "/v3/access_settings/whitelist/{rule_id}" path = path.format( - rule_id=rule_id, + rule_id=rule_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_access_management/v3/delete_allowed_ips.py b/sendgrid/rest/api/ip_access_management/v3/delete_allowed_ips.py index a5ee21cb..19a8619a 100644 --- a/sendgrid/rest/api/ip_access_management/v3/delete_allowed_ips.py +++ b/sendgrid/rest/api/ip_access_management/v3/delete_allowed_ips.py @@ -12,54 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_access_management.v3.models.delete_allowed_ips_request import DeleteAllowedIpsRequest +from sendgrid.rest.api.ip_access_management.v3.models.delete_allowed_ips_request import ( + DeleteAllowedIpsRequest, +) + class DeleteAllowedIps: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - delete_allowed_ips_request: Optional[DeleteAllowedIpsRequest] = None, - + on_behalf_of: Optional[str] = None, + delete_allowed_ips_request: Optional[DeleteAllowedIpsRequest] = None, ): - path='/v3/access_settings/whitelist' + path = "/v3/access_settings/whitelist" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if delete_allowed_ips_request: data = delete_allowed_ips_request.to_dict() - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_access_management/v3/get_allowed_ip.py b/sendgrid/rest/api/ip_access_management/v3/get_allowed_ip.py index 431e29bb..03096953 100644 --- a/sendgrid/rest/api/ip_access_management/v3/get_allowed_ip.py +++ b/sendgrid/rest/api/ip_access_management/v3/get_allowed_ip.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_access_management.v3.models.ip_access_management2xx import IpAccessManagement2xx + class GetAllowedIp: def __init__(self, client) -> None: self.client = client - + def send( self, - rule_id: str, - on_behalf_of: Optional[str] = None, - + rule_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/access_settings/whitelist/{rule_id}' + path = "/v3/access_settings/whitelist/{rule_id}" path = path.format( - rule_id=rule_id, + rule_id=rule_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_access_management/v3/list_access_activity.py b/sendgrid/rest/api/ip_access_management/v3/list_access_activity.py index f8199b61..8df9ecd5 100644 --- a/sendgrid/rest/api/ip_access_management/v3/list_access_activity.py +++ b/sendgrid/rest/api/ip_access_management/v3/list_access_activity.py @@ -12,51 +12,48 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_access_management.v3.models.list_access_activity200_response import ListAccessActivity200Response + class ListAccessActivity: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - limit: Optional[int] = None, - + on_behalf_of: Optional[str] = None, + limit: Optional[int] = None, ): - path='/v3/access_settings/activity' + path = "/v3/access_settings/activity" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_access_management/v3/list_allowed_ip.py b/sendgrid/rest/api/ip_access_management/v3/list_allowed_ip.py index 5d7a4681..613dfbaa 100644 --- a/sendgrid/rest/api/ip_access_management/v3/list_allowed_ip.py +++ b/sendgrid/rest/api/ip_access_management/v3/list_allowed_ip.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_access_management.v3.models.ip_access_management2xx import IpAccessManagement2xx + class ListAllowedIp: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/access_settings/whitelist' + path = "/v3/access_settings/whitelist" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_access_management/v3/models/__init__.py b/sendgrid/rest/api/ip_access_management/v3/models/__init__.py index 417082f1..af5b9584 100644 --- a/sendgrid/rest/api/ip_access_management/v3/models/__init__.py +++ b/sendgrid/rest/api/ip_access_management/v3/models/__init__.py @@ -11,16 +11,44 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.ip_access_management.v3.models.add_ip_to_allow_list_request import AddIpToAllowListRequest -from sendgrid.rest.api.ip_access_management.v3.models.add_ip_to_allow_list_request_ips_inner import AddIpToAllowListRequestIpsInner -from sendgrid.rest.api.ip_access_management.v3.models.delete_allowed_ips_request import DeleteAllowedIpsRequest -from sendgrid.rest.api.ip_access_management.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.ip_access_management.v3.models.error_response_errors_inner import ErrorResponseErrorsInner -from sendgrid.rest.api.ip_access_management.v3.models.ip_access_management2xx import IpAccessManagement2xx -from sendgrid.rest.api.ip_access_management.v3.models.ip_access_management2xx_result_inner import IpAccessManagement2xxResultInner -from sendgrid.rest.api.ip_access_management.v3.models.list_access_activity200_response import ListAccessActivity200Response -from sendgrid.rest.api.ip_access_management.v3.models.list_access_activity200_response_result_inner import ListAccessActivity200ResponseResultInner -__all__ = [ 'AddIpToAllowListRequest', 'AddIpToAllowListRequestIpsInner', 'DeleteAllowedIpsRequest', 'ErrorResponse', 'ErrorResponseErrorsInner', 'IpAccessManagement2xx', 'IpAccessManagement2xxResultInner', 'ListAccessActivity200Response', 'ListAccessActivity200ResponseResultInner' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.ip_access_management.v3.models.add_ip_to_allow_list_request import ( + AddIpToAllowListRequest, +) +from sendgrid.rest.api.ip_access_management.v3.models.add_ip_to_allow_list_request_ips_inner import ( + AddIpToAllowListRequestIpsInner, +) +from sendgrid.rest.api.ip_access_management.v3.models.delete_allowed_ips_request import ( + DeleteAllowedIpsRequest, +) +from sendgrid.rest.api.ip_access_management.v3.models.error_response import ( + ErrorResponse, +) +from sendgrid.rest.api.ip_access_management.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) +from sendgrid.rest.api.ip_access_management.v3.models.ip_access_management2xx import ( + IpAccessManagement2xx, +) +from sendgrid.rest.api.ip_access_management.v3.models.ip_access_management2xx_result_inner import ( + IpAccessManagement2xxResultInner, +) +from sendgrid.rest.api.ip_access_management.v3.models.list_access_activity200_response import ( + ListAccessActivity200Response, +) +from sendgrid.rest.api.ip_access_management.v3.models.list_access_activity200_response_result_inner import ( + ListAccessActivity200ResponseResultInner, +) + +__all__ = [ + "AddIpToAllowListRequest", + "AddIpToAllowListRequestIpsInner", + "DeleteAllowedIpsRequest", + "ErrorResponse", + "ErrorResponseErrorsInner", + "IpAccessManagement2xx", + "IpAccessManagement2xxResultInner", + "ListAccessActivity200Response", + "ListAccessActivity200ResponseResultInner", +] +# Testing code diff --git a/sendgrid/rest/api/ip_access_management/v3/models/add_ip_to_allow_list_request.py b/sendgrid/rest/api/ip_access_management/v3/models/add_ip_to_allow_list_request.py index 6bd7dd7e..2d5c6dcd 100644 --- a/sendgrid/rest/api/ip_access_management/v3/models/add_ip_to_allow_list_request.py +++ b/sendgrid/rest/api/ip_access_management/v3/models/add_ip_to_allow_list_request.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_access_management.v3.models.add_ip_to_allow_list_request_ips_inner import AddIpToAllowListRequestIpsInner - +from sendgrid.rest.api.ip_access_management.v3.models.add_ip_to_allow_list_request_ips_inner import ( + AddIpToAllowListRequestIpsInner, +) class AddIpToAllowListRequest: - def __init__( - self, - ips: Optional[List[AddIpToAllowListRequestIpsInner]]=None - ): - self.ips=ips + def __init__(self, ips: Optional[List[AddIpToAllowListRequestIpsInner]] = None): + self.ips = ips def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ips": self.ips - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ips": self.ips}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AddIpToAllowListRequest( - ips=payload.get('ips') - ) - + return AddIpToAllowListRequest(ips=payload.get("ips")) diff --git a/sendgrid/rest/api/ip_access_management/v3/models/add_ip_to_allow_list_request_ips_inner.py b/sendgrid/rest/api/ip_access_management/v3/models/add_ip_to_allow_list_request_ips_inner.py index 922fb660..764667e4 100644 --- a/sendgrid/rest/api/ip_access_management/v3/models/add_ip_to_allow_list_request_ips_inner.py +++ b/sendgrid/rest/api/ip_access_management/v3/models/add_ip_to_allow_list_request_ips_inner.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AddIpToAllowListRequestIpsInner: - def __init__( - self, - ip: Optional[str]=None - ): - self.ip=ip + def __init__(self, ip: Optional[str] = None): + self.ip = ip def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ip": self.ip - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ip": self.ip}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AddIpToAllowListRequestIpsInner( - ip=payload.get('ip') - ) - + return AddIpToAllowListRequestIpsInner(ip=payload.get("ip")) diff --git a/sendgrid/rest/api/ip_access_management/v3/models/delete_allowed_ips_request.py b/sendgrid/rest/api/ip_access_management/v3/models/delete_allowed_ips_request.py index acccfbde..8beb99b4 100644 --- a/sendgrid/rest/api/ip_access_management/v3/models/delete_allowed_ips_request.py +++ b/sendgrid/rest/api/ip_access_management/v3/models/delete_allowed_ips_request.py @@ -1,22 +1,17 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DeleteAllowedIpsRequest: - def __init__( - self, - ids: Optional[List[int]]=None - ): - self.ids=ids + def __init__(self, ids: Optional[List[int]] = None): + self.ids = ids def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ids": self.ids - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ids": self.ids}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DeleteAllowedIpsRequest( - ids=payload.get('ids') - ) - + return DeleteAllowedIpsRequest(ids=payload.get("ids")) diff --git a/sendgrid/rest/api/ip_access_management/v3/models/error_response.py b/sendgrid/rest/api/ip_access_management/v3/models/error_response.py index f22d5e23..b8cf4c49 100644 --- a/sendgrid/rest/api/ip_access_management/v3/models/error_response.py +++ b/sendgrid/rest/api/ip_access_management/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_access_management.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.ip_access_management.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/ip_access_management/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/ip_access_management/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/ip_access_management/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/ip_access_management/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/ip_access_management/v3/models/ip_access_management2xx.py b/sendgrid/rest/api/ip_access_management/v3/models/ip_access_management2xx.py index b8edaf54..748f3c3e 100644 --- a/sendgrid/rest/api/ip_access_management/v3/models/ip_access_management2xx.py +++ b/sendgrid/rest/api/ip_access_management/v3/models/ip_access_management2xx.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_access_management.v3.models.ip_access_management2xx_result_inner import IpAccessManagement2xxResultInner - +from sendgrid.rest.api.ip_access_management.v3.models.ip_access_management2xx_result_inner import ( + IpAccessManagement2xxResultInner, +) class IpAccessManagement2xx: - def __init__( - self, - result: Optional[List[IpAccessManagement2xxResultInner]]=None - ): - self.result=result + def __init__(self, result: Optional[List[IpAccessManagement2xxResultInner]] = None): + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return IpAccessManagement2xx( - result=payload.get('result') - ) - + return IpAccessManagement2xx(result=payload.get("result")) diff --git a/sendgrid/rest/api/ip_access_management/v3/models/ip_access_management2xx_result_inner.py b/sendgrid/rest/api/ip_access_management/v3/models/ip_access_management2xx_result_inner.py index a6a55642..c9a2c14f 100644 --- a/sendgrid/rest/api/ip_access_management/v3/models/ip_access_management2xx_result_inner.py +++ b/sendgrid/rest/api/ip_access_management/v3/models/ip_access_management2xx_result_inner.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class IpAccessManagement2xxResultInner: def __init__( - self, - id: Optional[int]=None, - ip: Optional[str]=None, - created_at: Optional[int]=None, - updated_at: Optional[int]=None + self, + id: Optional[int] = None, + ip: Optional[str] = None, + created_at: Optional[int] = None, + updated_at: Optional[int] = None, ): - self.id=id - self.ip=ip - self.created_at=created_at - self.updated_at=updated_at + self.id = id + self.ip = ip + self.created_at = created_at + self.updated_at = updated_at def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "ip": self.ip, - "created_at": self.created_at, - "updated_at": self.updated_at - }.items() if value is not None} + "id": self.id, + "ip": self.ip, + "created_at": self.created_at, + "updated_at": self.updated_at, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return IpAccessManagement2xxResultInner( - id=payload.get('id'), - ip=payload.get('ip'), - created_at=payload.get('created_at'), - updated_at=payload.get('updated_at') - ) - + id=payload.get("id"), + ip=payload.get("ip"), + created_at=payload.get("created_at"), + updated_at=payload.get("updated_at"), + ) diff --git a/sendgrid/rest/api/ip_access_management/v3/models/list_access_activity200_response.py b/sendgrid/rest/api/ip_access_management/v3/models/list_access_activity200_response.py index bb4006a7..92d186bd 100644 --- a/sendgrid/rest/api/ip_access_management/v3/models/list_access_activity200_response.py +++ b/sendgrid/rest/api/ip_access_management/v3/models/list_access_activity200_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_access_management.v3.models.list_access_activity200_response_result_inner import ListAccessActivity200ResponseResultInner - +from sendgrid.rest.api.ip_access_management.v3.models.list_access_activity200_response_result_inner import ( + ListAccessActivity200ResponseResultInner, +) class ListAccessActivity200Response: def __init__( - self, - result: Optional[List[ListAccessActivity200ResponseResultInner]]=None + self, result: Optional[List[ListAccessActivity200ResponseResultInner]] = None ): - self.result=result + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListAccessActivity200Response( - result=payload.get('result') - ) - + return ListAccessActivity200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/ip_access_management/v3/models/list_access_activity200_response_result_inner.py b/sendgrid/rest/api/ip_access_management/v3/models/list_access_activity200_response_result_inner.py index 2a31231b..0a262dcc 100644 --- a/sendgrid/rest/api/ip_access_management/v3/models/list_access_activity200_response_result_inner.py +++ b/sendgrid/rest/api/ip_access_management/v3/models/list_access_activity200_response_result_inner.py @@ -1,37 +1,37 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListAccessActivity200ResponseResultInner: def __init__( - self, - allowed: Optional[bool]=None, - auth_method: Optional[str]=None, - first_at: Optional[int]=None, - ip: Optional[str]=None, - last_at: Optional[int]=None, - location: Optional[str]=None + self, + allowed: Optional[bool] = None, + auth_method: Optional[str] = None, + first_at: Optional[int] = None, + ip: Optional[str] = None, + last_at: Optional[int] = None, + location: Optional[str] = None, ): - self.allowed=allowed - self.auth_method=auth_method - self.first_at=first_at - self.ip=ip - self.last_at=last_at - self.location=location + self.allowed = allowed + self.auth_method = auth_method + self.first_at = first_at + self.ip = ip + self.last_at = last_at + self.location = location def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "allowed": self.allowed, - "auth_method": self.auth_method, - "first_at": self.first_at, - "ip": self.ip, - "last_at": self.last_at, - "location": self.location - }.items() if value is not None} + "allowed": self.allowed, + "auth_method": self.auth_method, + "first_at": self.first_at, + "ip": self.ip, + "last_at": self.last_at, + "location": self.location, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -40,11 +40,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListAccessActivity200ResponseResultInner( - allowed=payload.get('allowed'), - auth_method=payload.get('auth_method'), - first_at=payload.get('first_at'), - ip=payload.get('ip'), - last_at=payload.get('last_at'), - location=payload.get('location') - ) - + allowed=payload.get("allowed"), + auth_method=payload.get("auth_method"), + first_at=payload.get("first_at"), + ip=payload.get("ip"), + last_at=payload.get("last_at"), + location=payload.get("location"), + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/__init__.py b/sendgrid/rest/api/ip_address_management/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/ip_address_management/v3/__init__.py +++ b/sendgrid/rest/api/ip_address_management/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/ip_address_management/v3/add_ip.py b/sendgrid/rest/api/ip_address_management/v3/add_ip.py index e762cd99..95deb4b7 100644 --- a/sendgrid/rest/api/ip_address_management/v3/add_ip.py +++ b/sendgrid/rest/api/ip_address_management/v3/add_ip.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.ip_address_management.v3.models.add_ip201_response import AddIp201Response -from sendgrid.rest.api.ip_address_management.v3.models.add_ip_request import AddIpRequest +from sendgrid.rest.api.ip_address_management.v3.models.add_ip_request import ( + AddIpRequest, +) + class AddIp: def __init__(self, client) -> None: self.client = client - + def send( self, - add_ip_request: Optional[AddIpRequest] = None, - + add_ip_request: Optional[AddIpRequest] = None, ): - path='/v3/send_ips/ips' + path = "/v3/send_ips/ips" data = None if add_ip_request: data = add_ip_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/add_ips_to_ip_pool.py b/sendgrid/rest/api/ip_address_management/v3/add_ips_to_ip_pool.py index ceb56953..389efacd 100644 --- a/sendgrid/rest/api/ip_address_management/v3/add_ips_to_ip_pool.py +++ b/sendgrid/rest/api/ip_address_management/v3/add_ips_to_ip_pool.py @@ -12,53 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_address_management.v3.models.add_ips_to_ip_pool200_response import AddIpsToIpPool200Response -from sendgrid.rest.api.ip_address_management.v3.models.add_ips_to_ip_pool_request import AddIpsToIpPoolRequest +from sendgrid.rest.api.ip_address_management.v3.models.add_ips_to_ip_pool_request import ( + AddIpsToIpPoolRequest, +) + class AddIpsToIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - poolid: str, - add_ips_to_ip_pool_request: Optional[AddIpsToIpPoolRequest] = None, - + poolid: str, + add_ips_to_ip_pool_request: Optional[AddIpsToIpPoolRequest] = None, ): - path='/v3/send_ips/pools/{poolid}/ips:batchAdd' + path = "/v3/send_ips/pools/{poolid}/ips:batchAdd" path = path.format( - poolid=poolid, + poolid=poolid, ) data = None if add_ips_to_ip_pool_request: data = add_ips_to_ip_pool_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/add_sub_users_to_ip.py b/sendgrid/rest/api/ip_address_management/v3/add_sub_users_to_ip.py index 8c499abe..4daaf183 100644 --- a/sendgrid/rest/api/ip_address_management/v3/add_sub_users_to_ip.py +++ b/sendgrid/rest/api/ip_address_management/v3/add_sub_users_to_ip.py @@ -12,53 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_address_management.v3.models.add_sub_users_to_ip200_response import AddSubUsersToIp200Response -from sendgrid.rest.api.ip_address_management.v3.models.add_sub_users_to_ip_request import AddSubUsersToIpRequest +from sendgrid.rest.api.ip_address_management.v3.models.add_sub_users_to_ip_request import ( + AddSubUsersToIpRequest, +) + class AddSubUsersToIp: def __init__(self, client) -> None: self.client = client - + def send( self, - ip: str, - add_sub_users_to_ip_request: Optional[AddSubUsersToIpRequest] = None, - + ip: str, + add_sub_users_to_ip_request: Optional[AddSubUsersToIpRequest] = None, ): - path='/v3/send_ips/ips/{ip}/subusers:batchAdd' + path = "/v3/send_ips/ips/{ip}/subusers:batchAdd" path = path.format( - ip=ip, + ip=ip, ) data = None if add_sub_users_to_ip_request: data = add_sub_users_to_ip_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/create_ip_pool.py b/sendgrid/rest/api/ip_address_management/v3/create_ip_pool.py index 5c00dde8..0816b342 100644 --- a/sendgrid/rest/api/ip_address_management/v3/create_ip_pool.py +++ b/sendgrid/rest/api/ip_address_management/v3/create_ip_pool.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.ip_address_management.v3.models.create_ip_pool201_response import CreateIpPool201Response -from sendgrid.rest.api.ip_address_management.v3.models.create_ip_pool_request import CreateIpPoolRequest +from sendgrid.rest.api.ip_address_management.v3.models.create_ip_pool_request import ( + CreateIpPoolRequest, +) + class CreateIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - create_ip_pool_request: Optional[CreateIpPoolRequest] = None, - + create_ip_pool_request: Optional[CreateIpPoolRequest] = None, ): - path='/v3/send_ips/pools' + path = "/v3/send_ips/pools" data = None if create_ip_pool_request: data = create_ip_pool_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/delete_ip_pool.py b/sendgrid/rest/api/ip_address_management/v3/delete_ip_pool.py index 4ee9b193..ce07627e 100644 --- a/sendgrid/rest/api/ip_address_management/v3/delete_ip_pool.py +++ b/sendgrid/rest/api/ip_address_management/v3/delete_ip_pool.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated class DeleteIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - poolid: str, - + poolid: str, ): - path='/v3/send_ips/pools/{poolid}' + path = "/v3/send_ips/pools/{poolid}" path = path.format( - poolid=poolid, + poolid=poolid, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/delete_ips_from_ip_pool.py b/sendgrid/rest/api/ip_address_management/v3/delete_ips_from_ip_pool.py index 7a57a9db..4a9ee3c8 100644 --- a/sendgrid/rest/api/ip_address_management/v3/delete_ips_from_ip_pool.py +++ b/sendgrid/rest/api/ip_address_management/v3/delete_ips_from_ip_pool.py @@ -12,52 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_address_management.v3.models.delete_ips_from_ip_pool_request import DeleteIpsFromIpPoolRequest +from sendgrid.rest.api.ip_address_management.v3.models.delete_ips_from_ip_pool_request import ( + DeleteIpsFromIpPoolRequest, +) + class DeleteIpsFromIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - poolid: str, - delete_ips_from_ip_pool_request: Optional[DeleteIpsFromIpPoolRequest] = None, - + poolid: str, + delete_ips_from_ip_pool_request: Optional[DeleteIpsFromIpPoolRequest] = None, ): - path='/v3/send_ips/pools/{poolid}/ips:batchDelete' + path = "/v3/send_ips/pools/{poolid}/ips:batchDelete" path = path.format( - poolid=poolid, + poolid=poolid, ) data = None if delete_ips_from_ip_pool_request: data = delete_ips_from_ip_pool_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/delete_sub_users_from_ip.py b/sendgrid/rest/api/ip_address_management/v3/delete_sub_users_from_ip.py index b926fbc7..c6859db4 100644 --- a/sendgrid/rest/api/ip_address_management/v3/delete_sub_users_from_ip.py +++ b/sendgrid/rest/api/ip_address_management/v3/delete_sub_users_from_ip.py @@ -12,52 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_address_management.v3.models.delete_sub_users_from_ip_request import DeleteSubUsersFromIpRequest +from sendgrid.rest.api.ip_address_management.v3.models.delete_sub_users_from_ip_request import ( + DeleteSubUsersFromIpRequest, +) + class DeleteSubUsersFromIp: def __init__(self, client) -> None: self.client = client - + def send( self, - ip: str, - delete_sub_users_from_ip_request: Optional[DeleteSubUsersFromIpRequest] = None, - + ip: str, + delete_sub_users_from_ip_request: Optional[DeleteSubUsersFromIpRequest] = None, ): - path='/v3/send_ips/ips/{ip}/subusers:batchDelete' + path = "/v3/send_ips/ips/{ip}/subusers:batchDelete" path = path.format( - ip=ip, + ip=ip, ) data = None if delete_sub_users_from_ip_request: data = delete_sub_users_from_ip_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/get_ip.py b/sendgrid/rest/api/ip_address_management/v3/get_ip.py index e6fbc022..57dbabd4 100644 --- a/sendgrid/rest/api/ip_address_management/v3/get_ip.py +++ b/sendgrid/rest/api/ip_address_management/v3/get_ip.py @@ -12,46 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_address_management.v3.models.get_ip200_response import GetIp200Response + class GetIp: def __init__(self, client) -> None: self.client = client - + def send( self, - include_region: Optional[bool] = None, - + include_region: Optional[bool] = None, ): - path='/v3/send_ips/ips/{ip}' + path = "/v3/send_ips/ips/{ip}" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/get_ip_pool.py b/sendgrid/rest/api/ip_address_management/v3/get_ip_pool.py index d6a6d264..81d60ce8 100644 --- a/sendgrid/rest/api/ip_address_management/v3/get_ip_pool.py +++ b/sendgrid/rest/api/ip_address_management/v3/get_ip_pool.py @@ -12,46 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_address_management.v3.models.get_ip_pool200_response import GetIpPool200Response + class GetIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - include_region: Optional[bool] = None, - + include_region: Optional[bool] = None, ): - path='/v3/send_ips/pools/{poolid}' + path = "/v3/send_ips/pools/{poolid}" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/list_ip.py b/sendgrid/rest/api/ip_address_management/v3/list_ip.py index 56afc9c2..f8e0a667 100644 --- a/sendgrid/rest/api/ip_address_management/v3/list_ip.py +++ b/sendgrid/rest/api/ip_address_management/v3/list_ip.py @@ -12,58 +12,53 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response import ListIp200Response from sendgrid.rest.api.ip_address_management.v3.models.region7 import Region7 + class ListIp: def __init__(self, client) -> None: self.client = client - + def send( self, - ip: Optional[str] = None, - limit: Optional[int] = None, - after_key: Optional[int] = None, - before_key: Optional[str] = None, - is_leased: Optional[bool] = None, - is_enabled: Optional[bool] = None, - is_parent_assigned: Optional[bool] = None, - pool: Optional[str] = None, - start_added_at: Optional[int] = None, - end_added_at: Optional[int] = None, - region: Optional[Region7] = None, - include_region: Optional[bool] = None, - + ip: Optional[str] = None, + limit: Optional[int] = None, + after_key: Optional[int] = None, + before_key: Optional[str] = None, + is_leased: Optional[bool] = None, + is_enabled: Optional[bool] = None, + is_parent_assigned: Optional[bool] = None, + pool: Optional[str] = None, + start_added_at: Optional[int] = None, + end_added_at: Optional[int] = None, + region: Optional[Region7] = None, + include_region: Optional[bool] = None, ): - path='/v3/send_ips/ips' + path = "/v3/send_ips/ips" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/list_ip_assigned_to_ip_pool.py b/sendgrid/rest/api/ip_address_management/v3/list_ip_assigned_to_ip_pool.py index 11b979dc..c75ce744 100644 --- a/sendgrid/rest/api/ip_address_management/v3/list_ip_assigned_to_ip_pool.py +++ b/sendgrid/rest/api/ip_address_management/v3/list_ip_assigned_to_ip_pool.py @@ -12,48 +12,43 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictInt from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response import ListIpAssignedToIpPool200Response + class ListIpAssignedToIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - limit: Optional[int] = None, - after_key: Optional[int] = None, - include_region: Optional[bool] = None, - + limit: Optional[int] = None, + after_key: Optional[int] = None, + include_region: Optional[bool] = None, ): - path='/v3/send_ips/pools/{poolid}/ips' + path = "/v3/send_ips/pools/{poolid}/ips" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/list_ip_pool.py b/sendgrid/rest/api/ip_address_management/v3/list_ip_pool.py index 8f83aa5c..ea463968 100644 --- a/sendgrid/rest/api/ip_address_management/v3/list_ip_pool.py +++ b/sendgrid/rest/api/ip_address_management/v3/list_ip_pool.py @@ -12,51 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response import ListIpPool200Response from sendgrid.rest.api.ip_address_management.v3.models.region7 import Region7 + class ListIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - limit: Optional[int] = None, - after_key: Optional[int] = None, - ip: Optional[str] = None, - region: Optional[Region7] = None, - include_region: Optional[bool] = None, - + limit: Optional[int] = None, + after_key: Optional[int] = None, + ip: Optional[str] = None, + region: Optional[Region7] = None, + include_region: Optional[bool] = None, ): - path='/v3/send_ips/pools' + path = "/v3/send_ips/pools" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/list_sub_user_assigned_to_ip.py b/sendgrid/rest/api/ip_address_management/v3/list_sub_user_assigned_to_ip.py index 14efeba7..6f2dff3f 100644 --- a/sendgrid/rest/api/ip_address_management/v3/list_sub_user_assigned_to_ip.py +++ b/sendgrid/rest/api/ip_address_management/v3/list_sub_user_assigned_to_ip.py @@ -12,47 +12,42 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_address_management.v3.models.list_sub_user_assigned_to_ip200_response import ListSubUserAssignedToIp200Response + class ListSubUserAssignedToIp: def __init__(self, client) -> None: self.client = client - + def send( self, - after_key: Optional[int] = None, - limit: Optional[int] = None, - + after_key: Optional[int] = None, + limit: Optional[int] = None, ): - path='/v3/send_ips/ips/{ip}/subusers' + path = "/v3/send_ips/ips/{ip}/subusers" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/__init__.py b/sendgrid/rest/api/ip_address_management/v3/models/__init__.py index 483c8192..b06eec3b 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/__init__.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/__init__.py @@ -11,41 +11,104 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.ip_address_management.v3.models.add_ip201_response import AddIp201Response -from sendgrid.rest.api.ip_address_management.v3.models.add_ip_request import AddIpRequest -from sendgrid.rest.api.ip_address_management.v3.models.add_ips_to_ip_pool200_response import AddIpsToIpPool200Response -from sendgrid.rest.api.ip_address_management.v3.models.add_ips_to_ip_pool_request import AddIpsToIpPoolRequest -from sendgrid.rest.api.ip_address_management.v3.models.add_sub_users_to_ip200_response import AddSubUsersToIp200Response -from sendgrid.rest.api.ip_address_management.v3.models.add_sub_users_to_ip_request import AddSubUsersToIpRequest -from sendgrid.rest.api.ip_address_management.v3.models.create_ip_pool201_response import CreateIpPool201Response -from sendgrid.rest.api.ip_address_management.v3.models.create_ip_pool_request import CreateIpPoolRequest -from sendgrid.rest.api.ip_address_management.v3.models.delete_ips_from_ip_pool_request import DeleteIpsFromIpPoolRequest -from sendgrid.rest.api.ip_address_management.v3.models.delete_sub_users_from_ip_request import DeleteSubUsersFromIpRequest -from sendgrid.rest.api.ip_address_management.v3.models.get_ip200_response import GetIp200Response -from sendgrid.rest.api.ip_address_management.v3.models.get_ip200_response_pools_inner import GetIp200ResponsePoolsInner -from sendgrid.rest.api.ip_address_management.v3.models.get_ip_pool200_response import GetIpPool200Response -from sendgrid.rest.api.ip_address_management.v3.models.get_ip_pool200_response_ip_count_by_region_inner import GetIpPool200ResponseIpCountByRegionInner -from sendgrid.rest.api.ip_address_management.v3.models.ip_address_management_error_response import IpAddressManagementErrorResponse -from sendgrid.rest.api.ip_address_management.v3.models.ip_address_management_error_response_errors_inner import IpAddressManagementErrorResponseErrorsInner +from sendgrid.rest.api.ip_address_management.v3.models.add_ip201_response import ( + AddIp201Response, +) +from sendgrid.rest.api.ip_address_management.v3.models.add_ip_request import ( + AddIpRequest, +) +from sendgrid.rest.api.ip_address_management.v3.models.add_ips_to_ip_pool200_response import ( + AddIpsToIpPool200Response, +) +from sendgrid.rest.api.ip_address_management.v3.models.add_ips_to_ip_pool_request import ( + AddIpsToIpPoolRequest, +) +from sendgrid.rest.api.ip_address_management.v3.models.add_sub_users_to_ip200_response import ( + AddSubUsersToIp200Response, +) +from sendgrid.rest.api.ip_address_management.v3.models.add_sub_users_to_ip_request import ( + AddSubUsersToIpRequest, +) +from sendgrid.rest.api.ip_address_management.v3.models.create_ip_pool201_response import ( + CreateIpPool201Response, +) +from sendgrid.rest.api.ip_address_management.v3.models.create_ip_pool_request import ( + CreateIpPoolRequest, +) +from sendgrid.rest.api.ip_address_management.v3.models.delete_ips_from_ip_pool_request import ( + DeleteIpsFromIpPoolRequest, +) +from sendgrid.rest.api.ip_address_management.v3.models.delete_sub_users_from_ip_request import ( + DeleteSubUsersFromIpRequest, +) +from sendgrid.rest.api.ip_address_management.v3.models.get_ip200_response import ( + GetIp200Response, +) +from sendgrid.rest.api.ip_address_management.v3.models.get_ip200_response_pools_inner import ( + GetIp200ResponsePoolsInner, +) +from sendgrid.rest.api.ip_address_management.v3.models.get_ip_pool200_response import ( + GetIpPool200Response, +) +from sendgrid.rest.api.ip_address_management.v3.models.get_ip_pool200_response_ip_count_by_region_inner import ( + GetIpPool200ResponseIpCountByRegionInner, +) +from sendgrid.rest.api.ip_address_management.v3.models.ip_address_management_error_response import ( + IpAddressManagementErrorResponse, +) +from sendgrid.rest.api.ip_address_management.v3.models.ip_address_management_error_response_errors_inner import ( + IpAddressManagementErrorResponseErrorsInner, +) from sendgrid.rest.api.ip_address_management.v3.models.items import Items -from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response import ListIp200Response -from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_metadata import ListIp200ResponseMetadata -from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_metadata_next_params import ListIp200ResponseMetadataNextParams -from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_result_inner import ListIp200ResponseResultInner -from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_result_inner_pools_inner import ListIp200ResponseResultInnerPoolsInner -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response import ListIpAssignedToIpPool200Response -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response_metadata import ListIpAssignedToIpPool200ResponseMetadata -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response_metadata_next_params import ListIpAssignedToIpPool200ResponseMetadataNextParams -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response_result_inner import ListIpAssignedToIpPool200ResponseResultInner -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response import ListIpPool200Response -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response_metadata import ListIpPool200ResponseMetadata -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response_metadata_next_params import ListIpPool200ResponseMetadataNextParams -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response_result_inner import ListIpPool200ResponseResultInner -from sendgrid.rest.api.ip_address_management.v3.models.list_sub_user_assigned_to_ip200_response import ListSubUserAssignedToIp200Response -from sendgrid.rest.api.ip_address_management.v3.models.list_sub_user_assigned_to_ip200_response_metadata import ListSubUserAssignedToIp200ResponseMetadata -from sendgrid.rest.api.ip_address_management.v3.models.list_sub_user_assigned_to_ip200_response_metadata_next_params import ListSubUserAssignedToIp200ResponseMetadataNextParams +from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response import ( + ListIp200Response, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_metadata import ( + ListIp200ResponseMetadata, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_metadata_next_params import ( + ListIp200ResponseMetadataNextParams, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_result_inner import ( + ListIp200ResponseResultInner, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_result_inner_pools_inner import ( + ListIp200ResponseResultInnerPoolsInner, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response import ( + ListIpAssignedToIpPool200Response, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response_metadata import ( + ListIpAssignedToIpPool200ResponseMetadata, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response_metadata_next_params import ( + ListIpAssignedToIpPool200ResponseMetadataNextParams, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response_result_inner import ( + ListIpAssignedToIpPool200ResponseResultInner, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response import ( + ListIpPool200Response, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response_metadata import ( + ListIpPool200ResponseMetadata, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response_metadata_next_params import ( + ListIpPool200ResponseMetadataNextParams, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response_result_inner import ( + ListIpPool200ResponseResultInner, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_sub_user_assigned_to_ip200_response import ( + ListSubUserAssignedToIp200Response, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_sub_user_assigned_to_ip200_response_metadata import ( + ListSubUserAssignedToIp200ResponseMetadata, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_sub_user_assigned_to_ip200_response_metadata_next_params import ( + ListSubUserAssignedToIp200ResponseMetadataNextParams, +) from sendgrid.rest.api.ip_address_management.v3.models.region import Region from sendgrid.rest.api.ip_address_management.v3.models.region1 import Region1 from sendgrid.rest.api.ip_address_management.v3.models.region2 import Region2 @@ -54,9 +117,64 @@ from sendgrid.rest.api.ip_address_management.v3.models.region5 import Region5 from sendgrid.rest.api.ip_address_management.v3.models.region6 import Region6 from sendgrid.rest.api.ip_address_management.v3.models.region7 import Region7 -from sendgrid.rest.api.ip_address_management.v3.models.update_ip200_response import UpdateIp200Response -from sendgrid.rest.api.ip_address_management.v3.models.update_ip_pool200_response import UpdateIpPool200Response -from sendgrid.rest.api.ip_address_management.v3.models.update_ip_pool_request import UpdateIpPoolRequest -from sendgrid.rest.api.ip_address_management.v3.models.update_ip_request import UpdateIpRequest -__all__ = [ 'AddIp201Response', 'AddIpRequest', 'AddIpsToIpPool200Response', 'AddIpsToIpPoolRequest', 'AddSubUsersToIp200Response', 'AddSubUsersToIpRequest', 'CreateIpPool201Response', 'CreateIpPoolRequest', 'DeleteIpsFromIpPoolRequest', 'DeleteSubUsersFromIpRequest', 'GetIp200Response', 'GetIp200ResponsePoolsInner', 'GetIpPool200Response', 'GetIpPool200ResponseIpCountByRegionInner', 'IpAddressManagementErrorResponse', 'IpAddressManagementErrorResponseErrorsInner', 'Items', 'ListIp200Response', 'ListIp200ResponseMetadata', 'ListIp200ResponseMetadataNextParams', 'ListIp200ResponseResultInner', 'ListIp200ResponseResultInnerPoolsInner', 'ListIpAssignedToIpPool200Response', 'ListIpAssignedToIpPool200ResponseMetadata', 'ListIpAssignedToIpPool200ResponseMetadataNextParams', 'ListIpAssignedToIpPool200ResponseResultInner', 'ListIpPool200Response', 'ListIpPool200ResponseMetadata', 'ListIpPool200ResponseMetadataNextParams', 'ListIpPool200ResponseResultInner', 'ListSubUserAssignedToIp200Response', 'ListSubUserAssignedToIp200ResponseMetadata', 'ListSubUserAssignedToIp200ResponseMetadataNextParams', 'Region', 'Region1', 'Region2', 'Region3', 'Region4', 'Region5', 'Region6', 'Region7', 'UpdateIp200Response', 'UpdateIpPool200Response', 'UpdateIpPoolRequest', 'UpdateIpRequest' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.ip_address_management.v3.models.update_ip200_response import ( + UpdateIp200Response, +) +from sendgrid.rest.api.ip_address_management.v3.models.update_ip_pool200_response import ( + UpdateIpPool200Response, +) +from sendgrid.rest.api.ip_address_management.v3.models.update_ip_pool_request import ( + UpdateIpPoolRequest, +) +from sendgrid.rest.api.ip_address_management.v3.models.update_ip_request import ( + UpdateIpRequest, +) + +__all__ = [ + "AddIp201Response", + "AddIpRequest", + "AddIpsToIpPool200Response", + "AddIpsToIpPoolRequest", + "AddSubUsersToIp200Response", + "AddSubUsersToIpRequest", + "CreateIpPool201Response", + "CreateIpPoolRequest", + "DeleteIpsFromIpPoolRequest", + "DeleteSubUsersFromIpRequest", + "GetIp200Response", + "GetIp200ResponsePoolsInner", + "GetIpPool200Response", + "GetIpPool200ResponseIpCountByRegionInner", + "IpAddressManagementErrorResponse", + "IpAddressManagementErrorResponseErrorsInner", + "Items", + "ListIp200Response", + "ListIp200ResponseMetadata", + "ListIp200ResponseMetadataNextParams", + "ListIp200ResponseResultInner", + "ListIp200ResponseResultInnerPoolsInner", + "ListIpAssignedToIpPool200Response", + "ListIpAssignedToIpPool200ResponseMetadata", + "ListIpAssignedToIpPool200ResponseMetadataNextParams", + "ListIpAssignedToIpPool200ResponseResultInner", + "ListIpPool200Response", + "ListIpPool200ResponseMetadata", + "ListIpPool200ResponseMetadataNextParams", + "ListIpPool200ResponseResultInner", + "ListSubUserAssignedToIp200Response", + "ListSubUserAssignedToIp200ResponseMetadata", + "ListSubUserAssignedToIp200ResponseMetadataNextParams", + "Region", + "Region1", + "Region2", + "Region3", + "Region4", + "Region5", + "Region6", + "Region7", + "UpdateIp200Response", + "UpdateIpPool200Response", + "UpdateIpPoolRequest", + "UpdateIpRequest", +] +# Testing code diff --git a/sendgrid/rest/api/ip_address_management/v3/models/add_ip201_response.py b/sendgrid/rest/api/ip_address_management/v3/models/add_ip201_response.py index f558d15a..4099ba74 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/add_ip201_response.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/add_ip201_response.py @@ -1,35 +1,35 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.ip_address_management.v3.models.region2 import Region2 - class AddIp201Response: def __init__( - self, - ip: Optional[str]=None, - is_auto_warmup: Optional[bool]=None, - is_parent_assigned: Optional[bool]=None, - subusers: Optional[List[str]]=None, - region: Optional[Region2]=None + self, + ip: Optional[str] = None, + is_auto_warmup: Optional[bool] = None, + is_parent_assigned: Optional[bool] = None, + subusers: Optional[List[str]] = None, + region: Optional[Region2] = None, ): - self.ip=ip - self.is_auto_warmup=is_auto_warmup - self.is_parent_assigned=is_parent_assigned - self.subusers=subusers - self.region=region + self.ip = ip + self.is_auto_warmup = is_auto_warmup + self.is_parent_assigned = is_parent_assigned + self.subusers = subusers + self.region = region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "ip": self.ip, - "is_auto_warmup": self.is_auto_warmup, - "is_parent_assigned": self.is_parent_assigned, - "subusers": self.subusers, - "region": self.region - }.items() if value is not None} + "ip": self.ip, + "is_auto_warmup": self.is_auto_warmup, + "is_parent_assigned": self.is_parent_assigned, + "subusers": self.subusers, + "region": self.region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -38,10 +38,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AddIp201Response( - ip=payload.get('ip'), - is_auto_warmup=payload.get('is_auto_warmup'), - is_parent_assigned=payload.get('is_parent_assigned'), - subusers=payload.get('subusers'), - region=payload.get('region') - ) - + ip=payload.get("ip"), + is_auto_warmup=payload.get("is_auto_warmup"), + is_parent_assigned=payload.get("is_parent_assigned"), + subusers=payload.get("subusers"), + region=payload.get("region"), + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/add_ip_request.py b/sendgrid/rest/api/ip_address_management/v3/models/add_ip_request.py index d74564e0..c73d4a76 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/add_ip_request.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/add_ip_request.py @@ -1,35 +1,35 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.ip_address_management.v3.models.region3 import Region3 - class AddIpRequest: def __init__( - self, - is_auto_warmup: Optional[bool]=None, - is_parent_assigned: Optional[bool]=None, - subusers: Optional[List[str]]=None, - region: Optional[Region3]=None, - include_region: Optional[bool]=None + self, + is_auto_warmup: Optional[bool] = None, + is_parent_assigned: Optional[bool] = None, + subusers: Optional[List[str]] = None, + region: Optional[Region3] = None, + include_region: Optional[bool] = None, ): - self.is_auto_warmup=is_auto_warmup - self.is_parent_assigned=is_parent_assigned - self.subusers=subusers - self.region=region - self.include_region=include_region + self.is_auto_warmup = is_auto_warmup + self.is_parent_assigned = is_parent_assigned + self.subusers = subusers + self.region = region + self.include_region = include_region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "is_auto_warmup": self.is_auto_warmup, - "is_parent_assigned": self.is_parent_assigned, - "subusers": self.subusers, - "region": self.region, - "include_region": self.include_region - }.items() if value is not None} + "is_auto_warmup": self.is_auto_warmup, + "is_parent_assigned": self.is_parent_assigned, + "subusers": self.subusers, + "region": self.region, + "include_region": self.include_region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -38,10 +38,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AddIpRequest( - is_auto_warmup=payload.get('is_auto_warmup'), - is_parent_assigned=payload.get('is_parent_assigned'), - subusers=payload.get('subusers'), - region=payload.get('region'), - include_region=payload.get('include_region') - ) - + is_auto_warmup=payload.get("is_auto_warmup"), + is_parent_assigned=payload.get("is_parent_assigned"), + subusers=payload.get("subusers"), + region=payload.get("region"), + include_region=payload.get("include_region"), + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/add_ips_to_ip_pool200_response.py b/sendgrid/rest/api/ip_address_management/v3/models/add_ips_to_ip_pool200_response.py index 566ac048..7f5acc14 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/add_ips_to_ip_pool200_response.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/add_ips_to_ip_pool200_response.py @@ -1,28 +1,28 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AddIpsToIpPool200Response: def __init__( - self, - name: Optional[str]=None, - id: Optional[str]=None, - ips: Optional[List[str]]=None + self, + name: Optional[str] = None, + id: Optional[str] = None, + ips: Optional[List[str]] = None, ): - self.name=name - self.id=id - self.ips=ips + self.name = name + self.id = id + self.ips = ips def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "id": self.id, - "ips": self.ips - }.items() if value is not None} + "name": self.name, + "id": self.id, + "ips": self.ips, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AddIpsToIpPool200Response( - name=payload.get('name'), - id=payload.get('id'), - ips=payload.get('ips') - ) - + name=payload.get("name"), id=payload.get("id"), ips=payload.get("ips") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/add_ips_to_ip_pool_request.py b/sendgrid/rest/api/ip_address_management/v3/models/add_ips_to_ip_pool_request.py index 797e6ee9..883da07e 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/add_ips_to_ip_pool_request.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/add_ips_to_ip_pool_request.py @@ -1,22 +1,17 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AddIpsToIpPoolRequest: - def __init__( - self, - ips: Optional[List[str]]=None - ): - self.ips=ips + def __init__(self, ips: Optional[List[str]] = None): + self.ips = ips def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ips": self.ips - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ips": self.ips}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AddIpsToIpPoolRequest( - ips=payload.get('ips') - ) - + return AddIpsToIpPoolRequest(ips=payload.get("ips")) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/add_sub_users_to_ip200_response.py b/sendgrid/rest/api/ip_address_management/v3/models/add_sub_users_to_ip200_response.py index a09dc522..345e3455 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/add_sub_users_to_ip200_response.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/add_sub_users_to_ip200_response.py @@ -1,25 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AddSubUsersToIp200Response: - def __init__( - self, - ip: Optional[str]=None, - subusers: Optional[List[str]]=None - ): - self.ip=ip - self.subusers=subusers + def __init__(self, ip: Optional[str] = None, subusers: Optional[List[str]] = None): + self.ip = ip + self.subusers = subusers def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ip": self.ip, - "subusers": self.subusers - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ip": self.ip, "subusers": self.subusers}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AddSubUsersToIp200Response( - ip=payload.get('ip'), - subusers=payload.get('subusers') - ) - + ip=payload.get("ip"), subusers=payload.get("subusers") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/add_sub_users_to_ip_request.py b/sendgrid/rest/api/ip_address_management/v3/models/add_sub_users_to_ip_request.py index 5cd0ce47..516553d7 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/add_sub_users_to_ip_request.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/add_sub_users_to_ip_request.py @@ -1,22 +1,17 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AddSubUsersToIpRequest: - def __init__( - self, - subusers: Optional[List[str]]=None - ): - self.subusers=subusers + def __init__(self, subusers: Optional[List[str]] = None): + self.subusers = subusers def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "subusers": self.subusers - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"subusers": self.subusers}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AddSubUsersToIpRequest( - subusers=payload.get('subusers') - ) - + return AddSubUsersToIpRequest(subusers=payload.get("subusers")) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/create_ip_pool201_response.py b/sendgrid/rest/api/ip_address_management/v3/models/create_ip_pool201_response.py index 13efed2e..463654b3 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/create_ip_pool201_response.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/create_ip_pool201_response.py @@ -1,28 +1,28 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateIpPool201Response: def __init__( - self, - name: Optional[str]=None, - id: Optional[str]=None, - ips: Optional[List[str]]=None + self, + name: Optional[str] = None, + id: Optional[str] = None, + ips: Optional[List[str]] = None, ): - self.name=name - self.id=id - self.ips=ips + self.name = name + self.id = id + self.ips = ips def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "id": self.id, - "ips": self.ips - }.items() if value is not None} + "name": self.name, + "id": self.id, + "ips": self.ips, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateIpPool201Response( - name=payload.get('name'), - id=payload.get('id'), - ips=payload.get('ips') - ) - + name=payload.get("name"), id=payload.get("id"), ips=payload.get("ips") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/create_ip_pool_request.py b/sendgrid/rest/api/ip_address_management/v3/models/create_ip_pool_request.py index 03cf06a0..610c6d16 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/create_ip_pool_request.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/create_ip_pool_request.py @@ -1,25 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateIpPoolRequest: - def __init__( - self, - name: Optional[str]=None, - ips: Optional[List[str]]=None - ): - self.name=name - self.ips=ips + def __init__(self, name: Optional[str] = None, ips: Optional[List[str]] = None): + self.name = name + self.ips = ips def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name, - "ips": self.ips - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name, "ips": self.ips}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -27,8 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return CreateIpPoolRequest( - name=payload.get('name'), - ips=payload.get('ips') - ) - + return CreateIpPoolRequest(name=payload.get("name"), ips=payload.get("ips")) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/delete_ips_from_ip_pool_request.py b/sendgrid/rest/api/ip_address_management/v3/models/delete_ips_from_ip_pool_request.py index 5d6e1291..bc118875 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/delete_ips_from_ip_pool_request.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/delete_ips_from_ip_pool_request.py @@ -1,22 +1,17 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DeleteIpsFromIpPoolRequest: - def __init__( - self, - ips: Optional[List[str]]=None - ): - self.ips=ips + def __init__(self, ips: Optional[List[str]] = None): + self.ips = ips def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ips": self.ips - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ips": self.ips}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DeleteIpsFromIpPoolRequest( - ips=payload.get('ips') - ) - + return DeleteIpsFromIpPoolRequest(ips=payload.get("ips")) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/delete_sub_users_from_ip_request.py b/sendgrid/rest/api/ip_address_management/v3/models/delete_sub_users_from_ip_request.py index 99552720..fae948ff 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/delete_sub_users_from_ip_request.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/delete_sub_users_from_ip_request.py @@ -1,22 +1,17 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DeleteSubUsersFromIpRequest: - def __init__( - self, - subusers: Optional[List[str]]=None - ): - self.subusers=subusers + def __init__(self, subusers: Optional[List[str]] = None): + self.subusers = subusers def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "subusers": self.subusers - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"subusers": self.subusers}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DeleteSubUsersFromIpRequest( - subusers=payload.get('subusers') - ) - + return DeleteSubUsersFromIpRequest(subusers=payload.get("subusers")) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/get_ip200_response.py b/sendgrid/rest/api/ip_address_management/v3/models/get_ip200_response.py index 1dda745c..b336f09c 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/get_ip200_response.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/get_ip200_response.py @@ -1,47 +1,49 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_address_management.v3.models.get_ip200_response_pools_inner import GetIp200ResponsePoolsInner - +from sendgrid.rest.api.ip_address_management.v3.models.get_ip200_response_pools_inner import ( + GetIp200ResponsePoolsInner, +) class GetIp200Response: def __init__( - self, - ip: Optional[str]=None, - is_parent_assigned: Optional[bool]=None, - is_auto_warmup: Optional[bool]=None, - pools: Optional[List[GetIp200ResponsePoolsInner]]=None, - added_at: Optional[int]=None, - updated_at: Optional[int]=None, - is_enabled: Optional[bool]=None, - is_leased: Optional[bool]=None, - region: Optional[str]=None + self, + ip: Optional[str] = None, + is_parent_assigned: Optional[bool] = None, + is_auto_warmup: Optional[bool] = None, + pools: Optional[List[GetIp200ResponsePoolsInner]] = None, + added_at: Optional[int] = None, + updated_at: Optional[int] = None, + is_enabled: Optional[bool] = None, + is_leased: Optional[bool] = None, + region: Optional[str] = None, ): - self.ip=ip - self.is_parent_assigned=is_parent_assigned - self.is_auto_warmup=is_auto_warmup - self.pools=pools - self.added_at=added_at - self.updated_at=updated_at - self.is_enabled=is_enabled - self.is_leased=is_leased - self.region=region + self.ip = ip + self.is_parent_assigned = is_parent_assigned + self.is_auto_warmup = is_auto_warmup + self.pools = pools + self.added_at = added_at + self.updated_at = updated_at + self.is_enabled = is_enabled + self.is_leased = is_leased + self.region = region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "ip": self.ip, - "is_parent_assigned": self.is_parent_assigned, - "is_auto_warmup": self.is_auto_warmup, - "pools": self.pools, - "added_at": self.added_at, - "updated_at": self.updated_at, - "is_enabled": self.is_enabled, - "is_leased": self.is_leased, - "region": self.region - }.items() if value is not None} + "ip": self.ip, + "is_parent_assigned": self.is_parent_assigned, + "is_auto_warmup": self.is_auto_warmup, + "pools": self.pools, + "added_at": self.added_at, + "updated_at": self.updated_at, + "is_enabled": self.is_enabled, + "is_leased": self.is_leased, + "region": self.region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -50,14 +52,13 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetIp200Response( - ip=payload.get('ip'), - is_parent_assigned=payload.get('is_parent_assigned'), - is_auto_warmup=payload.get('is_auto_warmup'), - pools=payload.get('pools'), - added_at=payload.get('added_at'), - updated_at=payload.get('updated_at'), - is_enabled=payload.get('is_enabled'), - is_leased=payload.get('is_leased'), - region=payload.get('region') - ) - + ip=payload.get("ip"), + is_parent_assigned=payload.get("is_parent_assigned"), + is_auto_warmup=payload.get("is_auto_warmup"), + pools=payload.get("pools"), + added_at=payload.get("added_at"), + updated_at=payload.get("updated_at"), + is_enabled=payload.get("is_enabled"), + is_leased=payload.get("is_leased"), + region=payload.get("region"), + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/get_ip200_response_pools_inner.py b/sendgrid/rest/api/ip_address_management/v3/models/get_ip200_response_pools_inner.py index 6965591a..806d1c28 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/get_ip200_response_pools_inner.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/get_ip200_response_pools_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GetIp200ResponsePoolsInner: - def __init__( - self, - id: Optional[str]=None, - name: Optional[str]=None - ): - self.id=id - self.name=name + def __init__(self, id: Optional[str] = None, name: Optional[str] = None): + self.id = id + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "id": self.id, - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"id": self.id, "name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetIp200ResponsePoolsInner( - id=payload.get('id'), - name=payload.get('name') - ) - + id=payload.get("id"), name=payload.get("name") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/get_ip_pool200_response.py b/sendgrid/rest/api/ip_address_management/v3/models/get_ip_pool200_response.py index 74e52801..85b15648 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/get_ip_pool200_response.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/get_ip_pool200_response.py @@ -1,35 +1,39 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_address_management.v3.models.get_ip_pool200_response_ip_count_by_region_inner import GetIpPool200ResponseIpCountByRegionInner - +from sendgrid.rest.api.ip_address_management.v3.models.get_ip_pool200_response_ip_count_by_region_inner import ( + GetIpPool200ResponseIpCountByRegionInner, +) class GetIpPool200Response: def __init__( - self, - name: Optional[str]=None, - id: Optional[str]=None, - ips_preview: Optional[List[str]]=None, - total_ip_count: Optional[int]=None, - ip_count_by_region: Optional[List[GetIpPool200ResponseIpCountByRegionInner]]=None + self, + name: Optional[str] = None, + id: Optional[str] = None, + ips_preview: Optional[List[str]] = None, + total_ip_count: Optional[int] = None, + ip_count_by_region: Optional[ + List[GetIpPool200ResponseIpCountByRegionInner] + ] = None, ): - self.name=name - self.id=id - self.ips_preview=ips_preview - self.total_ip_count=total_ip_count - self.ip_count_by_region=ip_count_by_region + self.name = name + self.id = id + self.ips_preview = ips_preview + self.total_ip_count = total_ip_count + self.ip_count_by_region = ip_count_by_region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "id": self.id, - "ips_preview": self.ips_preview, - "total_ip_count": self.total_ip_count, - "ip_count_by_region": self.ip_count_by_region - }.items() if value is not None} + "name": self.name, + "id": self.id, + "ips_preview": self.ips_preview, + "total_ip_count": self.total_ip_count, + "ip_count_by_region": self.ip_count_by_region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -38,10 +42,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetIpPool200Response( - name=payload.get('name'), - id=payload.get('id'), - ips_preview=payload.get('ips_preview'), - total_ip_count=payload.get('total_ip_count'), - ip_count_by_region=payload.get('ip_count_by_region') - ) - + name=payload.get("name"), + id=payload.get("id"), + ips_preview=payload.get("ips_preview"), + total_ip_count=payload.get("total_ip_count"), + ip_count_by_region=payload.get("ip_count_by_region"), + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/get_ip_pool200_response_ip_count_by_region_inner.py b/sendgrid/rest/api/ip_address_management/v3/models/get_ip_pool200_response_ip_count_by_region_inner.py index a993efc0..93296cb5 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/get_ip_pool200_response_ip_count_by_region_inner.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/get_ip_pool200_response_ip_count_by_region_inner.py @@ -1,26 +1,19 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.ip_address_management.v3.models.region5 import Region5 - class GetIpPool200ResponseIpCountByRegionInner: - def __init__( - self, - region: Optional[Region5]=None, - count: Optional[int]=None - ): - self.region=region - self.count=count + def __init__(self, region: Optional[Region5] = None, count: Optional[int] = None): + self.region = region + self.count = count def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "region": self.region, - "count": self.count - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"region": self.region, "count": self.count}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +22,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetIpPool200ResponseIpCountByRegionInner( - region=payload.get('region'), - count=payload.get('count') - ) - + region=payload.get("region"), count=payload.get("count") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/ip_address_management_error_response.py b/sendgrid/rest/api/ip_address_management/v3/models/ip_address_management_error_response.py index 52f9f3c8..1e926a61 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/ip_address_management_error_response.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/ip_address_management_error_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_address_management.v3.models.ip_address_management_error_response_errors_inner import IpAddressManagementErrorResponseErrorsInner - +from sendgrid.rest.api.ip_address_management.v3.models.ip_address_management_error_response_errors_inner import ( + IpAddressManagementErrorResponseErrorsInner, +) class IpAddressManagementErrorResponse: def __init__( - self, - errors: Optional[List[IpAddressManagementErrorResponseErrorsInner]]=None + self, errors: Optional[List[IpAddressManagementErrorResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return IpAddressManagementErrorResponse( - errors=payload.get('errors') - ) - + return IpAddressManagementErrorResponse(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/ip_address_management_error_response_errors_inner.py b/sendgrid/rest/api/ip_address_management/v3/models/ip_address_management_error_response_errors_inner.py index 207240bf..0e281b63 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/ip_address_management_error_response_errors_inner.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/ip_address_management_error_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class IpAddressManagementErrorResponseErrorsInner: - def __init__( - self, - field: Optional[str]=None, - message: Optional[str]=None - ): - self.field=field - self.message=message + def __init__(self, field: Optional[str] = None, message: Optional[str] = None): + self.field = field + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "field": self.field, - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"field": self.field, "message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return IpAddressManagementErrorResponseErrorsInner( - field=payload.get('field'), - message=payload.get('message') - ) - + field=payload.get("field"), message=payload.get("message") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/items.py b/sendgrid/rest/api/ip_address_management/v3/models/items.py index 57100bd5..84d4a533 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/items.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/items.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Items(Enum): - EU='eu' - US='us' - + EU = "eu" + US = "us" diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response.py b/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response.py index 91ef02d3..4fd4e8ae 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response.py @@ -1,27 +1,31 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_metadata import ListIp200ResponseMetadata -from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_result_inner import ListIp200ResponseResultInner - +from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_metadata import ( + ListIp200ResponseMetadata, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_result_inner import ( + ListIp200ResponseResultInner, +) class ListIp200Response: def __init__( - self, - result: Optional[List[ListIp200ResponseResultInner]]=None, - metadata: Optional[ListIp200ResponseMetadata]=None + self, + result: Optional[List[ListIp200ResponseResultInner]] = None, + metadata: Optional[ListIp200ResponseMetadata] = None, ): - self.result=result - self.metadata=metadata + self.result = result + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "result": self.result, - "_metadata": self.metadata - }.items() if value is not None} + "result": self.result, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -30,7 +34,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListIp200Response( - result=payload.get('result'), - metadata=payload.get('_metadata') - ) - + result=payload.get("result"), metadata=payload.get("_metadata") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_metadata.py b/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_metadata.py index 1d215b42..d59988aa 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_metadata.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_metadata.py @@ -1,23 +1,22 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_metadata_next_params import ListIp200ResponseMetadataNextParams - +from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_metadata_next_params import ( + ListIp200ResponseMetadataNextParams, +) class ListIp200ResponseMetadata: def __init__( - self, - next_params: Optional[ListIp200ResponseMetadataNextParams]=None + self, next_params: Optional[ListIp200ResponseMetadataNextParams] = None ): - self.next_params=next_params + self.next_params = next_params def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "next_params": self.next_params - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"next_params": self.next_params}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListIp200ResponseMetadata( - next_params=payload.get('next_params') - ) - + return ListIp200ResponseMetadata(next_params=payload.get("next_params")) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_metadata_next_params.py b/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_metadata_next_params.py index 413911e7..41a93394 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_metadata_next_params.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_metadata_next_params.py @@ -1,56 +1,56 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.ip_address_management.v3.models.region1 import Region1 - class ListIp200ResponseMetadataNextParams: def __init__( - self, - after_key: Optional[str]=None, - before_key: Optional[str]=None, - ip: Optional[str]=None, - is_leased: Optional[bool]=None, - is_enabled: Optional[bool]=None, - is_parent_assigned: Optional[bool]=None, - pool: Optional[str]=None, - start_added_at: Optional[str]=None, - end_added_at: Optional[str]=None, - limit: Optional[str]=None, - region: Optional[Region1]=None, - include_region: Optional[str]=None + self, + after_key: Optional[str] = None, + before_key: Optional[str] = None, + ip: Optional[str] = None, + is_leased: Optional[bool] = None, + is_enabled: Optional[bool] = None, + is_parent_assigned: Optional[bool] = None, + pool: Optional[str] = None, + start_added_at: Optional[str] = None, + end_added_at: Optional[str] = None, + limit: Optional[str] = None, + region: Optional[Region1] = None, + include_region: Optional[str] = None, ): - self.after_key=after_key - self.before_key=before_key - self.ip=ip - self.is_leased=is_leased - self.is_enabled=is_enabled - self.is_parent_assigned=is_parent_assigned - self.pool=pool - self.start_added_at=start_added_at - self.end_added_at=end_added_at - self.limit=limit - self.region=region - self.include_region=include_region + self.after_key = after_key + self.before_key = before_key + self.ip = ip + self.is_leased = is_leased + self.is_enabled = is_enabled + self.is_parent_assigned = is_parent_assigned + self.pool = pool + self.start_added_at = start_added_at + self.end_added_at = end_added_at + self.limit = limit + self.region = region + self.include_region = include_region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "after_key": self.after_key, - "before_key": self.before_key, - "ip": self.ip, - "is_leased": self.is_leased, - "is_enabled": self.is_enabled, - "is_parent_assigned": self.is_parent_assigned, - "pool": self.pool, - "start_added_at": self.start_added_at, - "end_added_at": self.end_added_at, - "limit": self.limit, - "region": self.region, - "include_region": self.include_region - }.items() if value is not None} + "after_key": self.after_key, + "before_key": self.before_key, + "ip": self.ip, + "is_leased": self.is_leased, + "is_enabled": self.is_enabled, + "is_parent_assigned": self.is_parent_assigned, + "pool": self.pool, + "start_added_at": self.start_added_at, + "end_added_at": self.end_added_at, + "limit": self.limit, + "region": self.region, + "include_region": self.include_region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -59,17 +59,16 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListIp200ResponseMetadataNextParams( - after_key=payload.get('after_key'), - before_key=payload.get('before_key'), - ip=payload.get('ip'), - is_leased=payload.get('is_leased'), - is_enabled=payload.get('is_enabled'), - is_parent_assigned=payload.get('is_parent_assigned'), - pool=payload.get('pool'), - start_added_at=payload.get('start_added_at'), - end_added_at=payload.get('end_added_at'), - limit=payload.get('limit'), - region=payload.get('region'), - include_region=payload.get('include_region') - ) - + after_key=payload.get("after_key"), + before_key=payload.get("before_key"), + ip=payload.get("ip"), + is_leased=payload.get("is_leased"), + is_enabled=payload.get("is_enabled"), + is_parent_assigned=payload.get("is_parent_assigned"), + pool=payload.get("pool"), + start_added_at=payload.get("start_added_at"), + end_added_at=payload.get("end_added_at"), + limit=payload.get("limit"), + region=payload.get("region"), + include_region=payload.get("include_region"), + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_result_inner.py b/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_result_inner.py index 1d0958dd..a68da0a6 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_result_inner.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_result_inner.py @@ -1,48 +1,50 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_result_inner_pools_inner import ListIp200ResponseResultInnerPoolsInner +from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_result_inner_pools_inner import ( + ListIp200ResponseResultInnerPoolsInner, +) from sendgrid.rest.api.ip_address_management.v3.models.region import Region - class ListIp200ResponseResultInner: def __init__( - self, - ip: Optional[str]=None, - pools: Optional[List[ListIp200ResponseResultInnerPoolsInner]]=None, - is_auto_warmup: Optional[bool]=None, - is_parent_assigned: Optional[bool]=None, - updated_at: Optional[int]=None, - is_enabled: Optional[bool]=None, - is_leased: Optional[bool]=None, - added_at: Optional[int]=None, - region: Optional[Region]=None + self, + ip: Optional[str] = None, + pools: Optional[List[ListIp200ResponseResultInnerPoolsInner]] = None, + is_auto_warmup: Optional[bool] = None, + is_parent_assigned: Optional[bool] = None, + updated_at: Optional[int] = None, + is_enabled: Optional[bool] = None, + is_leased: Optional[bool] = None, + added_at: Optional[int] = None, + region: Optional[Region] = None, ): - self.ip=ip - self.pools=pools - self.is_auto_warmup=is_auto_warmup - self.is_parent_assigned=is_parent_assigned - self.updated_at=updated_at - self.is_enabled=is_enabled - self.is_leased=is_leased - self.added_at=added_at - self.region=region + self.ip = ip + self.pools = pools + self.is_auto_warmup = is_auto_warmup + self.is_parent_assigned = is_parent_assigned + self.updated_at = updated_at + self.is_enabled = is_enabled + self.is_leased = is_leased + self.added_at = added_at + self.region = region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "ip": self.ip, - "pools": self.pools, - "is_auto_warmup": self.is_auto_warmup, - "is_parent_assigned": self.is_parent_assigned, - "updated_at": self.updated_at, - "is_enabled": self.is_enabled, - "is_leased": self.is_leased, - "added_at": self.added_at, - "region": self.region - }.items() if value is not None} + "ip": self.ip, + "pools": self.pools, + "is_auto_warmup": self.is_auto_warmup, + "is_parent_assigned": self.is_parent_assigned, + "updated_at": self.updated_at, + "is_enabled": self.is_enabled, + "is_leased": self.is_leased, + "added_at": self.added_at, + "region": self.region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -51,14 +53,13 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListIp200ResponseResultInner( - ip=payload.get('ip'), - pools=payload.get('pools'), - is_auto_warmup=payload.get('is_auto_warmup'), - is_parent_assigned=payload.get('is_parent_assigned'), - updated_at=payload.get('updated_at'), - is_enabled=payload.get('is_enabled'), - is_leased=payload.get('is_leased'), - added_at=payload.get('added_at'), - region=payload.get('region') - ) - + ip=payload.get("ip"), + pools=payload.get("pools"), + is_auto_warmup=payload.get("is_auto_warmup"), + is_parent_assigned=payload.get("is_parent_assigned"), + updated_at=payload.get("updated_at"), + is_enabled=payload.get("is_enabled"), + is_leased=payload.get("is_leased"), + added_at=payload.get("added_at"), + region=payload.get("region"), + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_result_inner_pools_inner.py b/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_result_inner_pools_inner.py index 89d5761b..232f4d16 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_result_inner_pools_inner.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_ip200_response_result_inner_pools_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListIp200ResponseResultInnerPoolsInner: - def __init__( - self, - name: Optional[str]=None, - id: Optional[str]=None - ): - self.name=name - self.id=id + def __init__(self, name: Optional[str] = None, id: Optional[str] = None): + self.name = name + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListIp200ResponseResultInnerPoolsInner( - name=payload.get('name'), - id=payload.get('id') - ) - + name=payload.get("name"), id=payload.get("id") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response.py b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response.py index 93af81b8..425fcf1b 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response.py @@ -1,27 +1,31 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response_metadata import ListIpAssignedToIpPool200ResponseMetadata -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response_result_inner import ListIpAssignedToIpPool200ResponseResultInner - +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response_metadata import ( + ListIpAssignedToIpPool200ResponseMetadata, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response_result_inner import ( + ListIpAssignedToIpPool200ResponseResultInner, +) class ListIpAssignedToIpPool200Response: def __init__( - self, - result: Optional[List[ListIpAssignedToIpPool200ResponseResultInner]]=None, - metadata: Optional[ListIpAssignedToIpPool200ResponseMetadata]=None + self, + result: Optional[List[ListIpAssignedToIpPool200ResponseResultInner]] = None, + metadata: Optional[ListIpAssignedToIpPool200ResponseMetadata] = None, ): - self.result=result - self.metadata=metadata + self.result = result + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "result": self.result, - "_metadata": self.metadata - }.items() if value is not None} + "result": self.result, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -30,7 +34,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListIpAssignedToIpPool200Response( - result=payload.get('result'), - metadata=payload.get('_metadata') - ) - + result=payload.get("result"), metadata=payload.get("_metadata") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response_metadata.py b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response_metadata.py index 88513e64..c61eedb7 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response_metadata.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response_metadata.py @@ -1,23 +1,25 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response_metadata_next_params import ListIpAssignedToIpPool200ResponseMetadataNextParams - +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_assigned_to_ip_pool200_response_metadata_next_params import ( + ListIpAssignedToIpPool200ResponseMetadataNextParams, +) class ListIpAssignedToIpPool200ResponseMetadata: def __init__( - self, - next_params: Optional[ListIpAssignedToIpPool200ResponseMetadataNextParams]=None + self, + next_params: Optional[ + ListIpAssignedToIpPool200ResponseMetadataNextParams + ] = None, ): - self.next_params=next_params + self.next_params = next_params def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "next_params": self.next_params - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"next_params": self.next_params}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -26,6 +28,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListIpAssignedToIpPool200ResponseMetadata( - next_params=payload.get('next_params') - ) - + next_params=payload.get("next_params") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response_metadata_next_params.py b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response_metadata_next_params.py index c6ac0f88..69ae4854 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response_metadata_next_params.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response_metadata_next_params.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListIpAssignedToIpPool200ResponseMetadataNextParams: def __init__( - self, - after_key: Optional[str]=None, - limit: Optional[str]=None, - include_region: Optional[str]=None + self, + after_key: Optional[str] = None, + limit: Optional[str] = None, + include_region: Optional[str] = None, ): - self.after_key=after_key - self.limit=limit - self.include_region=include_region + self.after_key = after_key + self.limit = limit + self.include_region = include_region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "after_key": self.after_key, - "limit": self.limit, - "include_region": self.include_region - }.items() if value is not None} + "after_key": self.after_key, + "limit": self.limit, + "include_region": self.include_region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListIpAssignedToIpPool200ResponseMetadataNextParams( - after_key=payload.get('after_key'), - limit=payload.get('limit'), - include_region=payload.get('include_region') - ) - + after_key=payload.get("after_key"), + limit=payload.get("limit"), + include_region=payload.get("include_region"), + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response_result_inner.py b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response_result_inner.py index 1dae9446..2ecd4386 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response_result_inner.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_assigned_to_ip_pool200_response_result_inner.py @@ -1,30 +1,32 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_result_inner_pools_inner import ListIp200ResponseResultInnerPoolsInner +from sendgrid.rest.api.ip_address_management.v3.models.list_ip200_response_result_inner_pools_inner import ( + ListIp200ResponseResultInnerPoolsInner, +) from sendgrid.rest.api.ip_address_management.v3.models.region6 import Region6 - class ListIpAssignedToIpPool200ResponseResultInner: def __init__( - self, - ip: Optional[str]=None, - region: Optional[Region6]=None, - pools: Optional[List[ListIp200ResponseResultInnerPoolsInner]]=None + self, + ip: Optional[str] = None, + region: Optional[Region6] = None, + pools: Optional[List[ListIp200ResponseResultInnerPoolsInner]] = None, ): - self.ip=ip - self.region=region - self.pools=pools + self.ip = ip + self.region = region + self.pools = pools def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "ip": self.ip, - "region": self.region, - "pools": self.pools - }.items() if value is not None} + "ip": self.ip, + "region": self.region, + "pools": self.pools, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -33,8 +35,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListIpAssignedToIpPool200ResponseResultInner( - ip=payload.get('ip'), - region=payload.get('region'), - pools=payload.get('pools') - ) - + ip=payload.get("ip"), + region=payload.get("region"), + pools=payload.get("pools"), + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response.py b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response.py index 88449e68..8a419491 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response.py @@ -1,27 +1,31 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response_metadata import ListIpPool200ResponseMetadata -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response_result_inner import ListIpPool200ResponseResultInner - +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response_metadata import ( + ListIpPool200ResponseMetadata, +) +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response_result_inner import ( + ListIpPool200ResponseResultInner, +) class ListIpPool200Response: def __init__( - self, - result: Optional[List[ListIpPool200ResponseResultInner]]=None, - metadata: Optional[ListIpPool200ResponseMetadata]=None + self, + result: Optional[List[ListIpPool200ResponseResultInner]] = None, + metadata: Optional[ListIpPool200ResponseMetadata] = None, ): - self.result=result - self.metadata=metadata + self.result = result + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "result": self.result, - "_metadata": self.metadata - }.items() if value is not None} + "result": self.result, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -30,7 +34,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListIpPool200Response( - result=payload.get('result'), - metadata=payload.get('_metadata') - ) - + result=payload.get("result"), metadata=payload.get("_metadata") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response_metadata.py b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response_metadata.py index b82156fa..1aed9c06 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response_metadata.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response_metadata.py @@ -1,23 +1,22 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response_metadata_next_params import ListIpPool200ResponseMetadataNextParams - +from sendgrid.rest.api.ip_address_management.v3.models.list_ip_pool200_response_metadata_next_params import ( + ListIpPool200ResponseMetadataNextParams, +) class ListIpPool200ResponseMetadata: def __init__( - self, - next_params: Optional[ListIpPool200ResponseMetadataNextParams]=None + self, next_params: Optional[ListIpPool200ResponseMetadataNextParams] = None ): - self.next_params=next_params + self.next_params = next_params def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "next_params": self.next_params - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"next_params": self.next_params}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListIpPool200ResponseMetadata( - next_params=payload.get('next_params') - ) - + return ListIpPool200ResponseMetadata(next_params=payload.get("next_params")) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response_metadata_next_params.py b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response_metadata_next_params.py index eac06b1d..615ede9b 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response_metadata_next_params.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response_metadata_next_params.py @@ -1,35 +1,35 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.ip_address_management.v3.models.region4 import Region4 - class ListIpPool200ResponseMetadataNextParams: def __init__( - self, - after_key: Optional[str]=None, - ip: Optional[str]=None, - limit: Optional[str]=None, - region: Optional[Region4]=None, - include_region: Optional[str]=None + self, + after_key: Optional[str] = None, + ip: Optional[str] = None, + limit: Optional[str] = None, + region: Optional[Region4] = None, + include_region: Optional[str] = None, ): - self.after_key=after_key - self.ip=ip - self.limit=limit - self.region=region - self.include_region=include_region + self.after_key = after_key + self.ip = ip + self.limit = limit + self.region = region + self.include_region = include_region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "after_key": self.after_key, - "ip": self.ip, - "limit": self.limit, - "region": self.region, - "include_region": self.include_region - }.items() if value is not None} + "after_key": self.after_key, + "ip": self.ip, + "limit": self.limit, + "region": self.region, + "include_region": self.include_region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -38,10 +38,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListIpPool200ResponseMetadataNextParams( - after_key=payload.get('after_key'), - ip=payload.get('ip'), - limit=payload.get('limit'), - region=payload.get('region'), - include_region=payload.get('include_region') - ) - + after_key=payload.get("after_key"), + ip=payload.get("ip"), + limit=payload.get("limit"), + region=payload.get("region"), + include_region=payload.get("include_region"), + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response_result_inner.py b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response_result_inner.py index 637ab7ee..2af37b47 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response_result_inner.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_ip_pool200_response_result_inner.py @@ -1,35 +1,35 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.ip_address_management.v3.models.items import Items - class ListIpPool200ResponseResultInner: def __init__( - self, - name: Optional[str]=None, - id: Optional[str]=None, - regions: Optional[List[Items]]=None, - ips_preview: Optional[List[str]]=None, - total_ip_count: Optional[int]=None + self, + name: Optional[str] = None, + id: Optional[str] = None, + regions: Optional[List[Items]] = None, + ips_preview: Optional[List[str]] = None, + total_ip_count: Optional[int] = None, ): - self.name=name - self.id=id - self.regions=regions - self.ips_preview=ips_preview - self.total_ip_count=total_ip_count + self.name = name + self.id = id + self.regions = regions + self.ips_preview = ips_preview + self.total_ip_count = total_ip_count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "id": self.id, - "regions": self.regions, - "ips_preview": self.ips_preview, - "total_ip_count": self.total_ip_count - }.items() if value is not None} + "name": self.name, + "id": self.id, + "regions": self.regions, + "ips_preview": self.ips_preview, + "total_ip_count": self.total_ip_count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -38,10 +38,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListIpPool200ResponseResultInner( - name=payload.get('name'), - id=payload.get('id'), - regions=payload.get('regions'), - ips_preview=payload.get('ips_preview'), - total_ip_count=payload.get('total_ip_count') - ) - + name=payload.get("name"), + id=payload.get("id"), + regions=payload.get("regions"), + ips_preview=payload.get("ips_preview"), + total_ip_count=payload.get("total_ip_count"), + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_sub_user_assigned_to_ip200_response.py b/sendgrid/rest/api/ip_address_management/v3/models/list_sub_user_assigned_to_ip200_response.py index a81269ef..40a00274 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_sub_user_assigned_to_ip200_response.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_sub_user_assigned_to_ip200_response.py @@ -1,26 +1,28 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_address_management.v3.models.list_sub_user_assigned_to_ip200_response_metadata import ListSubUserAssignedToIp200ResponseMetadata - +from sendgrid.rest.api.ip_address_management.v3.models.list_sub_user_assigned_to_ip200_response_metadata import ( + ListSubUserAssignedToIp200ResponseMetadata, +) class ListSubUserAssignedToIp200Response: def __init__( - self, - result: Optional[List[str]]=None, - metadata: Optional[ListSubUserAssignedToIp200ResponseMetadata]=None + self, + result: Optional[List[str]] = None, + metadata: Optional[ListSubUserAssignedToIp200ResponseMetadata] = None, ): - self.result=result - self.metadata=metadata + self.result = result + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "result": self.result, - "_metadata": self.metadata - }.items() if value is not None} + "result": self.result, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +31,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListSubUserAssignedToIp200Response( - result=payload.get('result'), - metadata=payload.get('_metadata') - ) - + result=payload.get("result"), metadata=payload.get("_metadata") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_sub_user_assigned_to_ip200_response_metadata.py b/sendgrid/rest/api/ip_address_management/v3/models/list_sub_user_assigned_to_ip200_response_metadata.py index 0749bffb..6b7877cc 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_sub_user_assigned_to_ip200_response_metadata.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_sub_user_assigned_to_ip200_response_metadata.py @@ -1,23 +1,25 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_address_management.v3.models.list_sub_user_assigned_to_ip200_response_metadata_next_params import ListSubUserAssignedToIp200ResponseMetadataNextParams - +from sendgrid.rest.api.ip_address_management.v3.models.list_sub_user_assigned_to_ip200_response_metadata_next_params import ( + ListSubUserAssignedToIp200ResponseMetadataNextParams, +) class ListSubUserAssignedToIp200ResponseMetadata: def __init__( - self, - next_params: Optional[ListSubUserAssignedToIp200ResponseMetadataNextParams]=None + self, + next_params: Optional[ + ListSubUserAssignedToIp200ResponseMetadataNextParams + ] = None, ): - self.next_params=next_params + self.next_params = next_params def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "next_params": self.next_params - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"next_params": self.next_params}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -26,6 +28,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListSubUserAssignedToIp200ResponseMetadata( - next_params=payload.get('next_params') - ) - + next_params=payload.get("next_params") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/list_sub_user_assigned_to_ip200_response_metadata_next_params.py b/sendgrid/rest/api/ip_address_management/v3/models/list_sub_user_assigned_to_ip200_response_metadata_next_params.py index db56b8f0..3c001113 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/list_sub_user_assigned_to_ip200_response_metadata_next_params.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/list_sub_user_assigned_to_ip200_response_metadata_next_params.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListSubUserAssignedToIp200ResponseMetadataNextParams: - def __init__( - self, - after_key: Optional[str]=None, - limit: Optional[str]=None - ): - self.after_key=after_key - self.limit=limit + def __init__(self, after_key: Optional[str] = None, limit: Optional[str] = None): + self.after_key = after_key + self.limit = limit def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "after_key": self.after_key, - "limit": self.limit - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"after_key": self.after_key, "limit": self.limit}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListSubUserAssignedToIp200ResponseMetadataNextParams( - after_key=payload.get('after_key'), - limit=payload.get('limit') - ) - + after_key=payload.get("after_key"), limit=payload.get("limit") + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/region.py b/sendgrid/rest/api/ip_address_management/v3/models/region.py index fb91e86a..7a3adff7 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/region.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/region.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Region(Enum): - EU='eu' - US='us' - + EU = "eu" + US = "us" diff --git a/sendgrid/rest/api/ip_address_management/v3/models/region1.py b/sendgrid/rest/api/ip_address_management/v3/models/region1.py index 1b2979f3..43d4ad59 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/region1.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/region1.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Region1(Enum): - ALL='all' - US='us' - EU='eu' - + ALL = "all" + US = "us" + EU = "eu" diff --git a/sendgrid/rest/api/ip_address_management/v3/models/region2.py b/sendgrid/rest/api/ip_address_management/v3/models/region2.py index 5ffde012..d5081641 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/region2.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/region2.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Region2(Enum): - EU='eu' - US='us' - + EU = "eu" + US = "us" diff --git a/sendgrid/rest/api/ip_address_management/v3/models/region3.py b/sendgrid/rest/api/ip_address_management/v3/models/region3.py index 93d2866a..bf7747b8 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/region3.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/region3.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Region3(Enum): - EU='eu' - US='us' - + EU = "eu" + US = "us" diff --git a/sendgrid/rest/api/ip_address_management/v3/models/region4.py b/sendgrid/rest/api/ip_address_management/v3/models/region4.py index 7cf0303f..17425eb3 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/region4.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/region4.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Region4(Enum): - ALL='all' - US='us' - EU='eu' - + ALL = "all" + US = "us" + EU = "eu" diff --git a/sendgrid/rest/api/ip_address_management/v3/models/region5.py b/sendgrid/rest/api/ip_address_management/v3/models/region5.py index b5e0151d..9475fe1c 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/region5.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/region5.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Region5(Enum): - US='us' - EU='eu' - + US = "us" + EU = "eu" diff --git a/sendgrid/rest/api/ip_address_management/v3/models/region6.py b/sendgrid/rest/api/ip_address_management/v3/models/region6.py index cd2672f9..c6e01531 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/region6.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/region6.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Region6(Enum): - EU='eu' - US='us' - + EU = "eu" + US = "us" diff --git a/sendgrid/rest/api/ip_address_management/v3/models/region7.py b/sendgrid/rest/api/ip_address_management/v3/models/region7.py index d3e05c37..a14c6584 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/region7.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/region7.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Region7(Enum): - ALL='all' - EU='eu' - US='us' - + ALL = "all" + EU = "eu" + US = "us" diff --git a/sendgrid/rest/api/ip_address_management/v3/models/update_ip200_response.py b/sendgrid/rest/api/ip_address_management/v3/models/update_ip200_response.py index fd7a4d97..fc09fac4 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/update_ip200_response.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/update_ip200_response.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateIp200Response: def __init__( - self, - ip: Optional[str]=None, - is_auto_warmup: Optional[bool]=None, - is_parent_assigned: Optional[bool]=None, - is_enabled: Optional[bool]=None + self, + ip: Optional[str] = None, + is_auto_warmup: Optional[bool] = None, + is_parent_assigned: Optional[bool] = None, + is_enabled: Optional[bool] = None, ): - self.ip=ip - self.is_auto_warmup=is_auto_warmup - self.is_parent_assigned=is_parent_assigned - self.is_enabled=is_enabled + self.ip = ip + self.is_auto_warmup = is_auto_warmup + self.is_parent_assigned = is_parent_assigned + self.is_enabled = is_enabled def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "ip": self.ip, - "is_auto_warmup": self.is_auto_warmup, - "is_parent_assigned": self.is_parent_assigned, - "is_enabled": self.is_enabled - }.items() if value is not None} + "ip": self.ip, + "is_auto_warmup": self.is_auto_warmup, + "is_parent_assigned": self.is_parent_assigned, + "is_enabled": self.is_enabled, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateIp200Response( - ip=payload.get('ip'), - is_auto_warmup=payload.get('is_auto_warmup'), - is_parent_assigned=payload.get('is_parent_assigned'), - is_enabled=payload.get('is_enabled') - ) - + ip=payload.get("ip"), + is_auto_warmup=payload.get("is_auto_warmup"), + is_parent_assigned=payload.get("is_parent_assigned"), + is_enabled=payload.get("is_enabled"), + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/update_ip_pool200_response.py b/sendgrid/rest/api/ip_address_management/v3/models/update_ip_pool200_response.py index f43fbebf..6f66b9ab 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/update_ip_pool200_response.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/update_ip_pool200_response.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateIpPool200Response: - def __init__( - self, - name: Optional[str]=None, - id: Optional[str]=None - ): - self.name=name - self.id=id + def __init__(self, name: Optional[str] = None, id: Optional[str] = None): + self.name = name + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -27,8 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateIpPool200Response( - name=payload.get('name'), - id=payload.get('id') - ) - + return UpdateIpPool200Response(name=payload.get("name"), id=payload.get("id")) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/update_ip_pool_request.py b/sendgrid/rest/api/ip_address_management/v3/models/update_ip_pool_request.py index f7f3bad8..494b4915 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/update_ip_pool_request.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/update_ip_pool_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateIpPoolRequest: - def __init__( - self, - name: Optional[str]=None - ): - self.name=name + def __init__(self, name: Optional[str] = None): + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateIpPoolRequest( - name=payload.get('name') - ) - + return UpdateIpPoolRequest(name=payload.get("name")) diff --git a/sendgrid/rest/api/ip_address_management/v3/models/update_ip_request.py b/sendgrid/rest/api/ip_address_management/v3/models/update_ip_request.py index 90017075..d0ee0293 100644 --- a/sendgrid/rest/api/ip_address_management/v3/models/update_ip_request.py +++ b/sendgrid/rest/api/ip_address_management/v3/models/update_ip_request.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateIpRequest: def __init__( - self, - is_auto_warmup: Optional[bool]=None, - is_parent_assigned: Optional[bool]=None, - is_enabled: Optional[bool]=None + self, + is_auto_warmup: Optional[bool] = None, + is_parent_assigned: Optional[bool] = None, + is_enabled: Optional[bool] = None, ): - self.is_auto_warmup=is_auto_warmup - self.is_parent_assigned=is_parent_assigned - self.is_enabled=is_enabled + self.is_auto_warmup = is_auto_warmup + self.is_parent_assigned = is_parent_assigned + self.is_enabled = is_enabled def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "is_auto_warmup": self.is_auto_warmup, - "is_parent_assigned": self.is_parent_assigned, - "is_enabled": self.is_enabled - }.items() if value is not None} + "is_auto_warmup": self.is_auto_warmup, + "is_parent_assigned": self.is_parent_assigned, + "is_enabled": self.is_enabled, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateIpRequest( - is_auto_warmup=payload.get('is_auto_warmup'), - is_parent_assigned=payload.get('is_parent_assigned'), - is_enabled=payload.get('is_enabled') - ) - + is_auto_warmup=payload.get("is_auto_warmup"), + is_parent_assigned=payload.get("is_parent_assigned"), + is_enabled=payload.get("is_enabled"), + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/update_ip.py b/sendgrid/rest/api/ip_address_management/v3/update_ip.py index ccd2a561..1442115f 100644 --- a/sendgrid/rest/api/ip_address_management/v3/update_ip.py +++ b/sendgrid/rest/api/ip_address_management/v3/update_ip.py @@ -12,53 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_address_management.v3.models.update_ip200_response import UpdateIp200Response -from sendgrid.rest.api.ip_address_management.v3.models.update_ip_request import UpdateIpRequest +from sendgrid.rest.api.ip_address_management.v3.models.update_ip_request import ( + UpdateIpRequest, +) + class UpdateIp: def __init__(self, client) -> None: self.client = client - + def send( self, - ip: str, - update_ip_request: Optional[UpdateIpRequest] = None, - + ip: str, + update_ip_request: Optional[UpdateIpRequest] = None, ): - path='/v3/send_ips/ips/{ip}' + path = "/v3/send_ips/ips/{ip}" path = path.format( - ip=ip, + ip=ip, ) data = None if update_ip_request: data = update_ip_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_address_management/v3/update_ip_pool.py b/sendgrid/rest/api/ip_address_management/v3/update_ip_pool.py index 50d83ec0..78807dae 100644 --- a/sendgrid/rest/api/ip_address_management/v3/update_ip_pool.py +++ b/sendgrid/rest/api/ip_address_management/v3/update_ip_pool.py @@ -12,53 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ip_address_management.v3.models.update_ip_pool200_response import UpdateIpPool200Response -from sendgrid.rest.api.ip_address_management.v3.models.update_ip_pool_request import UpdateIpPoolRequest +from sendgrid.rest.api.ip_address_management.v3.models.update_ip_pool_request import ( + UpdateIpPoolRequest, +) + class UpdateIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - poolid: str, - update_ip_pool_request: Optional[UpdateIpPoolRequest] = None, - + poolid: str, + update_ip_pool_request: Optional[UpdateIpPoolRequest] = None, ): - path='/v3/send_ips/pools/{poolid}' + path = "/v3/send_ips/pools/{poolid}" path = path.format( - poolid=poolid, + poolid=poolid, ) data = None if update_ip_pool_request: data = update_ip_pool_request.to_dict() - request = Request( - method='PUT', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_warmup/v3/__init__.py b/sendgrid/rest/api/ip_warmup/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/ip_warmup/v3/__init__.py +++ b/sendgrid/rest/api/ip_warmup/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/ip_warmup/v3/get_warm_up_ip.py b/sendgrid/rest/api/ip_warmup/v3/get_warm_up_ip.py index 6ee8e007..64a79f8a 100644 --- a/sendgrid/rest/api/ip_warmup/v3/get_warm_up_ip.py +++ b/sendgrid/rest/api/ip_warmup/v3/get_warm_up_ip.py @@ -12,48 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.ip_warmup.v3.models.ip_warmup200_inner import IpWarmup200Inner class GetWarmUpIp: def __init__(self, client) -> None: self.client = client - + def send( self, - ip_address: str, - + ip_address: str, ): - path='/v3/ips/warmup/{ip_address}' + path = "/v3/ips/warmup/{ip_address}" path = path.format( - ip_address=ip_address, + ip_address=ip_address, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_warmup/v3/list_warm_up_ip.py b/sendgrid/rest/api/ip_warmup/v3/list_warm_up_ip.py index f4d76633..fe896f9c 100644 --- a/sendgrid/rest/api/ip_warmup/v3/list_warm_up_ip.py +++ b/sendgrid/rest/api/ip_warmup/v3/list_warm_up_ip.py @@ -12,42 +12,37 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from sendgrid.rest.api.ip_warmup.v3.models.ip_warmup200_inner import IpWarmup200Inner class ListWarmUpIp: def __init__(self, client) -> None: self.client = client - + def send( self, - ): - path='/v3/ips/warmup' + path = "/v3/ips/warmup" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_warmup/v3/models/__init__.py b/sendgrid/rest/api/ip_warmup/v3/models/__init__.py index d9200028..34e4b910 100644 --- a/sendgrid/rest/api/ip_warmup/v3/models/__init__.py +++ b/sendgrid/rest/api/ip_warmup/v3/models/__init__.py @@ -11,15 +11,36 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.ip_warmup.v3.models.get_warm_up_ip404_response import GetWarmUpIp404Response -from sendgrid.rest.api.ip_warmup.v3.models.get_warm_up_ip404_response_errors_inner import GetWarmUpIp404ResponseErrorsInner +from sendgrid.rest.api.ip_warmup.v3.models.get_warm_up_ip404_response import ( + GetWarmUpIp404Response, +) +from sendgrid.rest.api.ip_warmup.v3.models.get_warm_up_ip404_response_errors_inner import ( + GetWarmUpIp404ResponseErrorsInner, +) from sendgrid.rest.api.ip_warmup.v3.models.ip_warmup200_inner import IpWarmup200Inner -from sendgrid.rest.api.ip_warmup.v3.models.stop_ip_warm_up404_response import StopIpWarmUp404Response -from sendgrid.rest.api.ip_warmup.v3.models.stop_ip_warm_up404_response_errors_inner import StopIpWarmUp404ResponseErrorsInner -from sendgrid.rest.api.ip_warmup.v3.models.warm_up_ip404_response import WarmUpIp404Response -from sendgrid.rest.api.ip_warmup.v3.models.warm_up_ip404_response_errors_inner import WarmUpIp404ResponseErrorsInner +from sendgrid.rest.api.ip_warmup.v3.models.stop_ip_warm_up404_response import ( + StopIpWarmUp404Response, +) +from sendgrid.rest.api.ip_warmup.v3.models.stop_ip_warm_up404_response_errors_inner import ( + StopIpWarmUp404ResponseErrorsInner, +) +from sendgrid.rest.api.ip_warmup.v3.models.warm_up_ip404_response import ( + WarmUpIp404Response, +) +from sendgrid.rest.api.ip_warmup.v3.models.warm_up_ip404_response_errors_inner import ( + WarmUpIp404ResponseErrorsInner, +) from sendgrid.rest.api.ip_warmup.v3.models.warm_up_ip_request import WarmUpIpRequest -__all__ = [ 'GetWarmUpIp404Response', 'GetWarmUpIp404ResponseErrorsInner', 'IpWarmup200Inner', 'StopIpWarmUp404Response', 'StopIpWarmUp404ResponseErrorsInner', 'WarmUpIp404Response', 'WarmUpIp404ResponseErrorsInner', 'WarmUpIpRequest' ] -# Testing code \ No newline at end of file + +__all__ = [ + "GetWarmUpIp404Response", + "GetWarmUpIp404ResponseErrorsInner", + "IpWarmup200Inner", + "StopIpWarmUp404Response", + "StopIpWarmUp404ResponseErrorsInner", + "WarmUpIp404Response", + "WarmUpIp404ResponseErrorsInner", + "WarmUpIpRequest", +] +# Testing code diff --git a/sendgrid/rest/api/ip_warmup/v3/models/get_warm_up_ip404_response.py b/sendgrid/rest/api/ip_warmup/v3/models/get_warm_up_ip404_response.py index 9eef129c..8825fb59 100644 --- a/sendgrid/rest/api/ip_warmup/v3/models/get_warm_up_ip404_response.py +++ b/sendgrid/rest/api/ip_warmup/v3/models/get_warm_up_ip404_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_warmup.v3.models.get_warm_up_ip404_response_errors_inner import GetWarmUpIp404ResponseErrorsInner - +from sendgrid.rest.api.ip_warmup.v3.models.get_warm_up_ip404_response_errors_inner import ( + GetWarmUpIp404ResponseErrorsInner, +) class GetWarmUpIp404Response: def __init__( - self, - errors: Optional[List[GetWarmUpIp404ResponseErrorsInner]]=None + self, errors: Optional[List[GetWarmUpIp404ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetWarmUpIp404Response( - errors=payload.get('errors') - ) - + return GetWarmUpIp404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/ip_warmup/v3/models/get_warm_up_ip404_response_errors_inner.py b/sendgrid/rest/api/ip_warmup/v3/models/get_warm_up_ip404_response_errors_inner.py index 31bef0bb..11c0bfd6 100644 --- a/sendgrid/rest/api/ip_warmup/v3/models/get_warm_up_ip404_response_errors_inner.py +++ b/sendgrid/rest/api/ip_warmup/v3/models/get_warm_up_ip404_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GetWarmUpIp404ResponseErrorsInner: - def __init__( - self, - field: Optional[str]=None, - message: Optional[str]=None - ): - self.field=field - self.message=message + def __init__(self, field: Optional[str] = None, message: Optional[str] = None): + self.field = field + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "field": self.field, - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"field": self.field, "message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetWarmUpIp404ResponseErrorsInner( - field=payload.get('field'), - message=payload.get('message') - ) - + field=payload.get("field"), message=payload.get("message") + ) diff --git a/sendgrid/rest/api/ip_warmup/v3/models/ip_warmup200_inner.py b/sendgrid/rest/api/ip_warmup/v3/models/ip_warmup200_inner.py index 90065ac0..a5e75359 100644 --- a/sendgrid/rest/api/ip_warmup/v3/models/ip_warmup200_inner.py +++ b/sendgrid/rest/api/ip_warmup/v3/models/ip_warmup200_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class IpWarmup200Inner: - def __init__( - self, - ip: Optional[str]=None, - start_date: Optional[int]=None - ): - self.ip=ip - self.start_date=start_date + def __init__(self, ip: Optional[str] = None, start_date: Optional[int] = None): + self.ip = ip + self.start_date = start_date def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ip": self.ip, - "start_date": self.start_date - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ip": self.ip, "start_date": self.start_date}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return IpWarmup200Inner( - ip=payload.get('ip'), - start_date=payload.get('start_date') - ) - + ip=payload.get("ip"), start_date=payload.get("start_date") + ) diff --git a/sendgrid/rest/api/ip_warmup/v3/models/stop_ip_warm_up404_response.py b/sendgrid/rest/api/ip_warmup/v3/models/stop_ip_warm_up404_response.py index c64c4f06..3a913e3f 100644 --- a/sendgrid/rest/api/ip_warmup/v3/models/stop_ip_warm_up404_response.py +++ b/sendgrid/rest/api/ip_warmup/v3/models/stop_ip_warm_up404_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_warmup.v3.models.stop_ip_warm_up404_response_errors_inner import StopIpWarmUp404ResponseErrorsInner - +from sendgrid.rest.api.ip_warmup.v3.models.stop_ip_warm_up404_response_errors_inner import ( + StopIpWarmUp404ResponseErrorsInner, +) class StopIpWarmUp404Response: def __init__( - self, - errors: Optional[List[StopIpWarmUp404ResponseErrorsInner]]=None + self, errors: Optional[List[StopIpWarmUp404ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return StopIpWarmUp404Response( - errors=payload.get('errors') - ) - + return StopIpWarmUp404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/ip_warmup/v3/models/stop_ip_warm_up404_response_errors_inner.py b/sendgrid/rest/api/ip_warmup/v3/models/stop_ip_warm_up404_response_errors_inner.py index e7f49a92..7bbc0831 100644 --- a/sendgrid/rest/api/ip_warmup/v3/models/stop_ip_warm_up404_response_errors_inner.py +++ b/sendgrid/rest/api/ip_warmup/v3/models/stop_ip_warm_up404_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class StopIpWarmUp404ResponseErrorsInner: - def __init__( - self, - field: Optional[str]=None, - message: Optional[str]=None - ): - self.field=field - self.message=message + def __init__(self, field: Optional[str] = None, message: Optional[str] = None): + self.field = field + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "field": self.field, - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"field": self.field, "message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return StopIpWarmUp404ResponseErrorsInner( - field=payload.get('field'), - message=payload.get('message') - ) - + field=payload.get("field"), message=payload.get("message") + ) diff --git a/sendgrid/rest/api/ip_warmup/v3/models/warm_up_ip404_response.py b/sendgrid/rest/api/ip_warmup/v3/models/warm_up_ip404_response.py index 2bc25708..a7e79ac8 100644 --- a/sendgrid/rest/api/ip_warmup/v3/models/warm_up_ip404_response.py +++ b/sendgrid/rest/api/ip_warmup/v3/models/warm_up_ip404_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ip_warmup.v3.models.warm_up_ip404_response_errors_inner import WarmUpIp404ResponseErrorsInner - +from sendgrid.rest.api.ip_warmup.v3.models.warm_up_ip404_response_errors_inner import ( + WarmUpIp404ResponseErrorsInner, +) class WarmUpIp404Response: - def __init__( - self, - errors: Optional[List[WarmUpIp404ResponseErrorsInner]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[WarmUpIp404ResponseErrorsInner]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return WarmUpIp404Response( - errors=payload.get('errors') - ) - + return WarmUpIp404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/ip_warmup/v3/models/warm_up_ip404_response_errors_inner.py b/sendgrid/rest/api/ip_warmup/v3/models/warm_up_ip404_response_errors_inner.py index 1f86cd64..2bc5e883 100644 --- a/sendgrid/rest/api/ip_warmup/v3/models/warm_up_ip404_response_errors_inner.py +++ b/sendgrid/rest/api/ip_warmup/v3/models/warm_up_ip404_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class WarmUpIp404ResponseErrorsInner: - def __init__( - self, - field: Optional[str]=None, - message: Optional[str]=None - ): - self.field=field - self.message=message + def __init__(self, field: Optional[str] = None, message: Optional[str] = None): + self.field = field + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "field": self.field, - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"field": self.field, "message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return WarmUpIp404ResponseErrorsInner( - field=payload.get('field'), - message=payload.get('message') - ) - + field=payload.get("field"), message=payload.get("message") + ) diff --git a/sendgrid/rest/api/ip_warmup/v3/models/warm_up_ip_request.py b/sendgrid/rest/api/ip_warmup/v3/models/warm_up_ip_request.py index a7b2694e..2f2fa469 100644 --- a/sendgrid/rest/api/ip_warmup/v3/models/warm_up_ip_request.py +++ b/sendgrid/rest/api/ip_warmup/v3/models/warm_up_ip_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class WarmUpIpRequest: - def __init__( - self, - ip: Optional[str]=None - ): - self.ip=ip + def __init__(self, ip: Optional[str] = None): + self.ip = ip def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ip": self.ip - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ip": self.ip}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return WarmUpIpRequest( - ip=payload.get('ip') - ) - + return WarmUpIpRequest(ip=payload.get("ip")) diff --git a/sendgrid/rest/api/ip_warmup/v3/stop_ip_warm_up.py b/sendgrid/rest/api/ip_warmup/v3/stop_ip_warm_up.py index 426bd3a7..ff17ebf1 100644 --- a/sendgrid/rest/api/ip_warmup/v3/stop_ip_warm_up.py +++ b/sendgrid/rest/api/ip_warmup/v3/stop_ip_warm_up.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated class StopIpWarmUp: def __init__(self, client) -> None: self.client = client - + def send( self, - ip_address: str, - + ip_address: str, ): - path='/v3/ips/warmup/{ip_address}' + path = "/v3/ips/warmup/{ip_address}" path = path.format( - ip_address=ip_address, + ip_address=ip_address, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ip_warmup/v3/warm_up_ip.py b/sendgrid/rest/api/ip_warmup/v3/warm_up_ip.py index 65338b26..a82618ab 100644 --- a/sendgrid/rest/api/ip_warmup/v3/warm_up_ip.py +++ b/sendgrid/rest/api/ip_warmup/v3/warm_up_ip.py @@ -12,47 +12,44 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.ip_warmup.v3.models.ip_warmup200_inner import IpWarmup200Inner from sendgrid.rest.api.ip_warmup.v3.models.warm_up_ip_request import WarmUpIpRequest + class WarmUpIp: def __init__(self, client) -> None: self.client = client - + def send( self, - warm_up_ip_request: Optional[WarmUpIpRequest] = None, - + warm_up_ip_request: Optional[WarmUpIpRequest] = None, ): - path='/v3/ips/warmup' + path = "/v3/ips/warmup" data = None if warm_up_ip_request: data = warm_up_ip_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ips/v3/__init__.py b/sendgrid/rest/api/ips/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/ips/v3/__init__.py +++ b/sendgrid/rest/api/ips/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/ips/v3/add_ip.py b/sendgrid/rest/api/ips/v3/add_ip.py index a1a569da..de206dde 100644 --- a/sendgrid/rest/api/ips/v3/add_ip.py +++ b/sendgrid/rest/api/ips/v3/add_ip.py @@ -12,47 +12,44 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.ips.v3.models.add_ip201_response import AddIp201Response from sendgrid.rest.api.ips.v3.models.add_ip_request import AddIpRequest + class AddIp: def __init__(self, client) -> None: self.client = client - + def send( self, - add_ip_request: Optional[AddIpRequest] = None, - + add_ip_request: Optional[AddIpRequest] = None, ): - path='/v3/ips' + path = "/v3/ips" data = None if add_ip_request: data = add_ip_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ips/v3/add_ip_to_ip_pool.py b/sendgrid/rest/api/ips/v3/add_ip_to_ip_pool.py index d3dccea9..6b80836b 100644 --- a/sendgrid/rest/api/ips/v3/add_ip_to_ip_pool.py +++ b/sendgrid/rest/api/ips/v3/add_ip_to_ip_pool.py @@ -12,53 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ips.v3.models.add_ip_to_ip_pool201_response import AddIpToIpPool201Response -from sendgrid.rest.api.ips.v3.models.add_ip_to_ip_pool_request import AddIpToIpPoolRequest +from sendgrid.rest.api.ips.v3.models.add_ip_to_ip_pool_request import ( + AddIpToIpPoolRequest, +) + class AddIpToIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - pool_name: str, - add_ip_to_ip_pool_request: Optional[AddIpToIpPoolRequest] = None, - + pool_name: str, + add_ip_to_ip_pool_request: Optional[AddIpToIpPoolRequest] = None, ): - path='/v3/ips/pools/{pool_name}/ips' + path = "/v3/ips/pools/{pool_name}/ips" path = path.format( - pool_name=pool_name, + pool_name=pool_name, ) data = None if add_ip_to_ip_pool_request: data = add_ip_to_ip_pool_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ips/v3/create_ip_pool.py b/sendgrid/rest/api/ips/v3/create_ip_pool.py index ff4d3858..9f6b1e1b 100644 --- a/sendgrid/rest/api/ips/v3/create_ip_pool.py +++ b/sendgrid/rest/api/ips/v3/create_ip_pool.py @@ -12,47 +12,44 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional from sendgrid.rest.api.ips.v3.models.create_ip_pool_request import CreateIpPoolRequest -from sendgrid.rest.api.ips.v3.models.ip_pools200 import IpPools200 + class CreateIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - create_ip_pool_request: Optional[CreateIpPoolRequest] = None, - + create_ip_pool_request: Optional[CreateIpPoolRequest] = None, ): - path='/v3/ips/pools' + path = "/v3/ips/pools" data = None if create_ip_pool_request: data = create_ip_pool_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ips/v3/delete_ip_from_ip_pool.py b/sendgrid/rest/api/ips/v3/delete_ip_from_ip_pool.py index 28763766..cfa7e2c5 100644 --- a/sendgrid/rest/api/ips/v3/delete_ip_from_ip_pool.py +++ b/sendgrid/rest/api/ips/v3/delete_ip_from_ip_pool.py @@ -12,49 +12,43 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated class DeleteIpFromIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - pool_name: str, - ip: str, - + pool_name: str, + ip: str, ): - path='/v3/ips/pools/{pool_name}/ips/{ip}' + path = "/v3/ips/pools/{pool_name}/ips/{ip}" path = path.format( - pool_name=pool_name, - ip=ip, + pool_name=pool_name, + ip=ip, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ips/v3/delete_ip_pool.py b/sendgrid/rest/api/ips/v3/delete_ip_pool.py index d6a372b7..8030d50b 100644 --- a/sendgrid/rest/api/ips/v3/delete_ip_pool.py +++ b/sendgrid/rest/api/ips/v3/delete_ip_pool.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated class DeleteIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - pool_name: str, - + pool_name: str, ): - path='/v3/ips/pools/{pool_name}' + path = "/v3/ips/pools/{pool_name}" path = path.format( - pool_name=pool_name, + pool_name=pool_name, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ips/v3/get_ip.py b/sendgrid/rest/api/ips/v3/get_ip.py index 780e3bef..badac813 100644 --- a/sendgrid/rest/api/ips/v3/get_ip.py +++ b/sendgrid/rest/api/ips/v3/get_ip.py @@ -12,48 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.ips.v3.models.get_ip200_response import GetIp200Response class GetIp: def __init__(self, client) -> None: self.client = client - + def send( self, - ip_address: str, - + ip_address: str, ): - path='/v3/ips/{ip_address}' + path = "/v3/ips/{ip_address}" path = path.format( - ip_address=ip_address, + ip_address=ip_address, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ips/v3/get_ip_pool.py b/sendgrid/rest/api/ips/v3/get_ip_pool.py index a3e56132..8836a41d 100644 --- a/sendgrid/rest/api/ips/v3/get_ip_pool.py +++ b/sendgrid/rest/api/ips/v3/get_ip_pool.py @@ -12,48 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.ips.v3.models.get_ip_pool200_response import GetIpPool200Response class GetIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - pool_name: str, - + pool_name: str, ): - path='/v3/ips/pools/{pool_name}' + path = "/v3/ips/pools/{pool_name}" path = path.format( - pool_name=pool_name, + pool_name=pool_name, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ips/v3/list_assigned_ip.py b/sendgrid/rest/api/ips/v3/list_assigned_ip.py index 40ddc66e..69db51a6 100644 --- a/sendgrid/rest/api/ips/v3/list_assigned_ip.py +++ b/sendgrid/rest/api/ips/v3/list_assigned_ip.py @@ -12,42 +12,37 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from sendgrid.rest.api.ips.v3.models.list_assigned_ip200_response_inner import ListAssignedIp200ResponseInner class ListAssignedIp: def __init__(self, client) -> None: self.client = client - + def send( self, - ): - path='/v3/ips/assigned' + path = "/v3/ips/assigned" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ips/v3/list_ip.py b/sendgrid/rest/api/ips/v3/list_ip.py index 440761ba..b567c3cf 100644 --- a/sendgrid/rest/api/ips/v3/list_ip.py +++ b/sendgrid/rest/api/ips/v3/list_ip.py @@ -12,52 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ips.v3.models.list_ip200_response_inner import ListIp200ResponseInner from sendgrid.rest.api.ips.v3.models.sort_by_direction import SortByDirection + class ListIp: def __init__(self, client) -> None: self.client = client - + def send( self, - ip: Optional[str] = None, - exclude_whitelabels: Optional[bool] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - subuser: Optional[str] = None, - sort_by_direction: Optional[SortByDirection] = None, - + ip: Optional[str] = None, + exclude_whitelabels: Optional[bool] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + subuser: Optional[str] = None, + sort_by_direction: Optional[SortByDirection] = None, ): - path='/v3/ips' + path = "/v3/ips" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ips/v3/list_ip_pool.py b/sendgrid/rest/api/ips/v3/list_ip_pool.py index 684c3ff0..ba389356 100644 --- a/sendgrid/rest/api/ips/v3/list_ip_pool.py +++ b/sendgrid/rest/api/ips/v3/list_ip_pool.py @@ -12,42 +12,37 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from sendgrid.rest.api.ips.v3.models.ip_pools200 import IpPools200 class ListIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - ): - path='/v3/ips/pools' + path = "/v3/ips/pools" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ips/v3/list_remaining_ip_count.py b/sendgrid/rest/api/ips/v3/list_remaining_ip_count.py index 10208100..01f1376c 100644 --- a/sendgrid/rest/api/ips/v3/list_remaining_ip_count.py +++ b/sendgrid/rest/api/ips/v3/list_remaining_ip_count.py @@ -12,42 +12,37 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from sendgrid.rest.api.ips.v3.models.list_remaining_ip_count200_response import ListRemainingIpCount200Response class ListRemainingIpCount: def __init__(self, client) -> None: self.client = client - + def send( self, - ): - path='/v3/ips/remaining' + path = "/v3/ips/remaining" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/ips/v3/models/__init__.py b/sendgrid/rest/api/ips/v3/models/__init__.py index 7595974b..cfd0af27 100644 --- a/sendgrid/rest/api/ips/v3/models/__init__.py +++ b/sendgrid/rest/api/ips/v3/models/__init__.py @@ -11,32 +11,88 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.ips.v3.models.add_ip201_response import AddIp201Response -from sendgrid.rest.api.ips.v3.models.add_ip201_response_ips_inner import AddIp201ResponseIpsInner +from sendgrid.rest.api.ips.v3.models.add_ip201_response_ips_inner import ( + AddIp201ResponseIpsInner, +) from sendgrid.rest.api.ips.v3.models.add_ip_request import AddIpRequest -from sendgrid.rest.api.ips.v3.models.add_ip_to_ip_pool201_response import AddIpToIpPool201Response -from sendgrid.rest.api.ips.v3.models.add_ip_to_ip_pool404_response import AddIpToIpPool404Response -from sendgrid.rest.api.ips.v3.models.add_ip_to_ip_pool404_response_errors_inner import AddIpToIpPool404ResponseErrorsInner -from sendgrid.rest.api.ips.v3.models.add_ip_to_ip_pool_request import AddIpToIpPoolRequest +from sendgrid.rest.api.ips.v3.models.add_ip_to_ip_pool201_response import ( + AddIpToIpPool201Response, +) +from sendgrid.rest.api.ips.v3.models.add_ip_to_ip_pool404_response import ( + AddIpToIpPool404Response, +) +from sendgrid.rest.api.ips.v3.models.add_ip_to_ip_pool404_response_errors_inner import ( + AddIpToIpPool404ResponseErrorsInner, +) +from sendgrid.rest.api.ips.v3.models.add_ip_to_ip_pool_request import ( + AddIpToIpPoolRequest, +) from sendgrid.rest.api.ips.v3.models.create_ip_pool_request import CreateIpPoolRequest -from sendgrid.rest.api.ips.v3.models.delete_ip_from_ip_pool404_response import DeleteIpFromIpPool404Response -from sendgrid.rest.api.ips.v3.models.delete_ip_pool404_response import DeleteIpPool404Response +from sendgrid.rest.api.ips.v3.models.delete_ip_from_ip_pool404_response import ( + DeleteIpFromIpPool404Response, +) +from sendgrid.rest.api.ips.v3.models.delete_ip_pool404_response import ( + DeleteIpPool404Response, +) from sendgrid.rest.api.ips.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.ips.v3.models.error_response_errors_inner import ErrorResponseErrorsInner +from sendgrid.rest.api.ips.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) from sendgrid.rest.api.ips.v3.models.get_ip200_response import GetIp200Response from sendgrid.rest.api.ips.v3.models.get_ip_pool200_response import GetIpPool200Response from sendgrid.rest.api.ips.v3.models.get_ip_pool404_response import GetIpPool404Response -from sendgrid.rest.api.ips.v3.models.get_ip_pool404_response_errors_inner import GetIpPool404ResponseErrorsInner +from sendgrid.rest.api.ips.v3.models.get_ip_pool404_response_errors_inner import ( + GetIpPool404ResponseErrorsInner, +) from sendgrid.rest.api.ips.v3.models.ip_pools200 import IpPools200 -from sendgrid.rest.api.ips.v3.models.list_assigned_ip200_response_inner import ListAssignedIp200ResponseInner -from sendgrid.rest.api.ips.v3.models.list_ip200_response_inner import ListIp200ResponseInner -from sendgrid.rest.api.ips.v3.models.list_remaining_ip_count200_response import ListRemainingIpCount200Response -from sendgrid.rest.api.ips.v3.models.list_remaining_ip_count200_response_results_inner import ListRemainingIpCount200ResponseResultsInner +from sendgrid.rest.api.ips.v3.models.list_assigned_ip200_response_inner import ( + ListAssignedIp200ResponseInner, +) +from sendgrid.rest.api.ips.v3.models.list_ip200_response_inner import ( + ListIp200ResponseInner, +) +from sendgrid.rest.api.ips.v3.models.list_remaining_ip_count200_response import ( + ListRemainingIpCount200Response, +) +from sendgrid.rest.api.ips.v3.models.list_remaining_ip_count200_response_results_inner import ( + ListRemainingIpCount200ResponseResultsInner, +) from sendgrid.rest.api.ips.v3.models.sort_by_direction import SortByDirection -from sendgrid.rest.api.ips.v3.models.update_ip_pool404_response import UpdateIpPool404Response -from sendgrid.rest.api.ips.v3.models.update_ip_pool404_response_errors_inner import UpdateIpPool404ResponseErrorsInner +from sendgrid.rest.api.ips.v3.models.update_ip_pool404_response import ( + UpdateIpPool404Response, +) +from sendgrid.rest.api.ips.v3.models.update_ip_pool404_response_errors_inner import ( + UpdateIpPool404ResponseErrorsInner, +) from sendgrid.rest.api.ips.v3.models.update_ip_pool_request import UpdateIpPoolRequest -__all__ = [ 'AddIp201Response', 'AddIp201ResponseIpsInner', 'AddIpRequest', 'AddIpToIpPool201Response', 'AddIpToIpPool404Response', 'AddIpToIpPool404ResponseErrorsInner', 'AddIpToIpPoolRequest', 'CreateIpPoolRequest', 'DeleteIpFromIpPool404Response', 'DeleteIpPool404Response', 'ErrorResponse', 'ErrorResponseErrorsInner', 'GetIp200Response', 'GetIpPool200Response', 'GetIpPool404Response', 'GetIpPool404ResponseErrorsInner', 'IpPools200', 'ListAssignedIp200ResponseInner', 'ListIp200ResponseInner', 'ListRemainingIpCount200Response', 'ListRemainingIpCount200ResponseResultsInner', 'SortByDirection', 'UpdateIpPool404Response', 'UpdateIpPool404ResponseErrorsInner', 'UpdateIpPoolRequest' ] -# Testing code \ No newline at end of file + +__all__ = [ + "AddIp201Response", + "AddIp201ResponseIpsInner", + "AddIpRequest", + "AddIpToIpPool201Response", + "AddIpToIpPool404Response", + "AddIpToIpPool404ResponseErrorsInner", + "AddIpToIpPoolRequest", + "CreateIpPoolRequest", + "DeleteIpFromIpPool404Response", + "DeleteIpPool404Response", + "ErrorResponse", + "ErrorResponseErrorsInner", + "GetIp200Response", + "GetIpPool200Response", + "GetIpPool404Response", + "GetIpPool404ResponseErrorsInner", + "IpPools200", + "ListAssignedIp200ResponseInner", + "ListIp200ResponseInner", + "ListRemainingIpCount200Response", + "ListRemainingIpCount200ResponseResultsInner", + "SortByDirection", + "UpdateIpPool404Response", + "UpdateIpPool404ResponseErrorsInner", + "UpdateIpPoolRequest", +] +# Testing code diff --git a/sendgrid/rest/api/ips/v3/models/add_ip201_response.py b/sendgrid/rest/api/ips/v3/models/add_ip201_response.py index f721e762..db59d7cf 100644 --- a/sendgrid/rest/api/ips/v3/models/add_ip201_response.py +++ b/sendgrid/rest/api/ips/v3/models/add_ip201_response.py @@ -1,29 +1,31 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ips.v3.models.add_ip201_response_ips_inner import AddIp201ResponseIpsInner - +from sendgrid.rest.api.ips.v3.models.add_ip201_response_ips_inner import ( + AddIp201ResponseIpsInner, +) class AddIp201Response: def __init__( - self, - ips: Optional[List[AddIp201ResponseIpsInner]]=None, - remaining_ips: Optional[int]=None, - warmup: Optional[bool]=None + self, + ips: Optional[List[AddIp201ResponseIpsInner]] = None, + remaining_ips: Optional[int] = None, + warmup: Optional[bool] = None, ): - self.ips=ips - self.remaining_ips=remaining_ips - self.warmup=warmup + self.ips = ips + self.remaining_ips = remaining_ips + self.warmup = warmup def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "ips": self.ips, - "remaining_ips": self.remaining_ips, - "warmup": self.warmup - }.items() if value is not None} + "ips": self.ips, + "remaining_ips": self.remaining_ips, + "warmup": self.warmup, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +34,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AddIp201Response( - ips=payload.get('ips'), - remaining_ips=payload.get('remaining_ips'), - warmup=payload.get('warmup') - ) - + ips=payload.get("ips"), + remaining_ips=payload.get("remaining_ips"), + warmup=payload.get("warmup"), + ) diff --git a/sendgrid/rest/api/ips/v3/models/add_ip201_response_ips_inner.py b/sendgrid/rest/api/ips/v3/models/add_ip201_response_ips_inner.py index 053099c6..091271db 100644 --- a/sendgrid/rest/api/ips/v3/models/add_ip201_response_ips_inner.py +++ b/sendgrid/rest/api/ips/v3/models/add_ip201_response_ips_inner.py @@ -1,25 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AddIp201ResponseIpsInner: - def __init__( - self, - ip: Optional[str]=None, - subusers: Optional[List[str]]=None - ): - self.ip=ip - self.subusers=subusers + def __init__(self, ip: Optional[str] = None, subusers: Optional[List[str]] = None): + self.ip = ip + self.subusers = subusers def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ip": self.ip, - "subusers": self.subusers - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ip": self.ip, "subusers": self.subusers}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AddIp201ResponseIpsInner( - ip=payload.get('ip'), - subusers=payload.get('subusers') - ) - + ip=payload.get("ip"), subusers=payload.get("subusers") + ) diff --git a/sendgrid/rest/api/ips/v3/models/add_ip_request.py b/sendgrid/rest/api/ips/v3/models/add_ip_request.py index 84fd10b5..c5ce182a 100644 --- a/sendgrid/rest/api/ips/v3/models/add_ip_request.py +++ b/sendgrid/rest/api/ips/v3/models/add_ip_request.py @@ -1,28 +1,28 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AddIpRequest: def __init__( - self, - count: Optional[int]=None, - subusers: Optional[List[str]]=None, - warmup: Optional[bool]=None + self, + count: Optional[int] = None, + subusers: Optional[List[str]] = None, + warmup: Optional[bool] = None, ): - self.count=count - self.subusers=subusers - self.warmup=warmup + self.count = count + self.subusers = subusers + self.warmup = warmup def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "count": self.count, - "subusers": self.subusers, - "warmup": self.warmup - }.items() if value is not None} + "count": self.count, + "subusers": self.subusers, + "warmup": self.warmup, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AddIpRequest( - count=payload.get('count'), - subusers=payload.get('subusers'), - warmup=payload.get('warmup') - ) - + count=payload.get("count"), + subusers=payload.get("subusers"), + warmup=payload.get("warmup"), + ) diff --git a/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool201_response.py b/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool201_response.py index 6b75e07f..bb2c22d6 100644 --- a/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool201_response.py +++ b/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool201_response.py @@ -1,31 +1,31 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AddIpToIpPool201Response: def __init__( - self, - ip: Optional[str]=None, - pools: Optional[List[str]]=None, - start_date: Optional[int]=None, - warmup: Optional[bool]=None + self, + ip: Optional[str] = None, + pools: Optional[List[str]] = None, + start_date: Optional[int] = None, + warmup: Optional[bool] = None, ): - self.ip=ip - self.pools=pools - self.start_date=start_date - self.warmup=warmup + self.ip = ip + self.pools = pools + self.start_date = start_date + self.warmup = warmup def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "ip": self.ip, - "pools": self.pools, - "start_date": self.start_date, - "warmup": self.warmup - }.items() if value is not None} + "ip": self.ip, + "pools": self.pools, + "start_date": self.start_date, + "warmup": self.warmup, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AddIpToIpPool201Response( - ip=payload.get('ip'), - pools=payload.get('pools'), - start_date=payload.get('start_date'), - warmup=payload.get('warmup') - ) - + ip=payload.get("ip"), + pools=payload.get("pools"), + start_date=payload.get("start_date"), + warmup=payload.get("warmup"), + ) diff --git a/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool404_response.py b/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool404_response.py index 99483bea..9e2ac4ea 100644 --- a/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool404_response.py +++ b/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool404_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ips.v3.models.add_ip_to_ip_pool404_response_errors_inner import AddIpToIpPool404ResponseErrorsInner - +from sendgrid.rest.api.ips.v3.models.add_ip_to_ip_pool404_response_errors_inner import ( + AddIpToIpPool404ResponseErrorsInner, +) class AddIpToIpPool404Response: def __init__( - self, - errors: Optional[List[AddIpToIpPool404ResponseErrorsInner]]=None + self, errors: Optional[List[AddIpToIpPool404ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AddIpToIpPool404Response( - errors=payload.get('errors') - ) - + return AddIpToIpPool404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool404_response_errors_inner.py b/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool404_response_errors_inner.py index 7f48c6bd..a04387fa 100644 --- a/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool404_response_errors_inner.py +++ b/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool404_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AddIpToIpPool404ResponseErrorsInner: - def __init__( - self, - field: Optional[str]=None, - message: Optional[str]=None - ): - self.field=field - self.message=message + def __init__(self, field: Optional[str] = None, message: Optional[str] = None): + self.field = field + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "field": self.field, - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"field": self.field, "message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AddIpToIpPool404ResponseErrorsInner( - field=payload.get('field'), - message=payload.get('message') - ) - + field=payload.get("field"), message=payload.get("message") + ) diff --git a/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool_request.py b/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool_request.py index 32ddff51..4c3df613 100644 --- a/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool_request.py +++ b/sendgrid/rest/api/ips/v3/models/add_ip_to_ip_pool_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AddIpToIpPoolRequest: - def __init__( - self, - ip: Optional[str]=None - ): - self.ip=ip + def __init__(self, ip: Optional[str] = None): + self.ip = ip def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ip": self.ip - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ip": self.ip}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AddIpToIpPoolRequest( - ip=payload.get('ip') - ) - + return AddIpToIpPoolRequest(ip=payload.get("ip")) diff --git a/sendgrid/rest/api/ips/v3/models/create_ip_pool_request.py b/sendgrid/rest/api/ips/v3/models/create_ip_pool_request.py index 60c137eb..6981d339 100644 --- a/sendgrid/rest/api/ips/v3/models/create_ip_pool_request.py +++ b/sendgrid/rest/api/ips/v3/models/create_ip_pool_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateIpPoolRequest: - def __init__( - self, - name: Optional[str]=None - ): - self.name=name + def __init__(self, name: Optional[str] = None): + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return CreateIpPoolRequest( - name=payload.get('name') - ) - + return CreateIpPoolRequest(name=payload.get("name")) diff --git a/sendgrid/rest/api/ips/v3/models/delete_ip_from_ip_pool404_response.py b/sendgrid/rest/api/ips/v3/models/delete_ip_from_ip_pool404_response.py index bb1287ae..1a6f0935 100644 --- a/sendgrid/rest/api/ips/v3/models/delete_ip_from_ip_pool404_response.py +++ b/sendgrid/rest/api/ips/v3/models/delete_ip_from_ip_pool404_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DeleteIpFromIpPool404Response: - def __init__( - self, - error: Optional[str]=None - ): - self.error=error + def __init__(self, error: Optional[str] = None): + self.error = error def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "error": self.error - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"error": self.error}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DeleteIpFromIpPool404Response( - error=payload.get('error') - ) - + return DeleteIpFromIpPool404Response(error=payload.get("error")) diff --git a/sendgrid/rest/api/ips/v3/models/delete_ip_pool404_response.py b/sendgrid/rest/api/ips/v3/models/delete_ip_pool404_response.py index 8febd11f..32bb5061 100644 --- a/sendgrid/rest/api/ips/v3/models/delete_ip_pool404_response.py +++ b/sendgrid/rest/api/ips/v3/models/delete_ip_pool404_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DeleteIpPool404Response: - def __init__( - self, - error: Optional[str]=None - ): - self.error=error + def __init__(self, error: Optional[str] = None): + self.error = error def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "error": self.error - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"error": self.error}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DeleteIpPool404Response( - error=payload.get('error') - ) - + return DeleteIpPool404Response(error=payload.get("error")) diff --git a/sendgrid/rest/api/ips/v3/models/error_response.py b/sendgrid/rest/api/ips/v3/models/error_response.py index 70df863b..bf2fe14f 100644 --- a/sendgrid/rest/api/ips/v3/models/error_response.py +++ b/sendgrid/rest/api/ips/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ips.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.ips.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/ips/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/ips/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/ips/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/ips/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/ips/v3/models/get_ip200_response.py b/sendgrid/rest/api/ips/v3/models/get_ip200_response.py index d3f20ab3..3a0e0fe7 100644 --- a/sendgrid/rest/api/ips/v3/models/get_ip200_response.py +++ b/sendgrid/rest/api/ips/v3/models/get_ip200_response.py @@ -1,40 +1,40 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GetIp200Response: def __init__( - self, - ip: Optional[str]=None, - subusers: Optional[List[str]]=None, - rdns: Optional[str]=None, - pools: Optional[List[str]]=None, - warmup: Optional[bool]=None, - start_date: Optional[int]=None, - whitelabeled: Optional[bool]=None + self, + ip: Optional[str] = None, + subusers: Optional[List[str]] = None, + rdns: Optional[str] = None, + pools: Optional[List[str]] = None, + warmup: Optional[bool] = None, + start_date: Optional[int] = None, + whitelabeled: Optional[bool] = None, ): - self.ip=ip - self.subusers=subusers - self.rdns=rdns - self.pools=pools - self.warmup=warmup - self.start_date=start_date - self.whitelabeled=whitelabeled + self.ip = ip + self.subusers = subusers + self.rdns = rdns + self.pools = pools + self.warmup = warmup + self.start_date = start_date + self.whitelabeled = whitelabeled def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "ip": self.ip, - "subusers": self.subusers, - "rdns": self.rdns, - "pools": self.pools, - "warmup": self.warmup, - "start_date": self.start_date, - "whitelabeled": self.whitelabeled - }.items() if value is not None} + "ip": self.ip, + "subusers": self.subusers, + "rdns": self.rdns, + "pools": self.pools, + "warmup": self.warmup, + "start_date": self.start_date, + "whitelabeled": self.whitelabeled, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -43,12 +43,11 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetIp200Response( - ip=payload.get('ip'), - subusers=payload.get('subusers'), - rdns=payload.get('rdns'), - pools=payload.get('pools'), - warmup=payload.get('warmup'), - start_date=payload.get('start_date'), - whitelabeled=payload.get('whitelabeled') - ) - + ip=payload.get("ip"), + subusers=payload.get("subusers"), + rdns=payload.get("rdns"), + pools=payload.get("pools"), + warmup=payload.get("warmup"), + start_date=payload.get("start_date"), + whitelabeled=payload.get("whitelabeled"), + ) diff --git a/sendgrid/rest/api/ips/v3/models/get_ip_pool200_response.py b/sendgrid/rest/api/ips/v3/models/get_ip_pool200_response.py index 81f48ff9..09b18636 100644 --- a/sendgrid/rest/api/ips/v3/models/get_ip_pool200_response.py +++ b/sendgrid/rest/api/ips/v3/models/get_ip_pool200_response.py @@ -1,25 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GetIpPool200Response: def __init__( - self, - pool_name: Optional[str]=None, - ips: Optional[List[str]]=None + self, pool_name: Optional[str] = None, ips: Optional[List[str]] = None ): - self.pool_name=pool_name - self.ips=ips + self.pool_name = pool_name + self.ips = ips def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "pool_name": self.pool_name, - "ips": self.ips - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"pool_name": self.pool_name, "ips": self.ips}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +23,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetIpPool200Response( - pool_name=payload.get('pool_name'), - ips=payload.get('ips') - ) - + pool_name=payload.get("pool_name"), ips=payload.get("ips") + ) diff --git a/sendgrid/rest/api/ips/v3/models/get_ip_pool404_response.py b/sendgrid/rest/api/ips/v3/models/get_ip_pool404_response.py index 89636e34..7ddfc079 100644 --- a/sendgrid/rest/api/ips/v3/models/get_ip_pool404_response.py +++ b/sendgrid/rest/api/ips/v3/models/get_ip_pool404_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ips.v3.models.get_ip_pool404_response_errors_inner import GetIpPool404ResponseErrorsInner - +from sendgrid.rest.api.ips.v3.models.get_ip_pool404_response_errors_inner import ( + GetIpPool404ResponseErrorsInner, +) class GetIpPool404Response: - def __init__( - self, - errors: Optional[List[GetIpPool404ResponseErrorsInner]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[GetIpPool404ResponseErrorsInner]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetIpPool404Response( - errors=payload.get('errors') - ) - + return GetIpPool404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/ips/v3/models/get_ip_pool404_response_errors_inner.py b/sendgrid/rest/api/ips/v3/models/get_ip_pool404_response_errors_inner.py index d95aeee7..f18e5766 100644 --- a/sendgrid/rest/api/ips/v3/models/get_ip_pool404_response_errors_inner.py +++ b/sendgrid/rest/api/ips/v3/models/get_ip_pool404_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GetIpPool404ResponseErrorsInner: - def __init__( - self, - field: Optional[str]=None, - message: Optional[str]=None - ): - self.field=field - self.message=message + def __init__(self, field: Optional[str] = None, message: Optional[str] = None): + self.field = field + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "field": self.field, - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"field": self.field, "message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetIpPool404ResponseErrorsInner( - field=payload.get('field'), - message=payload.get('message') - ) - + field=payload.get("field"), message=payload.get("message") + ) diff --git a/sendgrid/rest/api/ips/v3/models/ip_pools200.py b/sendgrid/rest/api/ips/v3/models/ip_pools200.py index b500ebc9..ab42680d 100644 --- a/sendgrid/rest/api/ips/v3/models/ip_pools200.py +++ b/sendgrid/rest/api/ips/v3/models/ip_pools200.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class IpPools200: - def __init__( - self, - name: Optional[str]=None - ): - self.name=name + def __init__(self, name: Optional[str] = None): + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return IpPools200( - name=payload.get('name') - ) - + return IpPools200(name=payload.get("name")) diff --git a/sendgrid/rest/api/ips/v3/models/list_assigned_ip200_response_inner.py b/sendgrid/rest/api/ips/v3/models/list_assigned_ip200_response_inner.py index 91ff3ef6..adb287af 100644 --- a/sendgrid/rest/api/ips/v3/models/list_assigned_ip200_response_inner.py +++ b/sendgrid/rest/api/ips/v3/models/list_assigned_ip200_response_inner.py @@ -1,31 +1,31 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListAssignedIp200ResponseInner: def __init__( - self, - ip: Optional[str]=None, - pools: Optional[List[str]]=None, - warmup: Optional[bool]=None, - start_date: Optional[int]=None + self, + ip: Optional[str] = None, + pools: Optional[List[str]] = None, + warmup: Optional[bool] = None, + start_date: Optional[int] = None, ): - self.ip=ip - self.pools=pools - self.warmup=warmup - self.start_date=start_date + self.ip = ip + self.pools = pools + self.warmup = warmup + self.start_date = start_date def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "ip": self.ip, - "pools": self.pools, - "warmup": self.warmup, - "start_date": self.start_date - }.items() if value is not None} + "ip": self.ip, + "pools": self.pools, + "warmup": self.warmup, + "start_date": self.start_date, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListAssignedIp200ResponseInner( - ip=payload.get('ip'), - pools=payload.get('pools'), - warmup=payload.get('warmup'), - start_date=payload.get('start_date') - ) - + ip=payload.get("ip"), + pools=payload.get("pools"), + warmup=payload.get("warmup"), + start_date=payload.get("start_date"), + ) diff --git a/sendgrid/rest/api/ips/v3/models/list_ip200_response_inner.py b/sendgrid/rest/api/ips/v3/models/list_ip200_response_inner.py index 7742d9ff..aa7559d4 100644 --- a/sendgrid/rest/api/ips/v3/models/list_ip200_response_inner.py +++ b/sendgrid/rest/api/ips/v3/models/list_ip200_response_inner.py @@ -1,43 +1,43 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListIp200ResponseInner: def __init__( - self, - ip: Optional[str]=None, - subusers: Optional[List[str]]=None, - rdns: Optional[str]=None, - pools: Optional[List[str]]=None, - warmup: Optional[bool]=None, - start_date: Optional[float]=None, - whitelabeled: Optional[bool]=None, - assigned_at: Optional[int]=None + self, + ip: Optional[str] = None, + subusers: Optional[List[str]] = None, + rdns: Optional[str] = None, + pools: Optional[List[str]] = None, + warmup: Optional[bool] = None, + start_date: Optional[float] = None, + whitelabeled: Optional[bool] = None, + assigned_at: Optional[int] = None, ): - self.ip=ip - self.subusers=subusers - self.rdns=rdns - self.pools=pools - self.warmup=warmup - self.start_date=start_date - self.whitelabeled=whitelabeled - self.assigned_at=assigned_at + self.ip = ip + self.subusers = subusers + self.rdns = rdns + self.pools = pools + self.warmup = warmup + self.start_date = start_date + self.whitelabeled = whitelabeled + self.assigned_at = assigned_at def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "ip": self.ip, - "subusers": self.subusers, - "rdns": self.rdns, - "pools": self.pools, - "warmup": self.warmup, - "start_date": self.start_date, - "whitelabeled": self.whitelabeled, - "assigned_at": self.assigned_at - }.items() if value is not None} + "ip": self.ip, + "subusers": self.subusers, + "rdns": self.rdns, + "pools": self.pools, + "warmup": self.warmup, + "start_date": self.start_date, + "whitelabeled": self.whitelabeled, + "assigned_at": self.assigned_at, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -46,13 +46,12 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListIp200ResponseInner( - ip=payload.get('ip'), - subusers=payload.get('subusers'), - rdns=payload.get('rdns'), - pools=payload.get('pools'), - warmup=payload.get('warmup'), - start_date=payload.get('start_date'), - whitelabeled=payload.get('whitelabeled'), - assigned_at=payload.get('assigned_at') - ) - + ip=payload.get("ip"), + subusers=payload.get("subusers"), + rdns=payload.get("rdns"), + pools=payload.get("pools"), + warmup=payload.get("warmup"), + start_date=payload.get("start_date"), + whitelabeled=payload.get("whitelabeled"), + assigned_at=payload.get("assigned_at"), + ) diff --git a/sendgrid/rest/api/ips/v3/models/list_remaining_ip_count200_response.py b/sendgrid/rest/api/ips/v3/models/list_remaining_ip_count200_response.py index 612d244a..b89f146f 100644 --- a/sendgrid/rest/api/ips/v3/models/list_remaining_ip_count200_response.py +++ b/sendgrid/rest/api/ips/v3/models/list_remaining_ip_count200_response.py @@ -1,23 +1,23 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ips.v3.models.list_remaining_ip_count200_response_results_inner import ListRemainingIpCount200ResponseResultsInner - +from sendgrid.rest.api.ips.v3.models.list_remaining_ip_count200_response_results_inner import ( + ListRemainingIpCount200ResponseResultsInner, +) class ListRemainingIpCount200Response: def __init__( - self, - results: Optional[List[ListRemainingIpCount200ResponseResultsInner]]=None + self, + results: Optional[List[ListRemainingIpCount200ResponseResultsInner]] = None, ): - self.results=results + self.results = results def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "results": self.results - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"results": self.results}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +25,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListRemainingIpCount200Response( - results=payload.get('results') - ) - + return ListRemainingIpCount200Response(results=payload.get("results")) diff --git a/sendgrid/rest/api/ips/v3/models/list_remaining_ip_count200_response_results_inner.py b/sendgrid/rest/api/ips/v3/models/list_remaining_ip_count200_response_results_inner.py index 159dfe37..826b2148 100644 --- a/sendgrid/rest/api/ips/v3/models/list_remaining_ip_count200_response_results_inner.py +++ b/sendgrid/rest/api/ips/v3/models/list_remaining_ip_count200_response_results_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListRemainingIpCount200ResponseResultsInner: def __init__( - self, - remaining: Optional[int]=None, - period: Optional[str]=None, - price_per_ip: Optional[float]=None + self, + remaining: Optional[int] = None, + period: Optional[str] = None, + price_per_ip: Optional[float] = None, ): - self.remaining=remaining - self.period=period - self.price_per_ip=price_per_ip + self.remaining = remaining + self.period = period + self.price_per_ip = price_per_ip def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "remaining": self.remaining, - "period": self.period, - "price_per_ip": self.price_per_ip - }.items() if value is not None} + "remaining": self.remaining, + "period": self.period, + "price_per_ip": self.price_per_ip, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListRemainingIpCount200ResponseResultsInner( - remaining=payload.get('remaining'), - period=payload.get('period'), - price_per_ip=payload.get('price_per_ip') - ) - + remaining=payload.get("remaining"), + period=payload.get("period"), + price_per_ip=payload.get("price_per_ip"), + ) diff --git a/sendgrid/rest/api/ips/v3/models/sort_by_direction.py b/sendgrid/rest/api/ips/v3/models/sort_by_direction.py index 76757c62..b544b184 100644 --- a/sendgrid/rest/api/ips/v3/models/sort_by_direction.py +++ b/sendgrid/rest/api/ips/v3/models/sort_by_direction.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class SortByDirection(Enum): - DESC='desc' - ASC='asc' - + DESC = "desc" + ASC = "asc" diff --git a/sendgrid/rest/api/ips/v3/models/update_ip_pool404_response.py b/sendgrid/rest/api/ips/v3/models/update_ip_pool404_response.py index daad4aed..91aecbad 100644 --- a/sendgrid/rest/api/ips/v3/models/update_ip_pool404_response.py +++ b/sendgrid/rest/api/ips/v3/models/update_ip_pool404_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.ips.v3.models.update_ip_pool404_response_errors_inner import UpdateIpPool404ResponseErrorsInner - +from sendgrid.rest.api.ips.v3.models.update_ip_pool404_response_errors_inner import ( + UpdateIpPool404ResponseErrorsInner, +) class UpdateIpPool404Response: def __init__( - self, - errors: Optional[List[UpdateIpPool404ResponseErrorsInner]]=None + self, errors: Optional[List[UpdateIpPool404ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateIpPool404Response( - errors=payload.get('errors') - ) - + return UpdateIpPool404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/ips/v3/models/update_ip_pool404_response_errors_inner.py b/sendgrid/rest/api/ips/v3/models/update_ip_pool404_response_errors_inner.py index 432a7522..bfe9dd3c 100644 --- a/sendgrid/rest/api/ips/v3/models/update_ip_pool404_response_errors_inner.py +++ b/sendgrid/rest/api/ips/v3/models/update_ip_pool404_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateIpPool404ResponseErrorsInner: - def __init__( - self, - field: Optional[str]=None, - message: Optional[str]=None - ): - self.field=field - self.message=message + def __init__(self, field: Optional[str] = None, message: Optional[str] = None): + self.field = field + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "field": self.field, - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"field": self.field, "message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateIpPool404ResponseErrorsInner( - field=payload.get('field'), - message=payload.get('message') - ) - + field=payload.get("field"), message=payload.get("message") + ) diff --git a/sendgrid/rest/api/ips/v3/models/update_ip_pool_request.py b/sendgrid/rest/api/ips/v3/models/update_ip_pool_request.py index f7f3bad8..494b4915 100644 --- a/sendgrid/rest/api/ips/v3/models/update_ip_pool_request.py +++ b/sendgrid/rest/api/ips/v3/models/update_ip_pool_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateIpPoolRequest: - def __init__( - self, - name: Optional[str]=None - ): - self.name=name + def __init__(self, name: Optional[str] = None): + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateIpPoolRequest( - name=payload.get('name') - ) - + return UpdateIpPoolRequest(name=payload.get("name")) diff --git a/sendgrid/rest/api/ips/v3/update_ip_pool.py b/sendgrid/rest/api/ips/v3/update_ip_pool.py index 5e8f2e99..54b3bd30 100644 --- a/sendgrid/rest/api/ips/v3/update_ip_pool.py +++ b/sendgrid/rest/api/ips/v3/update_ip_pool.py @@ -12,53 +12,48 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.ips.v3.models.ip_pools200 import IpPools200 from sendgrid.rest.api.ips.v3.models.update_ip_pool_request import UpdateIpPoolRequest + class UpdateIpPool: def __init__(self, client) -> None: self.client = client - + def send( self, - pool_name: str, - update_ip_pool_request: Optional[UpdateIpPoolRequest] = None, - + pool_name: str, + update_ip_pool_request: Optional[UpdateIpPoolRequest] = None, ): - path='/v3/ips/pools/{pool_name}' + path = "/v3/ips/pools/{pool_name}" path = path.format( - pool_name=pool_name, + pool_name=pool_name, ) data = None if update_ip_pool_request: data = update_ip_pool_request.to_dict() - request = Request( - method='PUT', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/link_branding/v3/__init__.py b/sendgrid/rest/api/link_branding/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/link_branding/v3/__init__.py +++ b/sendgrid/rest/api/link_branding/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/link_branding/v3/associate_branded_link_with_subuser.py b/sendgrid/rest/api/link_branding/v3/associate_branded_link_with_subuser.py index 82d27fc4..b27ee927 100644 --- a/sendgrid/rest/api/link_branding/v3/associate_branded_link_with_subuser.py +++ b/sendgrid/rest/api/link_branding/v3/associate_branded_link_with_subuser.py @@ -12,53 +12,52 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.link_branding.v3.models.associate_branded_link_with_subuser_request import AssociateBrandedLinkWithSubuserRequest -from sendgrid.rest.api.link_branding.v3.models.link_branding200 import LinkBranding200 +from sendgrid.rest.api.link_branding.v3.models.associate_branded_link_with_subuser_request import ( + AssociateBrandedLinkWithSubuserRequest, +) + class AssociateBrandedLinkWithSubuser: def __init__(self, client) -> None: self.client = client - + def send( self, - link_id: int, - associate_branded_link_with_subuser_request: Optional[AssociateBrandedLinkWithSubuserRequest] = None, - + link_id: int, + associate_branded_link_with_subuser_request: Optional[ + AssociateBrandedLinkWithSubuserRequest + ] = None, ): - path='/v3/whitelabel/links/{link_id}/subuser' + path = "/v3/whitelabel/links/{link_id}/subuser" path = path.format( - link_id=link_id, + link_id=link_id, ) data = None if associate_branded_link_with_subuser_request: data = associate_branded_link_with_subuser_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/link_branding/v3/create_branded_link.py b/sendgrid/rest/api/link_branding/v3/create_branded_link.py index d17d2bb1..9e1e16a1 100644 --- a/sendgrid/rest/api/link_branding/v3/create_branded_link.py +++ b/sendgrid/rest/api/link_branding/v3/create_branded_link.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.link_branding.v3.models.create_branded_link_request import CreateBrandedLinkRequest -from sendgrid.rest.api.link_branding.v3.models.link_branding200 import LinkBranding200 +from sendgrid.rest.api.link_branding.v3.models.create_branded_link_request import ( + CreateBrandedLinkRequest, +) + class CreateBrandedLink: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - create_branded_link_request: Optional[CreateBrandedLinkRequest] = None, - + on_behalf_of: Optional[str] = None, + create_branded_link_request: Optional[CreateBrandedLinkRequest] = None, ): - path='/v3/whitelabel/links' + path = "/v3/whitelabel/links" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if create_branded_link_request: data = create_branded_link_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/link_branding/v3/delete_branded_link.py b/sendgrid/rest/api/link_branding/v3/delete_branded_link.py index 751be37f..6357becf 100644 --- a/sendgrid/rest/api/link_branding/v3/delete_branded_link.py +++ b/sendgrid/rest/api/link_branding/v3/delete_branded_link.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteBrandedLink: def __init__(self, client) -> None: self.client = client - + def send( self, - id: int, - on_behalf_of: Optional[str] = None, - + id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/whitelabel/links/{id}' + path = "/v3/whitelabel/links/{id}" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/link_branding/v3/disassociate_branded_link_from_subuser.py b/sendgrid/rest/api/link_branding/v3/disassociate_branded_link_from_subuser.py index 0bda9cfc..204a4dac 100644 --- a/sendgrid/rest/api/link_branding/v3/disassociate_branded_link_from_subuser.py +++ b/sendgrid/rest/api/link_branding/v3/disassociate_branded_link_from_subuser.py @@ -12,44 +12,39 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated class DisassociateBrandedLinkFromSubuser: def __init__(self, client) -> None: self.client = client - + def send( self, - username: Optional[str] = None, - + username: Optional[str] = None, ): - path='/v3/whitelabel/links/subuser' + path = "/v3/whitelabel/links/subuser" data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/link_branding/v3/get_branded_link.py b/sendgrid/rest/api/link_branding/v3/get_branded_link.py index a69ba78b..a68c9242 100644 --- a/sendgrid/rest/api/link_branding/v3/get_branded_link.py +++ b/sendgrid/rest/api/link_branding/v3/get_branded_link.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.link_branding.v3.models.link_branding200 import LinkBranding200 + class GetBrandedLink: def __init__(self, client) -> None: self.client = client - + def send( self, - id: int, - on_behalf_of: Optional[str] = None, - + id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/whitelabel/links/{id}' + path = "/v3/whitelabel/links/{id}" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/link_branding/v3/list_branded_link.py b/sendgrid/rest/api/link_branding/v3/list_branded_link.py index 6a420825..b9830feb 100644 --- a/sendgrid/rest/api/link_branding/v3/list_branded_link.py +++ b/sendgrid/rest/api/link_branding/v3/list_branded_link.py @@ -12,51 +12,48 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.link_branding.v3.models.link_branding200 import LinkBranding200 + class ListBrandedLink: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - limit: Optional[int] = None, - + on_behalf_of: Optional[str] = None, + limit: Optional[int] = None, ): - path='/v3/whitelabel/links' + path = "/v3/whitelabel/links" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/link_branding/v3/list_default_branded_link.py b/sendgrid/rest/api/link_branding/v3/list_default_branded_link.py index b1186268..b7a8e9fe 100644 --- a/sendgrid/rest/api/link_branding/v3/list_default_branded_link.py +++ b/sendgrid/rest/api/link_branding/v3/list_default_branded_link.py @@ -12,51 +12,48 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.link_branding.v3.models.link_branding200 import LinkBranding200 + class ListDefaultBrandedLink: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - domain: Optional[str] = None, - + on_behalf_of: Optional[str] = None, + domain: Optional[str] = None, ): - path='/v3/whitelabel/links/default' + path = "/v3/whitelabel/links/default" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/link_branding/v3/list_subuser_branded_link.py b/sendgrid/rest/api/link_branding/v3/list_subuser_branded_link.py index 537a202e..43bda144 100644 --- a/sendgrid/rest/api/link_branding/v3/list_subuser_branded_link.py +++ b/sendgrid/rest/api/link_branding/v3/list_subuser_branded_link.py @@ -12,45 +12,39 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.link_branding.v3.models.link_branding200 import LinkBranding200 class ListSubuserBrandedLink: def __init__(self, client) -> None: self.client = client - + def send( self, - username: Optional[str] = None, - + username: Optional[str] = None, ): - path='/v3/whitelabel/links/subuser' + path = "/v3/whitelabel/links/subuser" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/link_branding/v3/models/__init__.py b/sendgrid/rest/api/link_branding/v3/models/__init__.py index 318dd9f6..9810f19c 100644 --- a/sendgrid/rest/api/link_branding/v3/models/__init__.py +++ b/sendgrid/rest/api/link_branding/v3/models/__init__.py @@ -11,33 +11,84 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.link_branding.v3.models.associate_branded_link_with_subuser_request import AssociateBrandedLinkWithSubuserRequest -from sendgrid.rest.api.link_branding.v3.models.create_branded_link_request import CreateBrandedLinkRequest +from sendgrid.rest.api.link_branding.v3.models.associate_branded_link_with_subuser_request import ( + AssociateBrandedLinkWithSubuserRequest, +) +from sendgrid.rest.api.link_branding.v3.models.create_branded_link_request import ( + CreateBrandedLinkRequest, +) from sendgrid.rest.api.link_branding.v3.models.default import Default from sendgrid.rest.api.link_branding.v3.models.default1 import Default1 from sendgrid.rest.api.link_branding.v3.models.default2 import Default2 from sendgrid.rest.api.link_branding.v3.models.legacy import Legacy from sendgrid.rest.api.link_branding.v3.models.link_branding200 import LinkBranding200 -from sendgrid.rest.api.link_branding.v3.models.link_branding200_dns import LinkBranding200Dns -from sendgrid.rest.api.link_branding.v3.models.link_branding200_dns_domain_cname import LinkBranding200DnsDomainCname -from sendgrid.rest.api.link_branding.v3.models.link_branding200_dns_owner_cname import LinkBranding200DnsOwnerCname +from sendgrid.rest.api.link_branding.v3.models.link_branding200_dns import ( + LinkBranding200Dns, +) +from sendgrid.rest.api.link_branding.v3.models.link_branding200_dns_domain_cname import ( + LinkBranding200DnsDomainCname, +) +from sendgrid.rest.api.link_branding.v3.models.link_branding200_dns_owner_cname import ( + LinkBranding200DnsOwnerCname, +) from sendgrid.rest.api.link_branding.v3.models.region import Region from sendgrid.rest.api.link_branding.v3.models.type import Type from sendgrid.rest.api.link_branding.v3.models.type1 import Type1 -from sendgrid.rest.api.link_branding.v3.models.update_branded_link_request import UpdateBrandedLinkRequest +from sendgrid.rest.api.link_branding.v3.models.update_branded_link_request import ( + UpdateBrandedLinkRequest, +) from sendgrid.rest.api.link_branding.v3.models.valid import Valid from sendgrid.rest.api.link_branding.v3.models.valid1 import Valid1 from sendgrid.rest.api.link_branding.v3.models.valid2 import Valid2 from sendgrid.rest.api.link_branding.v3.models.valid3 import Valid3 from sendgrid.rest.api.link_branding.v3.models.valid4 import Valid4 from sendgrid.rest.api.link_branding.v3.models.valid5 import Valid5 -from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response import ValidateBrandedLink200Response -from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response_validation_results import ValidateBrandedLink200ResponseValidationResults -from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response_validation_results_domain_cname import ValidateBrandedLink200ResponseValidationResultsDomainCname -from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response_validation_results_owner_cname import ValidateBrandedLink200ResponseValidationResultsOwnerCname -from sendgrid.rest.api.link_branding.v3.models.validate_branded_link500_response import ValidateBrandedLink500Response -from sendgrid.rest.api.link_branding.v3.models.validate_branded_link500_response_errors_inner import ValidateBrandedLink500ResponseErrorsInner -__all__ = [ 'AssociateBrandedLinkWithSubuserRequest', 'CreateBrandedLinkRequest', 'Default', 'Default1', 'Default2', 'Legacy', 'LinkBranding200', 'LinkBranding200Dns', 'LinkBranding200DnsDomainCname', 'LinkBranding200DnsOwnerCname', 'Region', 'Type', 'Type1', 'UpdateBrandedLinkRequest', 'Valid', 'Valid1', 'Valid2', 'Valid3', 'Valid4', 'Valid5', 'ValidateBrandedLink200Response', 'ValidateBrandedLink200ResponseValidationResults', 'ValidateBrandedLink200ResponseValidationResultsDomainCname', 'ValidateBrandedLink200ResponseValidationResultsOwnerCname', 'ValidateBrandedLink500Response', 'ValidateBrandedLink500ResponseErrorsInner' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response import ( + ValidateBrandedLink200Response, +) +from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response_validation_results import ( + ValidateBrandedLink200ResponseValidationResults, +) +from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response_validation_results_domain_cname import ( + ValidateBrandedLink200ResponseValidationResultsDomainCname, +) +from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response_validation_results_owner_cname import ( + ValidateBrandedLink200ResponseValidationResultsOwnerCname, +) +from sendgrid.rest.api.link_branding.v3.models.validate_branded_link500_response import ( + ValidateBrandedLink500Response, +) +from sendgrid.rest.api.link_branding.v3.models.validate_branded_link500_response_errors_inner import ( + ValidateBrandedLink500ResponseErrorsInner, +) + +__all__ = [ + "AssociateBrandedLinkWithSubuserRequest", + "CreateBrandedLinkRequest", + "Default", + "Default1", + "Default2", + "Legacy", + "LinkBranding200", + "LinkBranding200Dns", + "LinkBranding200DnsDomainCname", + "LinkBranding200DnsOwnerCname", + "Region", + "Type", + "Type1", + "UpdateBrandedLinkRequest", + "Valid", + "Valid1", + "Valid2", + "Valid3", + "Valid4", + "Valid5", + "ValidateBrandedLink200Response", + "ValidateBrandedLink200ResponseValidationResults", + "ValidateBrandedLink200ResponseValidationResultsDomainCname", + "ValidateBrandedLink200ResponseValidationResultsOwnerCname", + "ValidateBrandedLink500Response", + "ValidateBrandedLink500ResponseErrorsInner", +] +# Testing code diff --git a/sendgrid/rest/api/link_branding/v3/models/associate_branded_link_with_subuser_request.py b/sendgrid/rest/api/link_branding/v3/models/associate_branded_link_with_subuser_request.py index 336ad4b2..8084aa83 100644 --- a/sendgrid/rest/api/link_branding/v3/models/associate_branded_link_with_subuser_request.py +++ b/sendgrid/rest/api/link_branding/v3/models/associate_branded_link_with_subuser_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AssociateBrandedLinkWithSubuserRequest: - def __init__( - self, - username: Optional[str]=None - ): - self.username=username + def __init__(self, username: Optional[str] = None): + self.username = username def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "username": self.username - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"username": self.username}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return AssociateBrandedLinkWithSubuserRequest( - username=payload.get('username') - ) - + return AssociateBrandedLinkWithSubuserRequest(username=payload.get("username")) diff --git a/sendgrid/rest/api/link_branding/v3/models/create_branded_link_request.py b/sendgrid/rest/api/link_branding/v3/models/create_branded_link_request.py index c138feba..66db65a4 100644 --- a/sendgrid/rest/api/link_branding/v3/models/create_branded_link_request.py +++ b/sendgrid/rest/api/link_branding/v3/models/create_branded_link_request.py @@ -1,33 +1,33 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.link_branding.v3.models.default import Default from sendgrid.rest.api.link_branding.v3.models.region import Region - class CreateBrandedLinkRequest: def __init__( - self, - domain: Optional[str]=None, - subdomain: Optional[str]=None, - default: Optional[Default]=None, - region: Optional[Region]=None + self, + domain: Optional[str] = None, + subdomain: Optional[str] = None, + default: Optional[Default] = None, + region: Optional[Region] = None, ): - self.domain=domain - self.subdomain=subdomain - self.default=default - self.region=region + self.domain = domain + self.subdomain = subdomain + self.default = default + self.region = region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "domain": self.domain, - "subdomain": self.subdomain, - "default": self.default, - "region": self.region - }.items() if value is not None} + "domain": self.domain, + "subdomain": self.subdomain, + "default": self.default, + "region": self.region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -36,9 +36,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateBrandedLinkRequest( - domain=payload.get('domain'), - subdomain=payload.get('subdomain'), - default=payload.get('default'), - region=payload.get('region') - ) - + domain=payload.get("domain"), + subdomain=payload.get("subdomain"), + default=payload.get("default"), + region=payload.get("region"), + ) diff --git a/sendgrid/rest/api/link_branding/v3/models/link_branding200.py b/sendgrid/rest/api/link_branding/v3/models/link_branding200.py index 20f4e9ce..96c24cb1 100644 --- a/sendgrid/rest/api/link_branding/v3/models/link_branding200.py +++ b/sendgrid/rest/api/link_branding/v3/models/link_branding200.py @@ -1,50 +1,52 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.link_branding.v3.models.default2 import Default2 from sendgrid.rest.api.link_branding.v3.models.legacy import Legacy -from sendgrid.rest.api.link_branding.v3.models.link_branding200_dns import LinkBranding200Dns +from sendgrid.rest.api.link_branding.v3.models.link_branding200_dns import ( + LinkBranding200Dns, +) from sendgrid.rest.api.link_branding.v3.models.valid3 import Valid3 - class LinkBranding200: def __init__( - self, - id: Optional[int]=None, - domain: Optional[str]=None, - subdomain: Optional[str]=None, - username: Optional[str]=None, - user_id: Optional[int]=None, - default: Optional[Default2]=None, - valid: Optional[Valid3]=None, - legacy: Optional[Legacy]=None, - dns: Optional[LinkBranding200Dns]=None + self, + id: Optional[int] = None, + domain: Optional[str] = None, + subdomain: Optional[str] = None, + username: Optional[str] = None, + user_id: Optional[int] = None, + default: Optional[Default2] = None, + valid: Optional[Valid3] = None, + legacy: Optional[Legacy] = None, + dns: Optional[LinkBranding200Dns] = None, ): - self.id=id - self.domain=domain - self.subdomain=subdomain - self.username=username - self.user_id=user_id - self.default=default - self.valid=valid - self.legacy=legacy - self.dns=dns + self.id = id + self.domain = domain + self.subdomain = subdomain + self.username = username + self.user_id = user_id + self.default = default + self.valid = valid + self.legacy = legacy + self.dns = dns def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "domain": self.domain, - "subdomain": self.subdomain, - "username": self.username, - "user_id": self.user_id, - "default": self.default, - "valid": self.valid, - "legacy": self.legacy, - "dns": self.dns - }.items() if value is not None} + "id": self.id, + "domain": self.domain, + "subdomain": self.subdomain, + "username": self.username, + "user_id": self.user_id, + "default": self.default, + "valid": self.valid, + "legacy": self.legacy, + "dns": self.dns, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -53,14 +55,13 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return LinkBranding200( - id=payload.get('id'), - domain=payload.get('domain'), - subdomain=payload.get('subdomain'), - username=payload.get('username'), - user_id=payload.get('user_id'), - default=payload.get('default'), - valid=payload.get('valid'), - legacy=payload.get('legacy'), - dns=payload.get('dns') - ) - + id=payload.get("id"), + domain=payload.get("domain"), + subdomain=payload.get("subdomain"), + username=payload.get("username"), + user_id=payload.get("user_id"), + default=payload.get("default"), + valid=payload.get("valid"), + legacy=payload.get("legacy"), + dns=payload.get("dns"), + ) diff --git a/sendgrid/rest/api/link_branding/v3/models/link_branding200_dns.py b/sendgrid/rest/api/link_branding/v3/models/link_branding200_dns.py index fc2bb20f..56a01c2d 100644 --- a/sendgrid/rest/api/link_branding/v3/models/link_branding200_dns.py +++ b/sendgrid/rest/api/link_branding/v3/models/link_branding200_dns.py @@ -1,27 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.link_branding.v3.models.link_branding200_dns_domain_cname import LinkBranding200DnsDomainCname -from sendgrid.rest.api.link_branding.v3.models.link_branding200_dns_owner_cname import LinkBranding200DnsOwnerCname - +from sendgrid.rest.api.link_branding.v3.models.link_branding200_dns_domain_cname import ( + LinkBranding200DnsDomainCname, +) +from sendgrid.rest.api.link_branding.v3.models.link_branding200_dns_owner_cname import ( + LinkBranding200DnsOwnerCname, +) class LinkBranding200Dns: def __init__( - self, - domain_cname: Optional[LinkBranding200DnsDomainCname]=None, - owner_cname: Optional[LinkBranding200DnsOwnerCname]=None + self, + domain_cname: Optional[LinkBranding200DnsDomainCname] = None, + owner_cname: Optional[LinkBranding200DnsOwnerCname] = None, ): - self.domain_cname=domain_cname - self.owner_cname=owner_cname + self.domain_cname = domain_cname + self.owner_cname = owner_cname def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "domain_cname": self.domain_cname, - "owner_cname": self.owner_cname - }.items() if value is not None} + "domain_cname": self.domain_cname, + "owner_cname": self.owner_cname, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -30,7 +34,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return LinkBranding200Dns( - domain_cname=payload.get('domain_cname'), - owner_cname=payload.get('owner_cname') - ) - + domain_cname=payload.get("domain_cname"), + owner_cname=payload.get("owner_cname"), + ) diff --git a/sendgrid/rest/api/link_branding/v3/models/link_branding200_dns_domain_cname.py b/sendgrid/rest/api/link_branding/v3/models/link_branding200_dns_domain_cname.py index d259e985..01c45611 100644 --- a/sendgrid/rest/api/link_branding/v3/models/link_branding200_dns_domain_cname.py +++ b/sendgrid/rest/api/link_branding/v3/models/link_branding200_dns_domain_cname.py @@ -1,33 +1,33 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.link_branding.v3.models.type import Type from sendgrid.rest.api.link_branding.v3.models.valid4 import Valid4 - class LinkBranding200DnsDomainCname: def __init__( - self, - valid: Optional[Valid4]=None, - type: Optional[Type]=None, - host: Optional[str]=None, - data: Optional[str]=None + self, + valid: Optional[Valid4] = None, + type: Optional[Type] = None, + host: Optional[str] = None, + data: Optional[str] = None, ): - self.valid=valid - self.type=type - self.host=host - self.data=data + self.valid = valid + self.type = type + self.host = host + self.data = data def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "valid": self.valid, - "type": self.type, - "host": self.host, - "data": self.data - }.items() if value is not None} + "valid": self.valid, + "type": self.type, + "host": self.host, + "data": self.data, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -36,9 +36,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return LinkBranding200DnsDomainCname( - valid=payload.get('valid'), - type=payload.get('type'), - host=payload.get('host'), - data=payload.get('data') - ) - + valid=payload.get("valid"), + type=payload.get("type"), + host=payload.get("host"), + data=payload.get("data"), + ) diff --git a/sendgrid/rest/api/link_branding/v3/models/link_branding200_dns_owner_cname.py b/sendgrid/rest/api/link_branding/v3/models/link_branding200_dns_owner_cname.py index 7e3c325d..310d18ae 100644 --- a/sendgrid/rest/api/link_branding/v3/models/link_branding200_dns_owner_cname.py +++ b/sendgrid/rest/api/link_branding/v3/models/link_branding200_dns_owner_cname.py @@ -1,33 +1,33 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.link_branding.v3.models.type1 import Type1 from sendgrid.rest.api.link_branding.v3.models.valid5 import Valid5 - class LinkBranding200DnsOwnerCname: def __init__( - self, - valid: Optional[Valid5]=None, - type: Optional[Type1]=None, - host: Optional[str]=None, - data: Optional[str]=None + self, + valid: Optional[Valid5] = None, + type: Optional[Type1] = None, + host: Optional[str] = None, + data: Optional[str] = None, ): - self.valid=valid - self.type=type - self.host=host - self.data=data + self.valid = valid + self.type = type + self.host = host + self.data = data def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "valid": self.valid, - "type": self.type, - "host": self.host, - "data": self.data - }.items() if value is not None} + "valid": self.valid, + "type": self.type, + "host": self.host, + "data": self.data, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -36,9 +36,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return LinkBranding200DnsOwnerCname( - valid=payload.get('valid'), - type=payload.get('type'), - host=payload.get('host'), - data=payload.get('data') - ) - + valid=payload.get("valid"), + type=payload.get("type"), + host=payload.get("host"), + data=payload.get("data"), + ) diff --git a/sendgrid/rest/api/link_branding/v3/models/region.py b/sendgrid/rest/api/link_branding/v3/models/region.py index fb91e86a..7a3adff7 100644 --- a/sendgrid/rest/api/link_branding/v3/models/region.py +++ b/sendgrid/rest/api/link_branding/v3/models/region.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Region(Enum): - EU='eu' - US='us' - + EU = "eu" + US = "us" diff --git a/sendgrid/rest/api/link_branding/v3/models/type.py b/sendgrid/rest/api/link_branding/v3/models/type.py index bfccc985..ecb752dd 100644 --- a/sendgrid/rest/api/link_branding/v3/models/type.py +++ b/sendgrid/rest/api/link_branding/v3/models/type.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Type(Enum): - CNAME='cname' - TXT='txt' - MX='mx' - + CNAME = "cname" + TXT = "txt" + MX = "mx" diff --git a/sendgrid/rest/api/link_branding/v3/models/type1.py b/sendgrid/rest/api/link_branding/v3/models/type1.py index 928c27ce..a01654bf 100644 --- a/sendgrid/rest/api/link_branding/v3/models/type1.py +++ b/sendgrid/rest/api/link_branding/v3/models/type1.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Type1(Enum): - CNAME='cname' - TXT='txt' - MX='mx' - + CNAME = "cname" + TXT = "txt" + MX = "mx" diff --git a/sendgrid/rest/api/link_branding/v3/models/update_branded_link_request.py b/sendgrid/rest/api/link_branding/v3/models/update_branded_link_request.py index 206967e9..b8db059e 100644 --- a/sendgrid/rest/api/link_branding/v3/models/update_branded_link_request.py +++ b/sendgrid/rest/api/link_branding/v3/models/update_branded_link_request.py @@ -1,23 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.link_branding.v3.models.default1 import Default1 - class UpdateBrandedLinkRequest: - def __init__( - self, - default: Optional[Default1]=None - ): - self.default=default + def __init__(self, default: Optional[Default1] = None): + self.default = default def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "default": self.default - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"default": self.default}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateBrandedLinkRequest( - default=payload.get('default') - ) - + return UpdateBrandedLinkRequest(default=payload.get("default")) diff --git a/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response.py b/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response.py index 53c3f2e0..4fa96511 100644 --- a/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response.py +++ b/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response.py @@ -1,30 +1,34 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.link_branding.v3.models.valid import Valid -from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response_validation_results import ValidateBrandedLink200ResponseValidationResults - +from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response_validation_results import ( + ValidateBrandedLink200ResponseValidationResults, +) class ValidateBrandedLink200Response: def __init__( - self, - id: Optional[int]=None, - valid: Optional[Valid]=None, - validation_results: Optional[ValidateBrandedLink200ResponseValidationResults]=None + self, + id: Optional[int] = None, + valid: Optional[Valid] = None, + validation_results: Optional[ + ValidateBrandedLink200ResponseValidationResults + ] = None, ): - self.id=id - self.valid=valid - self.validation_results=validation_results + self.id = id + self.valid = valid + self.validation_results = validation_results def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "valid": self.valid, - "validation_results": self.validation_results - }.items() if value is not None} + "id": self.id, + "valid": self.valid, + "validation_results": self.validation_results, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -33,8 +37,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateBrandedLink200Response( - id=payload.get('id'), - valid=payload.get('valid'), - validation_results=payload.get('validation_results') - ) - + id=payload.get("id"), + valid=payload.get("valid"), + validation_results=payload.get("validation_results"), + ) diff --git a/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response_validation_results.py b/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response_validation_results.py index 6bb1c516..06153650 100644 --- a/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response_validation_results.py +++ b/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response_validation_results.py @@ -1,27 +1,35 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response_validation_results_domain_cname import ValidateBrandedLink200ResponseValidationResultsDomainCname -from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response_validation_results_owner_cname import ValidateBrandedLink200ResponseValidationResultsOwnerCname - +from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response_validation_results_domain_cname import ( + ValidateBrandedLink200ResponseValidationResultsDomainCname, +) +from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response_validation_results_owner_cname import ( + ValidateBrandedLink200ResponseValidationResultsOwnerCname, +) class ValidateBrandedLink200ResponseValidationResults: def __init__( - self, - domain_cname: Optional[ValidateBrandedLink200ResponseValidationResultsDomainCname]=None, - owner_cname: Optional[ValidateBrandedLink200ResponseValidationResultsOwnerCname]=None + self, + domain_cname: Optional[ + ValidateBrandedLink200ResponseValidationResultsDomainCname + ] = None, + owner_cname: Optional[ + ValidateBrandedLink200ResponseValidationResultsOwnerCname + ] = None, ): - self.domain_cname=domain_cname - self.owner_cname=owner_cname + self.domain_cname = domain_cname + self.owner_cname = owner_cname def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "domain_cname": self.domain_cname, - "owner_cname": self.owner_cname - }.items() if value is not None} + "domain_cname": self.domain_cname, + "owner_cname": self.owner_cname, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -30,7 +38,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateBrandedLink200ResponseValidationResults( - domain_cname=payload.get('domain_cname'), - owner_cname=payload.get('owner_cname') - ) - + domain_cname=payload.get("domain_cname"), + owner_cname=payload.get("owner_cname"), + ) diff --git a/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response_validation_results_domain_cname.py b/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response_validation_results_domain_cname.py index 4116190e..194e1eef 100644 --- a/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response_validation_results_domain_cname.py +++ b/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response_validation_results_domain_cname.py @@ -1,26 +1,19 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.link_branding.v3.models.valid1 import Valid1 - class ValidateBrandedLink200ResponseValidationResultsDomainCname: - def __init__( - self, - valid: Optional[Valid1]=None, - reason: Optional[str]=None - ): - self.valid=valid - self.reason=reason + def __init__(self, valid: Optional[Valid1] = None, reason: Optional[str] = None): + self.valid = valid + self.reason = reason def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "valid": self.valid, - "reason": self.reason - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"valid": self.valid, "reason": self.reason}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +22,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateBrandedLink200ResponseValidationResultsDomainCname( - valid=payload.get('valid'), - reason=payload.get('reason') - ) - + valid=payload.get("valid"), reason=payload.get("reason") + ) diff --git a/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response_validation_results_owner_cname.py b/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response_validation_results_owner_cname.py index dc088a42..c5405da0 100644 --- a/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response_validation_results_owner_cname.py +++ b/sendgrid/rest/api/link_branding/v3/models/validate_branded_link200_response_validation_results_owner_cname.py @@ -1,26 +1,19 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.link_branding.v3.models.valid2 import Valid2 - class ValidateBrandedLink200ResponseValidationResultsOwnerCname: - def __init__( - self, - valid: Optional[Valid2]=None, - reason: Optional[str]=None - ): - self.valid=valid - self.reason=reason + def __init__(self, valid: Optional[Valid2] = None, reason: Optional[str] = None): + self.valid = valid + self.reason = reason def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "valid": self.valid, - "reason": self.reason - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"valid": self.valid, "reason": self.reason}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +22,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateBrandedLink200ResponseValidationResultsOwnerCname( - valid=payload.get('valid'), - reason=payload.get('reason') - ) - + valid=payload.get("valid"), reason=payload.get("reason") + ) diff --git a/sendgrid/rest/api/link_branding/v3/models/validate_branded_link500_response.py b/sendgrid/rest/api/link_branding/v3/models/validate_branded_link500_response.py index 9cb79d29..6703c994 100644 --- a/sendgrid/rest/api/link_branding/v3/models/validate_branded_link500_response.py +++ b/sendgrid/rest/api/link_branding/v3/models/validate_branded_link500_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.link_branding.v3.models.validate_branded_link500_response_errors_inner import ValidateBrandedLink500ResponseErrorsInner - +from sendgrid.rest.api.link_branding.v3.models.validate_branded_link500_response_errors_inner import ( + ValidateBrandedLink500ResponseErrorsInner, +) class ValidateBrandedLink500Response: def __init__( - self, - errors: Optional[List[ValidateBrandedLink500ResponseErrorsInner]]=None + self, errors: Optional[List[ValidateBrandedLink500ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ValidateBrandedLink500Response( - errors=payload.get('errors') - ) - + return ValidateBrandedLink500Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/link_branding/v3/models/validate_branded_link500_response_errors_inner.py b/sendgrid/rest/api/link_branding/v3/models/validate_branded_link500_response_errors_inner.py index 89000ed3..1b38c59f 100644 --- a/sendgrid/rest/api/link_branding/v3/models/validate_branded_link500_response_errors_inner.py +++ b/sendgrid/rest/api/link_branding/v3/models/validate_branded_link500_response_errors_inner.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ValidateBrandedLink500ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ValidateBrandedLink500ResponseErrorsInner( - message=payload.get('message') - ) - + return ValidateBrandedLink500ResponseErrorsInner(message=payload.get("message")) diff --git a/sendgrid/rest/api/link_branding/v3/update_branded_link.py b/sendgrid/rest/api/link_branding/v3/update_branded_link.py index b135bc15..f7e3f9aa 100644 --- a/sendgrid/rest/api/link_branding/v3/update_branded_link.py +++ b/sendgrid/rest/api/link_branding/v3/update_branded_link.py @@ -12,59 +12,58 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.link_branding.v3.models.link_branding200 import LinkBranding200 -from sendgrid.rest.api.link_branding.v3.models.update_branded_link_request import UpdateBrandedLinkRequest +from sendgrid.rest.api.link_branding.v3.models.update_branded_link_request import ( + UpdateBrandedLinkRequest, +) + class UpdateBrandedLink: def __init__(self, client) -> None: self.client = client - + def send( self, - id: int, - on_behalf_of: Optional[str] = None, - update_branded_link_request: Optional[UpdateBrandedLinkRequest] = None, - + id: int, + on_behalf_of: Optional[str] = None, + update_branded_link_request: Optional[UpdateBrandedLinkRequest] = None, ): - path='/v3/whitelabel/links/{id}' + path = "/v3/whitelabel/links/{id}" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_branded_link_request: data = update_branded_link_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/link_branding/v3/validate_branded_link.py b/sendgrid/rest/api/link_branding/v3/validate_branded_link.py index ac693775..4f29550a 100644 --- a/sendgrid/rest/api/link_branding/v3/validate_branded_link.py +++ b/sendgrid/rest/api/link_branding/v3/validate_branded_link.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.link_branding.v3.models.validate_branded_link200_response import ValidateBrandedLink200Response + class ValidateBrandedLink: def __init__(self, client) -> None: self.client = client - + def send( self, - id: int, - on_behalf_of: Optional[str] = None, - + id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/whitelabel/links/{id}/validate' + path = "/v3/whitelabel/links/{id}/validate" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='POST', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/__init__.py b/sendgrid/rest/api/lmc_campaigns/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/__init__.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/lmc_campaigns/v3/create_campaign.py b/sendgrid/rest/api/lmc_campaigns/v3/create_campaign.py index 08916215..351c498f 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/create_campaign.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/create_campaign.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_campaigns.v3.models.campaigns2xx import Campaigns2xx -from sendgrid.rest.api.lmc_campaigns.v3.models.post_campaigns_request import PostCampaignsRequest +from sendgrid.rest.api.lmc_campaigns.v3.models.post_campaigns_request import ( + PostCampaignsRequest, +) + class CreateCampaign: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - post_campaigns_request: Optional[PostCampaignsRequest] = None, - + on_behalf_of: Optional[str] = None, + post_campaigns_request: Optional[PostCampaignsRequest] = None, ): - path='/v3/campaigns' + path = "/v3/campaigns" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if post_campaigns_request: data = post_campaigns_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/delete_campaign.py b/sendgrid/rest/api/lmc_campaigns/v3/delete_campaign.py index 71eda0bc..5f3e650c 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/delete_campaign.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/delete_campaign.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteCampaign: def __init__(self, client) -> None: self.client = client - + def send( self, - campaign_id: int, - on_behalf_of: Optional[str] = None, - + campaign_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/campaigns/{campaign_id}' + path = "/v3/campaigns/{campaign_id}" path = path.format( - campaign_id=campaign_id, + campaign_id=campaign_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/get_campaign.py b/sendgrid/rest/api/lmc_campaigns/v3/get_campaign.py index 1286e6df..7cd91834 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/get_campaign.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/get_campaign.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_campaigns.v3.models.get_campaign200_response import GetCampaign200Response + class GetCampaign: def __init__(self, client) -> None: self.client = client - + def send( self, - campaign_id: int, - on_behalf_of: Optional[str] = None, - + campaign_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/campaigns/{campaign_id}' + path = "/v3/campaigns/{campaign_id}" path = path.format( - campaign_id=campaign_id, + campaign_id=campaign_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/get_scheduled_campaign.py b/sendgrid/rest/api/lmc_campaigns/v3/get_scheduled_campaign.py index acc93e21..75c8c285 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/get_scheduled_campaign.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/get_scheduled_campaign.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_campaigns.v3.models.view_scheduled_time_of_a_campaign_response import ViewScheduledTimeOfACampaignResponse + class GetScheduledCampaign: def __init__(self, client) -> None: self.client = client - + def send( self, - campaign_id: int, - on_behalf_of: Optional[str] = None, - + campaign_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/campaigns/{campaign_id}/schedules' + path = "/v3/campaigns/{campaign_id}/schedules" path = path.format( - campaign_id=campaign_id, + campaign_id=campaign_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/list_campaign.py b/sendgrid/rest/api/lmc_campaigns/v3/list_campaign.py index 9b190ab7..0ec86af2 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/list_campaign.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/list_campaign.py @@ -12,52 +12,49 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_campaigns.v3.models.list_campaign200_response import ListCampaign200Response + class ListCampaign: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - + on_behalf_of: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, ): - path='/v3/campaigns' + path = "/v3/campaigns" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/__init__.py b/sendgrid/rest/api/lmc_campaigns/v3/models/__init__.py index b49d57c5..6c3e1e67 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/__init__.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/__init__.py @@ -11,24 +11,68 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.lmc_campaigns.v3.models.campaigns2xx import Campaigns2xx from sendgrid.rest.api.lmc_campaigns.v3.models.editor import Editor from sendgrid.rest.api.lmc_campaigns.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.lmc_campaigns.v3.models.error_response_errors_inner import ErrorResponseErrorsInner -from sendgrid.rest.api.lmc_campaigns.v3.models.get_campaign200_response import GetCampaign200Response -from sendgrid.rest.api.lmc_campaigns.v3.models.list_campaign200_response import ListCampaign200Response -from sendgrid.rest.api.lmc_campaigns.v3.models.post_campaigns_request import PostCampaignsRequest -from sendgrid.rest.api.lmc_campaigns.v3.models.schedule_a_campaign_request import ScheduleACampaignRequest -from sendgrid.rest.api.lmc_campaigns.v3.models.schedule_a_campaign_response import ScheduleACampaignResponse -from sendgrid.rest.api.lmc_campaigns.v3.models.send_a_campaign_response import SendACampaignResponse -from sendgrid.rest.api.lmc_campaigns.v3.models.send_a_test_campaign_request import SendATestCampaignRequest -from sendgrid.rest.api.lmc_campaigns.v3.models.send_test_campaign_request import SendTestCampaignRequest +from sendgrid.rest.api.lmc_campaigns.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) +from sendgrid.rest.api.lmc_campaigns.v3.models.get_campaign200_response import ( + GetCampaign200Response, +) +from sendgrid.rest.api.lmc_campaigns.v3.models.list_campaign200_response import ( + ListCampaign200Response, +) +from sendgrid.rest.api.lmc_campaigns.v3.models.post_campaigns_request import ( + PostCampaignsRequest, +) +from sendgrid.rest.api.lmc_campaigns.v3.models.schedule_a_campaign_request import ( + ScheduleACampaignRequest, +) +from sendgrid.rest.api.lmc_campaigns.v3.models.schedule_a_campaign_response import ( + ScheduleACampaignResponse, +) +from sendgrid.rest.api.lmc_campaigns.v3.models.send_a_campaign_response import ( + SendACampaignResponse, +) +from sendgrid.rest.api.lmc_campaigns.v3.models.send_a_test_campaign_request import ( + SendATestCampaignRequest, +) +from sendgrid.rest.api.lmc_campaigns.v3.models.send_test_campaign_request import ( + SendTestCampaignRequest, +) from sendgrid.rest.api.lmc_campaigns.v3.models.status import Status -from sendgrid.rest.api.lmc_campaigns.v3.models.update_a_campaign_request import UpdateACampaignRequest -from sendgrid.rest.api.lmc_campaigns.v3.models.update_a_scheduled_campaign_request import UpdateAScheduledCampaignRequest -from sendgrid.rest.api.lmc_campaigns.v3.models.update_a_scheduled_campaign_response import UpdateAScheduledCampaignResponse -from sendgrid.rest.api.lmc_campaigns.v3.models.view_scheduled_time_of_a_campaign_response import ViewScheduledTimeOfACampaignResponse -__all__ = [ 'Campaigns2xx', 'Editor', 'ErrorResponse', 'ErrorResponseErrorsInner', 'GetCampaign200Response', 'ListCampaign200Response', 'PostCampaignsRequest', 'ScheduleACampaignRequest', 'ScheduleACampaignResponse', 'SendACampaignResponse', 'SendATestCampaignRequest', 'SendTestCampaignRequest', 'Status', 'UpdateACampaignRequest', 'UpdateAScheduledCampaignRequest', 'UpdateAScheduledCampaignResponse', 'ViewScheduledTimeOfACampaignResponse' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.lmc_campaigns.v3.models.update_a_campaign_request import ( + UpdateACampaignRequest, +) +from sendgrid.rest.api.lmc_campaigns.v3.models.update_a_scheduled_campaign_request import ( + UpdateAScheduledCampaignRequest, +) +from sendgrid.rest.api.lmc_campaigns.v3.models.update_a_scheduled_campaign_response import ( + UpdateAScheduledCampaignResponse, +) +from sendgrid.rest.api.lmc_campaigns.v3.models.view_scheduled_time_of_a_campaign_response import ( + ViewScheduledTimeOfACampaignResponse, +) + +__all__ = [ + "Campaigns2xx", + "Editor", + "ErrorResponse", + "ErrorResponseErrorsInner", + "GetCampaign200Response", + "ListCampaign200Response", + "PostCampaignsRequest", + "ScheduleACampaignRequest", + "ScheduleACampaignResponse", + "SendACampaignResponse", + "SendATestCampaignRequest", + "SendTestCampaignRequest", + "Status", + "UpdateACampaignRequest", + "UpdateAScheduledCampaignRequest", + "UpdateAScheduledCampaignResponse", + "ViewScheduledTimeOfACampaignResponse", +] +# Testing code diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/campaigns2xx.py b/sendgrid/rest/api/lmc_campaigns/v3/models/campaigns2xx.py index 846ee2d9..94b24533 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/campaigns2xx.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/campaigns2xx.py @@ -1,62 +1,62 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.lmc_campaigns.v3.models.editor import Editor - class Campaigns2xx: def __init__( - self, - title: Optional[str]=None, - subject: Optional[str]=None, - sender_id: Optional[int]=None, - list_ids: Optional[List[int]]=None, - segment_ids: Optional[List[int]]=None, - categories: Optional[List[str]]=None, - suppression_group_id: Optional[int]=None, - custom_unsubscribe_url: Optional[str]=None, - ip_pool: Optional[str]=None, - html_content: Optional[str]=None, - plain_content: Optional[str]=None, - editor: Optional[Editor]=None, - status: Optional[str]=None, - id: Optional[int]=None + self, + title: Optional[str] = None, + subject: Optional[str] = None, + sender_id: Optional[int] = None, + list_ids: Optional[List[int]] = None, + segment_ids: Optional[List[int]] = None, + categories: Optional[List[str]] = None, + suppression_group_id: Optional[int] = None, + custom_unsubscribe_url: Optional[str] = None, + ip_pool: Optional[str] = None, + html_content: Optional[str] = None, + plain_content: Optional[str] = None, + editor: Optional[Editor] = None, + status: Optional[str] = None, + id: Optional[int] = None, ): - self.title=title - self.subject=subject - self.sender_id=sender_id - self.list_ids=list_ids - self.segment_ids=segment_ids - self.categories=categories - self.suppression_group_id=suppression_group_id - self.custom_unsubscribe_url=custom_unsubscribe_url - self.ip_pool=ip_pool - self.html_content=html_content - self.plain_content=plain_content - self.editor=editor - self.status=status - self.id=id + self.title = title + self.subject = subject + self.sender_id = sender_id + self.list_ids = list_ids + self.segment_ids = segment_ids + self.categories = categories + self.suppression_group_id = suppression_group_id + self.custom_unsubscribe_url = custom_unsubscribe_url + self.ip_pool = ip_pool + self.html_content = html_content + self.plain_content = plain_content + self.editor = editor + self.status = status + self.id = id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "title": self.title, - "subject": self.subject, - "sender_id": self.sender_id, - "list_ids": self.list_ids, - "segment_ids": self.segment_ids, - "categories": self.categories, - "suppression_group_id": self.suppression_group_id, - "custom_unsubscribe_url": self.custom_unsubscribe_url, - "ip_pool": self.ip_pool, - "html_content": self.html_content, - "plain_content": self.plain_content, - "editor": self.editor, - "status": self.status, - "id": self.id - }.items() if value is not None} + "title": self.title, + "subject": self.subject, + "sender_id": self.sender_id, + "list_ids": self.list_ids, + "segment_ids": self.segment_ids, + "categories": self.categories, + "suppression_group_id": self.suppression_group_id, + "custom_unsubscribe_url": self.custom_unsubscribe_url, + "ip_pool": self.ip_pool, + "html_content": self.html_content, + "plain_content": self.plain_content, + "editor": self.editor, + "status": self.status, + "id": self.id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -65,19 +65,18 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Campaigns2xx( - title=payload.get('title'), - subject=payload.get('subject'), - sender_id=payload.get('sender_id'), - list_ids=payload.get('list_ids'), - segment_ids=payload.get('segment_ids'), - categories=payload.get('categories'), - suppression_group_id=payload.get('suppression_group_id'), - custom_unsubscribe_url=payload.get('custom_unsubscribe_url'), - ip_pool=payload.get('ip_pool'), - html_content=payload.get('html_content'), - plain_content=payload.get('plain_content'), - editor=payload.get('editor'), - status=payload.get('status'), - id=payload.get('id') - ) - + title=payload.get("title"), + subject=payload.get("subject"), + sender_id=payload.get("sender_id"), + list_ids=payload.get("list_ids"), + segment_ids=payload.get("segment_ids"), + categories=payload.get("categories"), + suppression_group_id=payload.get("suppression_group_id"), + custom_unsubscribe_url=payload.get("custom_unsubscribe_url"), + ip_pool=payload.get("ip_pool"), + html_content=payload.get("html_content"), + plain_content=payload.get("plain_content"), + editor=payload.get("editor"), + status=payload.get("status"), + id=payload.get("id"), + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/editor.py b/sendgrid/rest/api/lmc_campaigns/v3/models/editor.py index cb1c4f64..47b41f47 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/editor.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/editor.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Editor(Enum): - CODE='code' - DESIGN='design' - + CODE = "code" + DESIGN = "design" diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/error_response.py b/sendgrid/rest/api/lmc_campaigns/v3/models/error_response.py index 37eb7c8e..9c1c5529 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/error_response.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_campaigns.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.lmc_campaigns.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/lmc_campaigns/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/get_campaign200_response.py b/sendgrid/rest/api/lmc_campaigns/v3/models/get_campaign200_response.py index aea77c09..abf44215 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/get_campaign200_response.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/get_campaign200_response.py @@ -1,58 +1,58 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GetCampaign200Response: def __init__( - self, - categories: Optional[List[str]]=None, - custom_unsubscribe_url: Optional[str]=None, - html_content: Optional[str]=None, - id: Optional[int]=None, - ip_pool: Optional[str]=None, - list_ids: Optional[List[int]]=None, - plain_content: Optional[str]=None, - segment_ids: Optional[List[int]]=None, - sender_id: Optional[int]=None, - status: Optional[str]=None, - subject: Optional[str]=None, - suppression_group_id: Optional[int]=None, - title: Optional[str]=None + self, + categories: Optional[List[str]] = None, + custom_unsubscribe_url: Optional[str] = None, + html_content: Optional[str] = None, + id: Optional[int] = None, + ip_pool: Optional[str] = None, + list_ids: Optional[List[int]] = None, + plain_content: Optional[str] = None, + segment_ids: Optional[List[int]] = None, + sender_id: Optional[int] = None, + status: Optional[str] = None, + subject: Optional[str] = None, + suppression_group_id: Optional[int] = None, + title: Optional[str] = None, ): - self.categories=categories - self.custom_unsubscribe_url=custom_unsubscribe_url - self.html_content=html_content - self.id=id - self.ip_pool=ip_pool - self.list_ids=list_ids - self.plain_content=plain_content - self.segment_ids=segment_ids - self.sender_id=sender_id - self.status=status - self.subject=subject - self.suppression_group_id=suppression_group_id - self.title=title + self.categories = categories + self.custom_unsubscribe_url = custom_unsubscribe_url + self.html_content = html_content + self.id = id + self.ip_pool = ip_pool + self.list_ids = list_ids + self.plain_content = plain_content + self.segment_ids = segment_ids + self.sender_id = sender_id + self.status = status + self.subject = subject + self.suppression_group_id = suppression_group_id + self.title = title def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "categories": self.categories, - "custom_unsubscribe_url": self.custom_unsubscribe_url, - "html_content": self.html_content, - "id": self.id, - "ip_pool": self.ip_pool, - "list_ids": self.list_ids, - "plain_content": self.plain_content, - "segment_ids": self.segment_ids, - "sender_id": self.sender_id, - "status": self.status, - "subject": self.subject, - "suppression_group_id": self.suppression_group_id, - "title": self.title - }.items() if value is not None} + "categories": self.categories, + "custom_unsubscribe_url": self.custom_unsubscribe_url, + "html_content": self.html_content, + "id": self.id, + "ip_pool": self.ip_pool, + "list_ids": self.list_ids, + "plain_content": self.plain_content, + "segment_ids": self.segment_ids, + "sender_id": self.sender_id, + "status": self.status, + "subject": self.subject, + "suppression_group_id": self.suppression_group_id, + "title": self.title, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -61,18 +61,17 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetCampaign200Response( - categories=payload.get('categories'), - custom_unsubscribe_url=payload.get('custom_unsubscribe_url'), - html_content=payload.get('html_content'), - id=payload.get('id'), - ip_pool=payload.get('ip_pool'), - list_ids=payload.get('list_ids'), - plain_content=payload.get('plain_content'), - segment_ids=payload.get('segment_ids'), - sender_id=payload.get('sender_id'), - status=payload.get('status'), - subject=payload.get('subject'), - suppression_group_id=payload.get('suppression_group_id'), - title=payload.get('title') - ) - + categories=payload.get("categories"), + custom_unsubscribe_url=payload.get("custom_unsubscribe_url"), + html_content=payload.get("html_content"), + id=payload.get("id"), + ip_pool=payload.get("ip_pool"), + list_ids=payload.get("list_ids"), + plain_content=payload.get("plain_content"), + segment_ids=payload.get("segment_ids"), + sender_id=payload.get("sender_id"), + status=payload.get("status"), + subject=payload.get("subject"), + suppression_group_id=payload.get("suppression_group_id"), + title=payload.get("title"), + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/list_campaign200_response.py b/sendgrid/rest/api/lmc_campaigns/v3/models/list_campaign200_response.py index d7e0474a..4cd34865 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/list_campaign200_response.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/list_campaign200_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.lmc_campaigns.v3.models.campaigns2xx import Campaigns2xx - class ListCampaign200Response: - def __init__( - self, - result: Optional[List[Campaigns2xx]]=None - ): - self.result=result + def __init__(self, result: Optional[List[Campaigns2xx]] = None): + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListCampaign200Response( - result=payload.get('result') - ) - + return ListCampaign200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/post_campaigns_request.py b/sendgrid/rest/api/lmc_campaigns/v3/models/post_campaigns_request.py index 558ba0e5..e5d97fbb 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/post_campaigns_request.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/post_campaigns_request.py @@ -1,56 +1,56 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.lmc_campaigns.v3.models.editor import Editor - class PostCampaignsRequest: def __init__( - self, - title: Optional[str]=None, - subject: Optional[str]=None, - sender_id: Optional[int]=None, - list_ids: Optional[List[int]]=None, - segment_ids: Optional[List[int]]=None, - categories: Optional[List[str]]=None, - suppression_group_id: Optional[int]=None, - custom_unsubscribe_url: Optional[str]=None, - ip_pool: Optional[str]=None, - html_content: Optional[str]=None, - plain_content: Optional[str]=None, - editor: Optional[Editor]=None + self, + title: Optional[str] = None, + subject: Optional[str] = None, + sender_id: Optional[int] = None, + list_ids: Optional[List[int]] = None, + segment_ids: Optional[List[int]] = None, + categories: Optional[List[str]] = None, + suppression_group_id: Optional[int] = None, + custom_unsubscribe_url: Optional[str] = None, + ip_pool: Optional[str] = None, + html_content: Optional[str] = None, + plain_content: Optional[str] = None, + editor: Optional[Editor] = None, ): - self.title=title - self.subject=subject - self.sender_id=sender_id - self.list_ids=list_ids - self.segment_ids=segment_ids - self.categories=categories - self.suppression_group_id=suppression_group_id - self.custom_unsubscribe_url=custom_unsubscribe_url - self.ip_pool=ip_pool - self.html_content=html_content - self.plain_content=plain_content - self.editor=editor + self.title = title + self.subject = subject + self.sender_id = sender_id + self.list_ids = list_ids + self.segment_ids = segment_ids + self.categories = categories + self.suppression_group_id = suppression_group_id + self.custom_unsubscribe_url = custom_unsubscribe_url + self.ip_pool = ip_pool + self.html_content = html_content + self.plain_content = plain_content + self.editor = editor def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "title": self.title, - "subject": self.subject, - "sender_id": self.sender_id, - "list_ids": self.list_ids, - "segment_ids": self.segment_ids, - "categories": self.categories, - "suppression_group_id": self.suppression_group_id, - "custom_unsubscribe_url": self.custom_unsubscribe_url, - "ip_pool": self.ip_pool, - "html_content": self.html_content, - "plain_content": self.plain_content, - "editor": self.editor - }.items() if value is not None} + "title": self.title, + "subject": self.subject, + "sender_id": self.sender_id, + "list_ids": self.list_ids, + "segment_ids": self.segment_ids, + "categories": self.categories, + "suppression_group_id": self.suppression_group_id, + "custom_unsubscribe_url": self.custom_unsubscribe_url, + "ip_pool": self.ip_pool, + "html_content": self.html_content, + "plain_content": self.plain_content, + "editor": self.editor, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -59,17 +59,16 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return PostCampaignsRequest( - title=payload.get('title'), - subject=payload.get('subject'), - sender_id=payload.get('sender_id'), - list_ids=payload.get('list_ids'), - segment_ids=payload.get('segment_ids'), - categories=payload.get('categories'), - suppression_group_id=payload.get('suppression_group_id'), - custom_unsubscribe_url=payload.get('custom_unsubscribe_url'), - ip_pool=payload.get('ip_pool'), - html_content=payload.get('html_content'), - plain_content=payload.get('plain_content'), - editor=payload.get('editor') - ) - + title=payload.get("title"), + subject=payload.get("subject"), + sender_id=payload.get("sender_id"), + list_ids=payload.get("list_ids"), + segment_ids=payload.get("segment_ids"), + categories=payload.get("categories"), + suppression_group_id=payload.get("suppression_group_id"), + custom_unsubscribe_url=payload.get("custom_unsubscribe_url"), + ip_pool=payload.get("ip_pool"), + html_content=payload.get("html_content"), + plain_content=payload.get("plain_content"), + editor=payload.get("editor"), + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/schedule_a_campaign_request.py b/sendgrid/rest/api/lmc_campaigns/v3/models/schedule_a_campaign_request.py index 0cf77010..cf709fc1 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/schedule_a_campaign_request.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/schedule_a_campaign_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ScheduleACampaignRequest: - def __init__( - self, - send_at: Optional[int]=None - ): - self.send_at=send_at + def __init__(self, send_at: Optional[int] = None): + self.send_at = send_at def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "send_at": self.send_at - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"send_at": self.send_at}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ScheduleACampaignRequest( - send_at=payload.get('send_at') - ) - + return ScheduleACampaignRequest(send_at=payload.get("send_at")) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/schedule_a_campaign_response.py b/sendgrid/rest/api/lmc_campaigns/v3/models/schedule_a_campaign_response.py index ef53bf6b..7f589138 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/schedule_a_campaign_response.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/schedule_a_campaign_response.py @@ -1,29 +1,29 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.lmc_campaigns.v3.models.status import Status - class ScheduleACampaignResponse: def __init__( - self, - id: Optional[int]=None, - send_at: Optional[int]=None, - status: Optional[Status]=None + self, + id: Optional[int] = None, + send_at: Optional[int] = None, + status: Optional[Status] = None, ): - self.id=id - self.send_at=send_at - self.status=status + self.id = id + self.send_at = send_at + self.status = status def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "send_at": self.send_at, - "status": self.status - }.items() if value is not None} + "id": self.id, + "send_at": self.send_at, + "status": self.status, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +32,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ScheduleACampaignResponse( - id=payload.get('id'), - send_at=payload.get('send_at'), - status=payload.get('status') - ) - + id=payload.get("id"), + send_at=payload.get("send_at"), + status=payload.get("status"), + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/send_a_campaign_response.py b/sendgrid/rest/api/lmc_campaigns/v3/models/send_a_campaign_response.py index c20d72c7..9f26feb5 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/send_a_campaign_response.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/send_a_campaign_response.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendACampaignResponse: - def __init__( - self, - id: Optional[int]=None, - status: Optional[str]=None - ): - self.id=id - self.status=status + def __init__(self, id: Optional[int] = None, status: Optional[str] = None): + self.id = id + self.status = status def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "id": self.id, - "status": self.status - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"id": self.id, "status": self.status}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -27,8 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SendACampaignResponse( - id=payload.get('id'), - status=payload.get('status') - ) - + return SendACampaignResponse(id=payload.get("id"), status=payload.get("status")) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/send_a_test_campaign_request.py b/sendgrid/rest/api/lmc_campaigns/v3/models/send_a_test_campaign_request.py index a9f69224..3eb50a0c 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/send_a_test_campaign_request.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/send_a_test_campaign_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendATestCampaignRequest: - def __init__( - self, - to: Optional[str]=None - ): - self.to=to + def __init__(self, to: Optional[str] = None): + self.to = to def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "to": self.to - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"to": self.to}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SendATestCampaignRequest( - to=payload.get('to') - ) - + return SendATestCampaignRequest(to=payload.get("to")) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/send_test_campaign_request.py b/sendgrid/rest/api/lmc_campaigns/v3/models/send_test_campaign_request.py index 59dde979..4eeb2dba 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/send_test_campaign_request.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/send_test_campaign_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendTestCampaignRequest: - def __init__( - self, - to: Optional[str]=None - ): - self.to=to + def __init__(self, to: Optional[str] = None): + self.to = to def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "to": self.to - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"to": self.to}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SendTestCampaignRequest( - to=payload.get('to') - ) - + return SendTestCampaignRequest(to=payload.get("to")) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/status.py b/sendgrid/rest/api/lmc_campaigns/v3/models/status.py index 3eb36965..4914fae8 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/status.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/status.py @@ -1,10 +1,6 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Status(Enum): - SCHEDULED='Scheduled' - + SCHEDULED = "Scheduled" diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/update_a_campaign_request.py b/sendgrid/rest/api/lmc_campaigns/v3/models/update_a_campaign_request.py index 718db97f..f162bbd2 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/update_a_campaign_request.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/update_a_campaign_request.py @@ -1,34 +1,34 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateACampaignRequest: def __init__( - self, - title: Optional[str]=None, - subject: Optional[str]=None, - categories: Optional[List[str]]=None, - html_content: Optional[str]=None, - plain_content: Optional[str]=None + self, + title: Optional[str] = None, + subject: Optional[str] = None, + categories: Optional[List[str]] = None, + html_content: Optional[str] = None, + plain_content: Optional[str] = None, ): - self.title=title - self.subject=subject - self.categories=categories - self.html_content=html_content - self.plain_content=plain_content + self.title = title + self.subject = subject + self.categories = categories + self.html_content = html_content + self.plain_content = plain_content def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "title": self.title, - "subject": self.subject, - "categories": self.categories, - "html_content": self.html_content, - "plain_content": self.plain_content - }.items() if value is not None} + "title": self.title, + "subject": self.subject, + "categories": self.categories, + "html_content": self.html_content, + "plain_content": self.plain_content, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -37,10 +37,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateACampaignRequest( - title=payload.get('title'), - subject=payload.get('subject'), - categories=payload.get('categories'), - html_content=payload.get('html_content'), - plain_content=payload.get('plain_content') - ) - + title=payload.get("title"), + subject=payload.get("subject"), + categories=payload.get("categories"), + html_content=payload.get("html_content"), + plain_content=payload.get("plain_content"), + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/update_a_scheduled_campaign_request.py b/sendgrid/rest/api/lmc_campaigns/v3/models/update_a_scheduled_campaign_request.py index 950571ba..ec66a56b 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/update_a_scheduled_campaign_request.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/update_a_scheduled_campaign_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateAScheduledCampaignRequest: - def __init__( - self, - send_at: Optional[int]=None - ): - self.send_at=send_at + def __init__(self, send_at: Optional[int] = None): + self.send_at = send_at def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "send_at": self.send_at - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"send_at": self.send_at}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateAScheduledCampaignRequest( - send_at=payload.get('send_at') - ) - + return UpdateAScheduledCampaignRequest(send_at=payload.get("send_at")) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/update_a_scheduled_campaign_response.py b/sendgrid/rest/api/lmc_campaigns/v3/models/update_a_scheduled_campaign_response.py index c93aa4fe..22fb4f7d 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/update_a_scheduled_campaign_response.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/update_a_scheduled_campaign_response.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateAScheduledCampaignResponse: def __init__( - self, - id: Optional[int]=None, - send_at: Optional[int]=None, - status: Optional[str]=None + self, + id: Optional[int] = None, + send_at: Optional[int] = None, + status: Optional[str] = None, ): - self.id=id - self.send_at=send_at - self.status=status + self.id = id + self.send_at = send_at + self.status = status def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "send_at": self.send_at, - "status": self.status - }.items() if value is not None} + "id": self.id, + "send_at": self.send_at, + "status": self.status, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateAScheduledCampaignResponse( - id=payload.get('id'), - send_at=payload.get('send_at'), - status=payload.get('status') - ) - + id=payload.get("id"), + send_at=payload.get("send_at"), + status=payload.get("status"), + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/models/view_scheduled_time_of_a_campaign_response.py b/sendgrid/rest/api/lmc_campaigns/v3/models/view_scheduled_time_of_a_campaign_response.py index 87306432..15372284 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/models/view_scheduled_time_of_a_campaign_response.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/models/view_scheduled_time_of_a_campaign_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ViewScheduledTimeOfACampaignResponse: - def __init__( - self, - send_at: Optional[int]=None - ): - self.send_at=send_at + def __init__(self, send_at: Optional[int] = None): + self.send_at = send_at def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "send_at": self.send_at - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"send_at": self.send_at}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ViewScheduledTimeOfACampaignResponse( - send_at=payload.get('send_at') - ) - + return ViewScheduledTimeOfACampaignResponse(send_at=payload.get("send_at")) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/schedule_campaign.py b/sendgrid/rest/api/lmc_campaigns/v3/schedule_campaign.py index 6eda892c..6c76cee5 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/schedule_campaign.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/schedule_campaign.py @@ -12,59 +12,58 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_campaigns.v3.models.schedule_a_campaign_request import ScheduleACampaignRequest -from sendgrid.rest.api.lmc_campaigns.v3.models.schedule_a_campaign_response import ScheduleACampaignResponse +from sendgrid.rest.api.lmc_campaigns.v3.models.schedule_a_campaign_request import ( + ScheduleACampaignRequest, +) + class ScheduleCampaign: def __init__(self, client) -> None: self.client = client - + def send( self, - campaign_id: int, - on_behalf_of: Optional[str] = None, - schedule_a_campaign_request: Optional[ScheduleACampaignRequest] = None, - + campaign_id: int, + on_behalf_of: Optional[str] = None, + schedule_a_campaign_request: Optional[ScheduleACampaignRequest] = None, ): - path='/v3/campaigns/{campaign_id}/schedules' + path = "/v3/campaigns/{campaign_id}/schedules" path = path.format( - campaign_id=campaign_id, + campaign_id=campaign_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if schedule_a_campaign_request: data = schedule_a_campaign_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/send_campaign.py b/sendgrid/rest/api/lmc_campaigns/v3/send_campaign.py index a9906db6..99448c65 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/send_campaign.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/send_campaign.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_campaigns.v3.models.send_a_campaign_response import SendACampaignResponse + class SendCampaign: def __init__(self, client) -> None: self.client = client - + def send( self, - campaign_id: int, - on_behalf_of: Optional[str] = None, - + campaign_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/campaigns/{campaign_id}/schedules/now' + path = "/v3/campaigns/{campaign_id}/schedules/now" path = path.format( - campaign_id=campaign_id, + campaign_id=campaign_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='POST', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/send_test_campaign.py b/sendgrid/rest/api/lmc_campaigns/v3/send_test_campaign.py index a850f676..5036694f 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/send_test_campaign.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/send_test_campaign.py @@ -12,59 +12,58 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_campaigns.v3.models.send_a_test_campaign_request import SendATestCampaignRequest -from sendgrid.rest.api.lmc_campaigns.v3.models.send_test_campaign_request import SendTestCampaignRequest +from sendgrid.rest.api.lmc_campaigns.v3.models.send_test_campaign_request import ( + SendTestCampaignRequest, +) + class SendTestCampaign: def __init__(self, client) -> None: self.client = client - + def send( self, - campaign_id: int, - on_behalf_of: Optional[str] = None, - send_test_campaign_request: Optional[SendTestCampaignRequest] = None, - + campaign_id: int, + on_behalf_of: Optional[str] = None, + send_test_campaign_request: Optional[SendTestCampaignRequest] = None, ): - path='/v3/campaigns/{campaign_id}/schedules/test' + path = "/v3/campaigns/{campaign_id}/schedules/test" path = path.format( - campaign_id=campaign_id, + campaign_id=campaign_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if send_test_campaign_request: data = send_test_campaign_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/un_schedule_campaign.py b/sendgrid/rest/api/lmc_campaigns/v3/un_schedule_campaign.py index 257b1714..c6846923 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/un_schedule_campaign.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/un_schedule_campaign.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated + class UnScheduleCampaign: def __init__(self, client) -> None: self.client = client - + def send( self, - campaign_id: int, - on_behalf_of: Optional[str] = None, - + campaign_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/campaigns/{campaign_id}/schedules' + path = "/v3/campaigns/{campaign_id}/schedules" path = path.format( - campaign_id=campaign_id, + campaign_id=campaign_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/update_campaign.py b/sendgrid/rest/api/lmc_campaigns/v3/update_campaign.py index 8ca78b6b..92f7d562 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/update_campaign.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/update_campaign.py @@ -12,59 +12,58 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_campaigns.v3.models.campaigns2xx import Campaigns2xx -from sendgrid.rest.api.lmc_campaigns.v3.models.update_a_campaign_request import UpdateACampaignRequest +from sendgrid.rest.api.lmc_campaigns.v3.models.update_a_campaign_request import ( + UpdateACampaignRequest, +) + class UpdateCampaign: def __init__(self, client) -> None: self.client = client - + def send( self, - campaign_id: int, - on_behalf_of: Optional[str] = None, - update_a_campaign_request: Optional[UpdateACampaignRequest] = None, - + campaign_id: int, + on_behalf_of: Optional[str] = None, + update_a_campaign_request: Optional[UpdateACampaignRequest] = None, ): - path='/v3/campaigns/{campaign_id}' + path = "/v3/campaigns/{campaign_id}" path = path.format( - campaign_id=campaign_id, + campaign_id=campaign_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_a_campaign_request: data = update_a_campaign_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_campaigns/v3/update_scheduled_campaign.py b/sendgrid/rest/api/lmc_campaigns/v3/update_scheduled_campaign.py index 92ab5d73..622ecc1f 100644 --- a/sendgrid/rest/api/lmc_campaigns/v3/update_scheduled_campaign.py +++ b/sendgrid/rest/api/lmc_campaigns/v3/update_scheduled_campaign.py @@ -12,59 +12,60 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_campaigns.v3.models.update_a_scheduled_campaign_request import UpdateAScheduledCampaignRequest -from sendgrid.rest.api.lmc_campaigns.v3.models.update_a_scheduled_campaign_response import UpdateAScheduledCampaignResponse +from sendgrid.rest.api.lmc_campaigns.v3.models.update_a_scheduled_campaign_request import ( + UpdateAScheduledCampaignRequest, +) + class UpdateScheduledCampaign: def __init__(self, client) -> None: self.client = client - + def send( self, - campaign_id: int, - on_behalf_of: Optional[str] = None, - update_a_scheduled_campaign_request: Optional[UpdateAScheduledCampaignRequest] = None, - + campaign_id: int, + on_behalf_of: Optional[str] = None, + update_a_scheduled_campaign_request: Optional[ + UpdateAScheduledCampaignRequest + ] = None, ): - path='/v3/campaigns/{campaign_id}/schedules' + path = "/v3/campaigns/{campaign_id}/schedules" path = path.format( - campaign_id=campaign_id, + campaign_id=campaign_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_a_scheduled_campaign_request: data = update_a_scheduled_campaign_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/__init__.py b/sendgrid/rest/api/lmc_contactdb/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/__init__.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/lmc_contactdb/v3/add_recipient.py b/sendgrid/rest/api/lmc_contactdb/v3/add_recipient.py index 5d909190..f75b75cb 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/add_recipient.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/add_recipient.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import List, Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import List, Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.add_recipient_request_inner import AddRecipientRequestInner -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient_response201 import ContactdbRecipientResponse201 +from sendgrid.rest.api.lmc_contactdb.v3.models.add_recipient_request_inner import ( + AddRecipientRequestInner, +) + class AddRecipient: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - add_recipient_request_inner: Optional[List[AddRecipientRequestInner]] = None, - + on_behalf_of: Optional[str] = None, + add_recipient_request_inner: Optional[List[AddRecipientRequestInner]] = None, ): - path='/v3/contactdb/recipients' + path = "/v3/contactdb/recipients" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if add_recipient_request_inner: data = add_recipient_request_inner.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/add_recipient_to_contact_db_list.py b/sendgrid/rest/api/lmc_contactdb/v3/add_recipient_to_contact_db_list.py index 3096e644..6238ff2a 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/add_recipient_to_contact_db_list.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/add_recipient_to_contact_db_list.py @@ -12,55 +12,53 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated + class AddRecipientToContactDbList: def __init__(self, client) -> None: self.client = client - + def send( self, - list_id: int, - recipient_id: str, - on_behalf_of: Optional[str] = None, - + list_id: int, + recipient_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/lists/{list_id}/recipients/{recipient_id}' + path = "/v3/contactdb/lists/{list_id}/recipients/{recipient_id}" path = path.format( - list_id=list_id, - recipient_id=recipient_id, + list_id=list_id, + recipient_id=recipient_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='POST', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/add_recipients_to_contact_db_list.py b/sendgrid/rest/api/lmc_contactdb/v3/add_recipients_to_contact_db_list.py index 4576163b..dd124cc7 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/add_recipients_to_contact_db_list.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/add_recipients_to_contact_db_list.py @@ -12,57 +12,55 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import List, Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import List, Optional -from typing_extensions import Annotated + class AddRecipientsToContactDbList: def __init__(self, client) -> None: self.client = client - + def send( self, - list_id: int, - on_behalf_of: Optional[str] = None, - request_body: Optional[List[str]] = None, - + list_id: int, + on_behalf_of: Optional[str] = None, + request_body: Optional[List[str]] = None, ): - path='/v3/contactdb/lists/{list_id}/recipients' + path = "/v3/contactdb/lists/{list_id}/recipients" path = path.format( - list_id=list_id, + list_id=list_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if request_body: data = request_body.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/create_contact_db_list.py b/sendgrid/rest/api/lmc_contactdb/v3/create_contact_db_list.py index 9e3010b5..16d5de03 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/create_contact_db_list.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/create_contact_db_list.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_list2xx import ContactdbList2xx -from sendgrid.rest.api.lmc_contactdb.v3.models.create_a_list_request import CreateAListRequest +from sendgrid.rest.api.lmc_contactdb.v3.models.create_a_list_request import ( + CreateAListRequest, +) + class CreateContactDbList: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - create_a_list_request: Optional[CreateAListRequest] = None, - + on_behalf_of: Optional[str] = None, + create_a_list_request: Optional[CreateAListRequest] = None, ): - path='/v3/contactdb/lists' + path = "/v3/contactdb/lists" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if create_a_list_request: data = create_a_list_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/create_custom_field.py b/sendgrid/rest/api/lmc_contactdb/v3/create_custom_field.py index e68fd083..5ce761c0 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/create_custom_field.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/create_custom_field.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_custom_field_id2xx import ContactdbCustomFieldId2xx -from sendgrid.rest.api.lmc_contactdb.v3.models.create_custom_field_request import CreateCustomFieldRequest +from sendgrid.rest.api.lmc_contactdb.v3.models.create_custom_field_request import ( + CreateCustomFieldRequest, +) + class CreateCustomField: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - create_custom_field_request: Optional[CreateCustomFieldRequest] = None, - + on_behalf_of: Optional[str] = None, + create_custom_field_request: Optional[CreateCustomFieldRequest] = None, ): - path='/v3/contactdb/custom_fields' + path = "/v3/contactdb/custom_fields" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if create_custom_field_request: data = create_custom_field_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/create_segment.py b/sendgrid/rest/api/lmc_contactdb/v3/create_segment.py index 0687ffb3..a36a5d7f 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/create_segment.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/create_segment.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments import ContactdbSegments -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments_id200 import ContactdbSegmentsId200 +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments import ( + ContactdbSegments, +) + class CreateSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - contactdb_segments: Optional[ContactdbSegments] = None, - + on_behalf_of: Optional[str] = None, + contactdb_segments: Optional[ContactdbSegments] = None, ): - path='/v3/contactdb/segments' + path = "/v3/contactdb/segments" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if contactdb_segments: data = contactdb_segments.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/delete_contact_db_list.py b/sendgrid/rest/api/lmc_contactdb/v3/delete_contact_db_list.py index 76dd4da1..ad4e8a3a 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/delete_contact_db_list.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/delete_contact_db_list.py @@ -12,59 +12,57 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr -from typing import Any, Optional -from typing_extensions import Annotated +from typing import Optional from sendgrid.rest.api.lmc_contactdb.v3.models.delete_contacts import DeleteContacts + class DeleteContactDbList: def __init__(self, client) -> None: self.client = client - + def send( self, - list_id: int, - on_behalf_of: Optional[str] = None, - delete_contacts: Optional[DeleteContacts] = None, - body: Optional[object] = None, - + list_id: int, + on_behalf_of: Optional[str] = None, + delete_contacts: Optional[DeleteContacts] = None, + body: Optional[object] = None, ): - path='/v3/contactdb/lists/{list_id}' + path = "/v3/contactdb/lists/{list_id}" path = path.format( - list_id=list_id, + list_id=list_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if body: data = body.to_dict() - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/delete_contact_db_lists.py b/sendgrid/rest/api/lmc_contactdb/v3/delete_contact_db_lists.py index 059a6f1e..c497e3be 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/delete_contact_db_lists.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/delete_contact_db_lists.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import List, Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import List, Optional -from typing_extensions import Annotated + class DeleteContactDbLists: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - request_body: Optional[List[int]] = None, - + on_behalf_of: Optional[str] = None, + request_body: Optional[List[int]] = None, ): - path='/v3/contactdb/lists' + path = "/v3/contactdb/lists" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if request_body: data = request_body.to_dict() - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/delete_custom_field.py b/sendgrid/rest/api/lmc_contactdb/v3/delete_custom_field.py index e36c2d61..f83d5db8 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/delete_custom_field.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/delete_custom_field.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.error_response import ErrorResponse + class DeleteCustomField: def __init__(self, client) -> None: self.client = client - + def send( self, - custom_field_id: int, - on_behalf_of: Optional[str] = None, - + custom_field_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/custom_fields/{custom_field_id}' + path = "/v3/contactdb/custom_fields/{custom_field_id}" path = path.format( - custom_field_id=custom_field_id, + custom_field_id=custom_field_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/delete_recipient.py b/sendgrid/rest/api/lmc_contactdb/v3/delete_recipient.py index b40da216..92e877f8 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/delete_recipient.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/delete_recipient.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteRecipient: def __init__(self, client) -> None: self.client = client - + def send( self, - recipient_id: str, - on_behalf_of: Optional[str] = None, - + recipient_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/recipients/{recipient_id}' + path = "/v3/contactdb/recipients/{recipient_id}" path = path.format( - recipient_id=recipient_id, + recipient_id=recipient_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/delete_recipient_from_contact_db_list.py b/sendgrid/rest/api/lmc_contactdb/v3/delete_recipient_from_contact_db_list.py index aa2d2960..23ca7c23 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/delete_recipient_from_contact_db_list.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/delete_recipient_from_contact_db_list.py @@ -12,59 +12,57 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr -from typing import Any, Optional -from typing_extensions import Annotated +from typing import Optional + class DeleteRecipientFromContactDbList: def __init__(self, client) -> None: self.client = client - + def send( self, - list_id: int, - recipient_id: str, - on_behalf_of: Optional[str] = None, - body: Optional[object] = None, - + list_id: int, + recipient_id: str, + on_behalf_of: Optional[str] = None, + body: Optional[object] = None, ): - path='/v3/contactdb/lists/{list_id}/recipients/{recipient_id}' + path = "/v3/contactdb/lists/{list_id}/recipients/{recipient_id}" path = path.format( - list_id=list_id, - recipient_id=recipient_id, + list_id=list_id, + recipient_id=recipient_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if body: data = body.to_dict() - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/delete_recipients.py b/sendgrid/rest/api/lmc_contactdb/v3/delete_recipients.py index 0f116f1c..96d629f9 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/delete_recipients.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/delete_recipients.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import List, Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import List, Optional -from typing_extensions import Annotated + class DeleteRecipients: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - request_body: Optional[List[str]] = None, - + on_behalf_of: Optional[str] = None, + request_body: Optional[List[str]] = None, ): - path='/v3/contactdb/recipients' + path = "/v3/contactdb/recipients" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if request_body: data = request_body.to_dict() - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/delete_segment.py b/sendgrid/rest/api/lmc_contactdb/v3/delete_segment.py index d00bb57d..dae2f7b4 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/delete_segment.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/delete_segment.py @@ -12,58 +12,56 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictInt, StrictStr -from typing import Any, Optional -from typing_extensions import Annotated +from typing import Optional + class DeleteSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - segment_id: int, - on_behalf_of: Optional[str] = None, - delete_contacts: Optional[bool] = None, - body: Optional[object] = None, - + segment_id: int, + on_behalf_of: Optional[str] = None, + delete_contacts: Optional[bool] = None, + body: Optional[object] = None, ): - path='/v3/contactdb/segments/{segment_id}' + path = "/v3/contactdb/segments/{segment_id}" path = path.format( - segment_id=segment_id, + segment_id=segment_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if body: data = body.to_dict() - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/get_billable.py b/sendgrid/rest/api/lmc_contactdb/v3/get_billable.py index 01b918ed..2aec4fb9 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/get_billable.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/get_billable.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient_count200 import ContactdbRecipientCount200 + class GetBillable: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/recipients/billable_count' + path = "/v3/contactdb/recipients/billable_count" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/get_contact_db_list.py b/sendgrid/rest/api/lmc_contactdb/v3/get_contact_db_list.py index 12a9a19b..7492692c 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/get_contact_db_list.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/get_contact_db_list.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_list2xx import ContactdbList2xx + class GetContactDbList: def __init__(self, client) -> None: self.client = client - + def send( self, - list_id: int, - on_behalf_of: Optional[str] = None, - + list_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/lists/{list_id}' + path = "/v3/contactdb/lists/{list_id}" path = path.format( - list_id=list_id, + list_id=list_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/get_custom_field.py b/sendgrid/rest/api/lmc_contactdb/v3/get_custom_field.py index f7642b1f..784cdea1 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/get_custom_field.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/get_custom_field.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_custom_field_id2xx import ContactdbCustomFieldId2xx + class GetCustomField: def __init__(self, client) -> None: self.client = client - + def send( self, - custom_field_id: int, - on_behalf_of: Optional[str] = None, - + custom_field_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/custom_fields/{custom_field_id}' + path = "/v3/contactdb/custom_fields/{custom_field_id}" path = path.format( - custom_field_id=custom_field_id, + custom_field_id=custom_field_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/get_recipient.py b/sendgrid/rest/api/lmc_contactdb/v3/get_recipient.py index 4c0b34da..8c3264da 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/get_recipient.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/get_recipient.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient200 import ContactdbRecipient200 + class GetRecipient: def __init__(self, client) -> None: self.client = client - + def send( self, - recipient_id: str, - on_behalf_of: Optional[str] = None, - + recipient_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/recipients/{recipient_id}' + path = "/v3/contactdb/recipients/{recipient_id}" path = path.format( - recipient_id=recipient_id, + recipient_id=recipient_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/get_recipient_list.py b/sendgrid/rest/api/lmc_contactdb/v3/get_recipient_list.py index b185ee2d..58dea3e4 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/get_recipient_list.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/get_recipient_list.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.get_recipient_list200_response import GetRecipientList200Response + class GetRecipientList: def __init__(self, client) -> None: self.client = client - + def send( self, - recipient_id: str, - on_behalf_of: Optional[str] = None, - + recipient_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/recipients/{recipient_id}/lists' + path = "/v3/contactdb/recipients/{recipient_id}/lists" path = path.format( - recipient_id=recipient_id, + recipient_id=recipient_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/get_segment.py b/sendgrid/rest/api/lmc_contactdb/v3/get_segment.py index 3968db80..54d69231 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/get_segment.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/get_segment.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments import ContactdbSegments + class GetSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - segment_id: int, - on_behalf_of: Optional[str] = None, - + segment_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/segments/{segment_id}' + path = "/v3/contactdb/segments/{segment_id}" path = path.format( - segment_id=segment_id, + segment_id=segment_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/list_contact_db_list.py b/sendgrid/rest/api/lmc_contactdb/v3/list_contact_db_list.py index 2a0731e7..e5edfd46 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/list_contact_db_list.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/list_contact_db_list.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.list_all_lists_response import ListAllListsResponse + class ListContactDbList: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/lists' + path = "/v3/contactdb/lists" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/list_custom_field.py b/sendgrid/rest/api/lmc_contactdb/v3/list_custom_field.py index c20933fe..5ac689fc 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/list_custom_field.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/list_custom_field.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.list_all_custom_fields_response import ListAllCustomFieldsResponse + class ListCustomField: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/custom_fields' + path = "/v3/contactdb/custom_fields" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/list_recipient.py b/sendgrid/rest/api/lmc_contactdb/v3/list_recipient.py index ea7c5078..686e81ad 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/list_recipient.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/list_recipient.py @@ -12,52 +12,49 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.list_recipients_response import ListRecipientsResponse + class ListRecipient: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - page: Optional[int] = None, - page_size: Optional[int] = None, - + on_behalf_of: Optional[str] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, ): - path='/v3/contactdb/recipients' + path = "/v3/contactdb/recipients" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/list_recipient_count.py b/sendgrid/rest/api/lmc_contactdb/v3/list_recipient_count.py index cba3e7ba..2efea749 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/list_recipient_count.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/list_recipient_count.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient_count200 import ContactdbRecipientCount200 + class ListRecipientCount: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/recipients/count' + path = "/v3/contactdb/recipients/count" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/list_recipient_for_segment.py b/sendgrid/rest/api/lmc_contactdb/v3/list_recipient_for_segment.py index fc3d4662..9de8061c 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/list_recipient_for_segment.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/list_recipient_for_segment.py @@ -12,56 +12,53 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.list_recipients_on_a_segment_response import ListRecipientsOnASegmentResponse + class ListRecipientForSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - segment_id: int, - on_behalf_of: Optional[str] = None, - page: Optional[int] = None, - page_size: Optional[int] = None, - + segment_id: int, + on_behalf_of: Optional[str] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, ): - path='/v3/contactdb/segments/{segment_id}/recipients' + path = "/v3/contactdb/segments/{segment_id}/recipients" path = path.format( - segment_id=segment_id, + segment_id=segment_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/list_recipients_from_contact_db_list.py b/sendgrid/rest/api/lmc_contactdb/v3/list_recipients_from_contact_db_list.py index 2db41939..e393c8f1 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/list_recipients_from_contact_db_list.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/list_recipients_from_contact_db_list.py @@ -12,56 +12,53 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.list_recipients_from_contact_db_list200_response import ListRecipientsFromContactDbList200Response + class ListRecipientsFromContactDbList: def __init__(self, client) -> None: self.client = client - + def send( self, - list_id: int, - on_behalf_of: Optional[str] = None, - page: Optional[int] = None, - page_size: Optional[int] = None, - + list_id: int, + on_behalf_of: Optional[str] = None, + page: Optional[int] = None, + page_size: Optional[int] = None, ): - path='/v3/contactdb/lists/{list_id}/recipients' + path = "/v3/contactdb/lists/{list_id}/recipients" path = path.format( - list_id=list_id, + list_id=list_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/list_reserved_field.py b/sendgrid/rest/api/lmc_contactdb/v3/list_reserved_field.py index 69e25def..a2cbae21 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/list_reserved_field.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/list_reserved_field.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.list_reserved_field200_response import ListReservedField200Response + class ListReservedField: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/reserved_fields' + path = "/v3/contactdb/reserved_fields" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/list_search_recipient.py b/sendgrid/rest/api/lmc_contactdb/v3/list_search_recipient.py index 9058fcc5..7aa4019f 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/list_search_recipient.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/list_search_recipient.py @@ -12,51 +12,48 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.list_recipients_from_contact_db_list200_response import ListRecipientsFromContactDbList200Response + class ListSearchRecipient: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - field_name: Optional[str] = None, - + on_behalf_of: Optional[str] = None, + field_name: Optional[str] = None, ): - path='/v3/contactdb/recipients/search' + path = "/v3/contactdb/recipients/search" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/list_segment.py b/sendgrid/rest/api/lmc_contactdb/v3/list_segment.py index 046e3dbf..0506551a 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/list_segment.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/list_segment.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.list_all_segments_response import ListAllSegmentsResponse + class ListSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/segments' + path = "/v3/contactdb/segments" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/list_status.py b/sendgrid/rest/api/lmc_contactdb/v3/list_status.py index bd6699e1..96d7f499 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/list_status.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/list_status.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.list_status200_response import ListStatus200Response + class ListStatus: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/contactdb/status' + path = "/v3/contactdb/status" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/__init__.py b/sendgrid/rest/api/lmc_contactdb/v3/models/__init__.py index af598815..f47992fb 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/__init__.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/__init__.py @@ -11,48 +11,160 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.lmc_contactdb.v3.models.add_recipient_request_inner import AddRecipientRequestInner +from sendgrid.rest.api.lmc_contactdb.v3.models.add_recipient_request_inner import ( + AddRecipientRequestInner, +) from sendgrid.rest.api.lmc_contactdb.v3.models.and_or import AndOr -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_custom_field import ContactdbCustomField -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_custom_field_id2xx import ContactdbCustomFieldId2xx -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_custom_field_id_value import ContactdbCustomFieldIdValue +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_custom_field import ( + ContactdbCustomField, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_custom_field_id2xx import ( + ContactdbCustomFieldId2xx, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_custom_field_id_value import ( + ContactdbCustomFieldIdValue, +) from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_list2xx import ContactdbList2xx -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient200 import ContactdbRecipient200 -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient200_recipients_inner import ContactdbRecipient200RecipientsInner -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient_count200 import ContactdbRecipientCount200 -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient_response201 import ContactdbRecipientResponse201 -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient_response201_errors_inner import ContactdbRecipientResponse201ErrorsInner -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments import ContactdbSegments -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments_conditions import ContactdbSegmentsConditions -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments_id200 import ContactdbSegmentsId200 -from sendgrid.rest.api.lmc_contactdb.v3.models.create_a_list_request import CreateAListRequest -from sendgrid.rest.api.lmc_contactdb.v3.models.create_custom_field_request import CreateCustomFieldRequest +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient200 import ( + ContactdbRecipient200, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient200_recipients_inner import ( + ContactdbRecipient200RecipientsInner, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient_count200 import ( + ContactdbRecipientCount200, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient_response201 import ( + ContactdbRecipientResponse201, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient_response201_errors_inner import ( + ContactdbRecipientResponse201ErrorsInner, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments import ( + ContactdbSegments, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments_conditions import ( + ContactdbSegmentsConditions, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments_id200 import ( + ContactdbSegmentsId200, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.create_a_list_request import ( + CreateAListRequest, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.create_custom_field_request import ( + CreateCustomFieldRequest, +) from sendgrid.rest.api.lmc_contactdb.v3.models.delete_contacts import DeleteContacts from sendgrid.rest.api.lmc_contactdb.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.lmc_contactdb.v3.models.error_response_errors_inner import ErrorResponseErrorsInner -from sendgrid.rest.api.lmc_contactdb.v3.models.get_recipient_list200_response import GetRecipientList200Response -from sendgrid.rest.api.lmc_contactdb.v3.models.list_all_custom_fields_response import ListAllCustomFieldsResponse -from sendgrid.rest.api.lmc_contactdb.v3.models.list_all_lists_response import ListAllListsResponse -from sendgrid.rest.api.lmc_contactdb.v3.models.list_all_segments_response import ListAllSegmentsResponse -from sendgrid.rest.api.lmc_contactdb.v3.models.list_recipients_from_contact_db_list200_response import ListRecipientsFromContactDbList200Response -from sendgrid.rest.api.lmc_contactdb.v3.models.list_recipients_on_a_segment_response import ListRecipientsOnASegmentResponse -from sendgrid.rest.api.lmc_contactdb.v3.models.list_recipients_response import ListRecipientsResponse -from sendgrid.rest.api.lmc_contactdb.v3.models.list_reserved_field200_response import ListReservedField200Response -from sendgrid.rest.api.lmc_contactdb.v3.models.list_reserved_field200_response_reserved_fields_inner import ListReservedField200ResponseReservedFieldsInner -from sendgrid.rest.api.lmc_contactdb.v3.models.list_status200_response import ListStatus200Response -from sendgrid.rest.api.lmc_contactdb.v3.models.list_status200_response_status_inner import ListStatus200ResponseStatusInner +from sendgrid.rest.api.lmc_contactdb.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.get_recipient_list200_response import ( + GetRecipientList200Response, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.list_all_custom_fields_response import ( + ListAllCustomFieldsResponse, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.list_all_lists_response import ( + ListAllListsResponse, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.list_all_segments_response import ( + ListAllSegmentsResponse, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.list_recipients_from_contact_db_list200_response import ( + ListRecipientsFromContactDbList200Response, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.list_recipients_on_a_segment_response import ( + ListRecipientsOnASegmentResponse, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.list_recipients_response import ( + ListRecipientsResponse, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.list_reserved_field200_response import ( + ListReservedField200Response, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.list_reserved_field200_response_reserved_fields_inner import ( + ListReservedField200ResponseReservedFieldsInner, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.list_status200_response import ( + ListStatus200Response, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.list_status200_response_status_inner import ( + ListStatus200ResponseStatusInner, +) from sendgrid.rest.api.lmc_contactdb.v3.models.operator import Operator -from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response import SearchRecipient200Response -from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response_recipients_inner import SearchRecipient200ResponseRecipientsInner -from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response_recipients_inner_custom_fields_inner import SearchRecipient200ResponseRecipientsInnerCustomFieldsInner -from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response_recipients_inner_custom_fields_inner_value import SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue -from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient_request import SearchRecipientRequest +from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response import ( + SearchRecipient200Response, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response_recipients_inner import ( + SearchRecipient200ResponseRecipientsInner, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response_recipients_inner_custom_fields_inner import ( + SearchRecipient200ResponseRecipientsInnerCustomFieldsInner, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response_recipients_inner_custom_fields_inner_value import ( + SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient_request import ( + SearchRecipientRequest, +) from sendgrid.rest.api.lmc_contactdb.v3.models.type import Type -from sendgrid.rest.api.lmc_contactdb.v3.models.update_a_list_request import UpdateAListRequest -from sendgrid.rest.api.lmc_contactdb.v3.models.update_contact_db_list200_response import UpdateContactDbList200Response -from sendgrid.rest.api.lmc_contactdb.v3.models.update_recipient_request_inner import UpdateRecipientRequestInner -from sendgrid.rest.api.lmc_contactdb.v3.models.update_segment_request import UpdateSegmentRequest -__all__ = [ 'AddRecipientRequestInner', 'AndOr', 'ContactdbCustomField', 'ContactdbCustomFieldId2xx', 'ContactdbCustomFieldIdValue', 'ContactdbList2xx', 'ContactdbRecipient200', 'ContactdbRecipient200RecipientsInner', 'ContactdbRecipientCount200', 'ContactdbRecipientResponse201', 'ContactdbRecipientResponse201ErrorsInner', 'ContactdbSegments', 'ContactdbSegmentsConditions', 'ContactdbSegmentsId200', 'CreateAListRequest', 'CreateCustomFieldRequest', 'DeleteContacts', 'ErrorResponse', 'ErrorResponseErrorsInner', 'GetRecipientList200Response', 'ListAllCustomFieldsResponse', 'ListAllListsResponse', 'ListAllSegmentsResponse', 'ListRecipientsFromContactDbList200Response', 'ListRecipientsOnASegmentResponse', 'ListRecipientsResponse', 'ListReservedField200Response', 'ListReservedField200ResponseReservedFieldsInner', 'ListStatus200Response', 'ListStatus200ResponseStatusInner', 'Operator', 'SearchRecipient200Response', 'SearchRecipient200ResponseRecipientsInner', 'SearchRecipient200ResponseRecipientsInnerCustomFieldsInner', 'SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue', 'SearchRecipientRequest', 'Type', 'UpdateAListRequest', 'UpdateContactDbList200Response', 'UpdateRecipientRequestInner', 'UpdateSegmentRequest' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.lmc_contactdb.v3.models.update_a_list_request import ( + UpdateAListRequest, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.update_contact_db_list200_response import ( + UpdateContactDbList200Response, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.update_recipient_request_inner import ( + UpdateRecipientRequestInner, +) +from sendgrid.rest.api.lmc_contactdb.v3.models.update_segment_request import ( + UpdateSegmentRequest, +) + +__all__ = [ + "AddRecipientRequestInner", + "AndOr", + "ContactdbCustomField", + "ContactdbCustomFieldId2xx", + "ContactdbCustomFieldIdValue", + "ContactdbList2xx", + "ContactdbRecipient200", + "ContactdbRecipient200RecipientsInner", + "ContactdbRecipientCount200", + "ContactdbRecipientResponse201", + "ContactdbRecipientResponse201ErrorsInner", + "ContactdbSegments", + "ContactdbSegmentsConditions", + "ContactdbSegmentsId200", + "CreateAListRequest", + "CreateCustomFieldRequest", + "DeleteContacts", + "ErrorResponse", + "ErrorResponseErrorsInner", + "GetRecipientList200Response", + "ListAllCustomFieldsResponse", + "ListAllListsResponse", + "ListAllSegmentsResponse", + "ListRecipientsFromContactDbList200Response", + "ListRecipientsOnASegmentResponse", + "ListRecipientsResponse", + "ListReservedField200Response", + "ListReservedField200ResponseReservedFieldsInner", + "ListStatus200Response", + "ListStatus200ResponseStatusInner", + "Operator", + "SearchRecipient200Response", + "SearchRecipient200ResponseRecipientsInner", + "SearchRecipient200ResponseRecipientsInnerCustomFieldsInner", + "SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue", + "SearchRecipientRequest", + "Type", + "UpdateAListRequest", + "UpdateContactDbList200Response", + "UpdateRecipientRequestInner", + "UpdateSegmentRequest", +] +# Testing code diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/add_recipient_request_inner.py b/sendgrid/rest/api/lmc_contactdb/v3/models/add_recipient_request_inner.py index 60141b17..8e502523 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/add_recipient_request_inner.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/add_recipient_request_inner.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AddRecipientRequestInner: def __init__( - self, - email: Optional[str]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - age: Optional[int]=None + self, + email: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + age: Optional[int] = None, ): - self.email=email - self.first_name=first_name - self.last_name=last_name - self.age=age + self.email = email + self.first_name = first_name + self.last_name = last_name + self.age = age def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "email": self.email, - "first_name": self.first_name, - "last_name": self.last_name, - "age": self.age - }.items() if value is not None} + "email": self.email, + "first_name": self.first_name, + "last_name": self.last_name, + "age": self.age, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AddRecipientRequestInner( - email=payload.get('email'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - age=payload.get('age') - ) - + email=payload.get("email"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + age=payload.get("age"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/and_or.py b/sendgrid/rest/api/lmc_contactdb/v3/models/and_or.py index 4954d741..1d8c2651 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/and_or.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/and_or.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class AndOr(Enum): - AND='and' - OR='or' - EMPTY='' - + AND = "and" + OR = "or" + EMPTY = "" diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_custom_field.py b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_custom_field.py index 7d3eb0e9..43f26b87 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_custom_field.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_custom_field.py @@ -1,26 +1,19 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.lmc_contactdb.v3.models.type import Type - class ContactdbCustomField: - def __init__( - self, - name: Optional[str]=None, - type: Optional[Type]=None - ): - self.name=name - self.type=type + def __init__(self, name: Optional[str] = None, type: Optional[Type] = None): + self.name = name + self.type = type def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name, - "type": self.type - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name, "type": self.type}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +21,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ContactdbCustomField( - name=payload.get('name'), - type=payload.get('type') - ) - + return ContactdbCustomField(name=payload.get("name"), type=payload.get("type")) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_custom_field_id2xx.py b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_custom_field_id2xx.py index e9b395f0..4ca8281f 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_custom_field_id2xx.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_custom_field_id2xx.py @@ -1,29 +1,29 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.lmc_contactdb.v3.models.type import Type - class ContactdbCustomFieldId2xx: def __init__( - self, - name: Optional[str]=None, - type: Optional[Type]=None, - id: Optional[float]=None + self, + name: Optional[str] = None, + type: Optional[Type] = None, + id: Optional[float] = None, ): - self.name=name - self.type=type - self.id=id + self.name = name + self.type = type + self.id = id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "type": self.type, - "id": self.id - }.items() if value is not None} + "name": self.name, + "type": self.type, + "id": self.id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +32,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactdbCustomFieldId2xx( - name=payload.get('name'), - type=payload.get('type'), - id=payload.get('id') - ) - + name=payload.get("name"), type=payload.get("type"), id=payload.get("id") + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_custom_field_id_value.py b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_custom_field_id_value.py index 20262c32..f7b5ac5d 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_custom_field_id_value.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_custom_field_id_value.py @@ -1,32 +1,32 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.lmc_contactdb.v3.models.type import Type - class ContactdbCustomFieldIdValue: def __init__( - self, - name: Optional[str]=None, - type: Optional[Type]=None, - id: Optional[float]=None, - value: Optional[str]=None + self, + name: Optional[str] = None, + type: Optional[Type] = None, + id: Optional[float] = None, + value: Optional[str] = None, ): - self.name=name - self.type=type - self.id=id - self.value=value + self.name = name + self.type = type + self.id = id + self.value = value def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "type": self.type, - "id": self.id, - "value": self.value - }.items() if value is not None} + "name": self.name, + "type": self.type, + "id": self.id, + "value": self.value, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -35,9 +35,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactdbCustomFieldIdValue( - name=payload.get('name'), - type=payload.get('type'), - id=payload.get('id'), - value=payload.get('value') - ) - + name=payload.get("name"), + type=payload.get("type"), + id=payload.get("id"), + value=payload.get("value"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_list2xx.py b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_list2xx.py index 9ccfbbca..6c342bad 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_list2xx.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_list2xx.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ContactdbList2xx: def __init__( - self, - id: Optional[int]=None, - name: Optional[str]=None, - recipient_count: Optional[int]=None + self, + id: Optional[int] = None, + name: Optional[str] = None, + recipient_count: Optional[int] = None, ): - self.id=id - self.name=name - self.recipient_count=recipient_count + self.id = id + self.name = name + self.recipient_count = recipient_count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "name": self.name, - "recipient_count": self.recipient_count - }.items() if value is not None} + "id": self.id, + "name": self.name, + "recipient_count": self.recipient_count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactdbList2xx( - id=payload.get('id'), - name=payload.get('name'), - recipient_count=payload.get('recipient_count') - ) - + id=payload.get("id"), + name=payload.get("name"), + recipient_count=payload.get("recipient_count"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient200.py b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient200.py index 70d6c4c9..79378276 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient200.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient200.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient200_recipients_inner import ContactdbRecipient200RecipientsInner - +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient200_recipients_inner import ( + ContactdbRecipient200RecipientsInner, +) class ContactdbRecipient200: def __init__( - self, - recipients: Optional[List[ContactdbRecipient200RecipientsInner]]=None + self, recipients: Optional[List[ContactdbRecipient200RecipientsInner]] = None ): - self.recipients=recipients + self.recipients = recipients def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "recipients": self.recipients - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"recipients": self.recipients}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ContactdbRecipient200( - recipients=payload.get('recipients') - ) - + return ContactdbRecipient200(recipients=payload.get("recipients")) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient200_recipients_inner.py b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient200_recipients_inner.py index 99dfdaa0..d6d284b0 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient200_recipients_inner.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient200_recipients_inner.py @@ -1,50 +1,52 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_custom_field_id_value import ContactdbCustomFieldIdValue - +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_custom_field_id_value import ( + ContactdbCustomFieldIdValue, +) class ContactdbRecipient200RecipientsInner: def __init__( - self, - id: Optional[str]=None, - created_at: Optional[float]=None, - custom_fields: Optional[List[ContactdbCustomFieldIdValue]]=None, - email: Optional[str]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - last_clicked: Optional[float]=None, - last_emailed: Optional[float]=None, - last_opened: Optional[float]=None, - updated_at: Optional[float]=None + self, + id: Optional[str] = None, + created_at: Optional[float] = None, + custom_fields: Optional[List[ContactdbCustomFieldIdValue]] = None, + email: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + last_clicked: Optional[float] = None, + last_emailed: Optional[float] = None, + last_opened: Optional[float] = None, + updated_at: Optional[float] = None, ): - self.id=id - self.created_at=created_at - self.custom_fields=custom_fields - self.email=email - self.first_name=first_name - self.last_name=last_name - self.last_clicked=last_clicked - self.last_emailed=last_emailed - self.last_opened=last_opened - self.updated_at=updated_at + self.id = id + self.created_at = created_at + self.custom_fields = custom_fields + self.email = email + self.first_name = first_name + self.last_name = last_name + self.last_clicked = last_clicked + self.last_emailed = last_emailed + self.last_opened = last_opened + self.updated_at = updated_at def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "created_at": self.created_at, - "custom_fields": self.custom_fields, - "email": self.email, - "first_name": self.first_name, - "last_name": self.last_name, - "last_clicked": self.last_clicked, - "last_emailed": self.last_emailed, - "last_opened": self.last_opened, - "updated_at": self.updated_at - }.items() if value is not None} + "id": self.id, + "created_at": self.created_at, + "custom_fields": self.custom_fields, + "email": self.email, + "first_name": self.first_name, + "last_name": self.last_name, + "last_clicked": self.last_clicked, + "last_emailed": self.last_emailed, + "last_opened": self.last_opened, + "updated_at": self.updated_at, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -53,15 +55,14 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactdbRecipient200RecipientsInner( - id=payload.get('id'), - created_at=payload.get('created_at'), - custom_fields=payload.get('custom_fields'), - email=payload.get('email'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - last_clicked=payload.get('last_clicked'), - last_emailed=payload.get('last_emailed'), - last_opened=payload.get('last_opened'), - updated_at=payload.get('updated_at') - ) - + id=payload.get("id"), + created_at=payload.get("created_at"), + custom_fields=payload.get("custom_fields"), + email=payload.get("email"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + last_clicked=payload.get("last_clicked"), + last_emailed=payload.get("last_emailed"), + last_opened=payload.get("last_opened"), + updated_at=payload.get("updated_at"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient_count200.py b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient_count200.py index 892d6fbe..fe20e309 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient_count200.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient_count200.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ContactdbRecipientCount200: - def __init__( - self, - recipient_count: Optional[float]=None - ): - self.recipient_count=recipient_count + def __init__(self, recipient_count: Optional[float] = None): + self.recipient_count = recipient_count def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "recipient_count": self.recipient_count - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"recipient_count": self.recipient_count}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,6 +20,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactdbRecipientCount200( - recipient_count=payload.get('recipient_count') - ) - + recipient_count=payload.get("recipient_count") + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient_response201.py b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient_response201.py index 32f7ac7b..bd842632 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient_response201.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient_response201.py @@ -1,38 +1,40 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient_response201_errors_inner import ContactdbRecipientResponse201ErrorsInner - +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient_response201_errors_inner import ( + ContactdbRecipientResponse201ErrorsInner, +) class ContactdbRecipientResponse201: def __init__( - self, - error_count: Optional[float]=None, - error_indices: Optional[List[float]]=None, - new_count: Optional[float]=None, - persisted_recipients: Optional[List[str]]=None, - updated_count: Optional[float]=None, - errors: Optional[List[ContactdbRecipientResponse201ErrorsInner]]=None + self, + error_count: Optional[float] = None, + error_indices: Optional[List[float]] = None, + new_count: Optional[float] = None, + persisted_recipients: Optional[List[str]] = None, + updated_count: Optional[float] = None, + errors: Optional[List[ContactdbRecipientResponse201ErrorsInner]] = None, ): - self.error_count=error_count - self.error_indices=error_indices - self.new_count=new_count - self.persisted_recipients=persisted_recipients - self.updated_count=updated_count - self.errors=errors + self.error_count = error_count + self.error_indices = error_indices + self.new_count = new_count + self.persisted_recipients = persisted_recipients + self.updated_count = updated_count + self.errors = errors def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "error_count": self.error_count, - "error_indices": self.error_indices, - "new_count": self.new_count, - "persisted_recipients": self.persisted_recipients, - "updated_count": self.updated_count, - "errors": self.errors - }.items() if value is not None} + "error_count": self.error_count, + "error_indices": self.error_indices, + "new_count": self.new_count, + "persisted_recipients": self.persisted_recipients, + "updated_count": self.updated_count, + "errors": self.errors, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -41,11 +43,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactdbRecipientResponse201( - error_count=payload.get('error_count'), - error_indices=payload.get('error_indices'), - new_count=payload.get('new_count'), - persisted_recipients=payload.get('persisted_recipients'), - updated_count=payload.get('updated_count'), - errors=payload.get('errors') - ) - + error_count=payload.get("error_count"), + error_indices=payload.get("error_indices"), + new_count=payload.get("new_count"), + persisted_recipients=payload.get("persisted_recipients"), + updated_count=payload.get("updated_count"), + errors=payload.get("errors"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient_response201_errors_inner.py b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient_response201_errors_inner.py index a05ade61..582d3a84 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient_response201_errors_inner.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_recipient_response201_errors_inner.py @@ -1,25 +1,23 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ContactdbRecipientResponse201ErrorsInner: def __init__( - self, - message: Optional[str]=None, - error_indices: Optional[List[float]]=None + self, message: Optional[str] = None, error_indices: Optional[List[float]] = None ): - self.message=message - self.error_indices=error_indices + self.message = message + self.error_indices = error_indices def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "error_indices": self.error_indices - }.items() if value is not None} + "message": self.message, + "error_indices": self.error_indices, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +26,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactdbRecipientResponse201ErrorsInner( - message=payload.get('message'), - error_indices=payload.get('error_indices') - ) - + message=payload.get("message"), error_indices=payload.get("error_indices") + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_segments.py b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_segments.py index 897f38ae..23b980cb 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_segments.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_segments.py @@ -1,32 +1,34 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments_conditions import ContactdbSegmentsConditions - +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments_conditions import ( + ContactdbSegmentsConditions, +) class ContactdbSegments: def __init__( - self, - name: Optional[str]=None, - list_id: Optional[int]=None, - conditions: Optional[List[ContactdbSegmentsConditions]]=None, - recipient_count: Optional[float]=None + self, + name: Optional[str] = None, + list_id: Optional[int] = None, + conditions: Optional[List[ContactdbSegmentsConditions]] = None, + recipient_count: Optional[float] = None, ): - self.name=name - self.list_id=list_id - self.conditions=conditions - self.recipient_count=recipient_count + self.name = name + self.list_id = list_id + self.conditions = conditions + self.recipient_count = recipient_count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "list_id": self.list_id, - "conditions": self.conditions, - "recipient_count": self.recipient_count - }.items() if value is not None} + "name": self.name, + "list_id": self.list_id, + "conditions": self.conditions, + "recipient_count": self.recipient_count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -35,9 +37,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactdbSegments( - name=payload.get('name'), - list_id=payload.get('list_id'), - conditions=payload.get('conditions'), - recipient_count=payload.get('recipient_count') - ) - + name=payload.get("name"), + list_id=payload.get("list_id"), + conditions=payload.get("conditions"), + recipient_count=payload.get("recipient_count"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_segments_conditions.py b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_segments_conditions.py index fa362a63..37ef070c 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_segments_conditions.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_segments_conditions.py @@ -1,33 +1,33 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.lmc_contactdb.v3.models.and_or import AndOr from sendgrid.rest.api.lmc_contactdb.v3.models.operator import Operator - class ContactdbSegmentsConditions: def __init__( - self, - field: Optional[str]=None, - value: Optional[str]=None, - operator: Optional[Operator]=None, - and_or: Optional[AndOr]=None + self, + field: Optional[str] = None, + value: Optional[str] = None, + operator: Optional[Operator] = None, + and_or: Optional[AndOr] = None, ): - self.field=field - self.value=value - self.operator=operator - self.and_or=and_or + self.field = field + self.value = value + self.operator = operator + self.and_or = and_or def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "field": self.field, - "value": self.value, - "operator": self.operator, - "and_or": self.and_or - }.items() if value is not None} + "field": self.field, + "value": self.value, + "operator": self.operator, + "and_or": self.and_or, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -36,9 +36,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactdbSegmentsConditions( - field=payload.get('field'), - value=payload.get('value'), - operator=payload.get('operator'), - and_or=payload.get('and_or') - ) - + field=payload.get("field"), + value=payload.get("value"), + operator=payload.get("operator"), + and_or=payload.get("and_or"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_segments_id200.py b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_segments_id200.py index fdb4563d..6c34fa7b 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_segments_id200.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/contactdb_segments_id200.py @@ -1,35 +1,37 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments_conditions import ContactdbSegmentsConditions - +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments_conditions import ( + ContactdbSegmentsConditions, +) class ContactdbSegmentsId200: def __init__( - self, - id: Optional[float]=None, - name: Optional[str]=None, - list_id: Optional[int]=None, - conditions: Optional[List[ContactdbSegmentsConditions]]=None, - recipient_count: Optional[float]=None + self, + id: Optional[float] = None, + name: Optional[str] = None, + list_id: Optional[int] = None, + conditions: Optional[List[ContactdbSegmentsConditions]] = None, + recipient_count: Optional[float] = None, ): - self.id=id - self.name=name - self.list_id=list_id - self.conditions=conditions - self.recipient_count=recipient_count + self.id = id + self.name = name + self.list_id = list_id + self.conditions = conditions + self.recipient_count = recipient_count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "name": self.name, - "list_id": self.list_id, - "conditions": self.conditions, - "recipient_count": self.recipient_count - }.items() if value is not None} + "id": self.id, + "name": self.name, + "list_id": self.list_id, + "conditions": self.conditions, + "recipient_count": self.recipient_count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -38,10 +40,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactdbSegmentsId200( - id=payload.get('id'), - name=payload.get('name'), - list_id=payload.get('list_id'), - conditions=payload.get('conditions'), - recipient_count=payload.get('recipient_count') - ) - + id=payload.get("id"), + name=payload.get("name"), + list_id=payload.get("list_id"), + conditions=payload.get("conditions"), + recipient_count=payload.get("recipient_count"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/create_a_list_request.py b/sendgrid/rest/api/lmc_contactdb/v3/models/create_a_list_request.py index 66663821..313a984b 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/create_a_list_request.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/create_a_list_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateAListRequest: - def __init__( - self, - name: Optional[str]=None - ): - self.name=name + def __init__(self, name: Optional[str] = None): + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return CreateAListRequest( - name=payload.get('name') - ) - + return CreateAListRequest(name=payload.get("name")) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/create_custom_field_request.py b/sendgrid/rest/api/lmc_contactdb/v3/models/create_custom_field_request.py index b3e810ce..148d0890 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/create_custom_field_request.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/create_custom_field_request.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateCustomFieldRequest: - def __init__( - self, - name: Optional[str]=None, - type: Optional[str]=None - ): - self.name=name - self.type=type + def __init__(self, name: Optional[str] = None, type: Optional[str] = None): + self.name = name + self.type = type def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name, - "type": self.type - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name, "type": self.type}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateCustomFieldRequest( - name=payload.get('name'), - type=payload.get('type') - ) - + name=payload.get("name"), type=payload.get("type") + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/error_response.py b/sendgrid/rest/api/lmc_contactdb/v3/models/error_response.py index 0b83c520..d87370ef 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/error_response.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.lmc_contactdb.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/lmc_contactdb/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/get_recipient_list200_response.py b/sendgrid/rest/api/lmc_contactdb/v3/models/get_recipient_list200_response.py index 6d90c229..b10f666d 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/get_recipient_list200_response.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/get_recipient_list200_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_list2xx import ContactdbList2xx - class GetRecipientList200Response: - def __init__( - self, - lists: Optional[List[ContactdbList2xx]]=None - ): - self.lists=lists + def __init__(self, lists: Optional[List[ContactdbList2xx]] = None): + self.lists = lists def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "lists": self.lists - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"lists": self.lists}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetRecipientList200Response( - lists=payload.get('lists') - ) - + return GetRecipientList200Response(lists=payload.get("lists")) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/list_all_custom_fields_response.py b/sendgrid/rest/api/lmc_contactdb/v3/models/list_all_custom_fields_response.py index f2c6b81d..b6d5f170 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/list_all_custom_fields_response.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/list_all_custom_fields_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_custom_field_id2xx import ContactdbCustomFieldId2xx - +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_custom_field_id2xx import ( + ContactdbCustomFieldId2xx, +) class ListAllCustomFieldsResponse: - def __init__( - self, - custom_fields: Optional[List[ContactdbCustomFieldId2xx]]=None - ): - self.custom_fields=custom_fields + def __init__(self, custom_fields: Optional[List[ContactdbCustomFieldId2xx]] = None): + self.custom_fields = custom_fields def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "custom_fields": self.custom_fields - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"custom_fields": self.custom_fields}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListAllCustomFieldsResponse( - custom_fields=payload.get('custom_fields') - ) - + return ListAllCustomFieldsResponse(custom_fields=payload.get("custom_fields")) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/list_all_lists_response.py b/sendgrid/rest/api/lmc_contactdb/v3/models/list_all_lists_response.py index 8249e383..6fefa54e 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/list_all_lists_response.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/list_all_lists_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_list2xx import ContactdbList2xx - class ListAllListsResponse: - def __init__( - self, - lists: Optional[List[ContactdbList2xx]]=None - ): - self.lists=lists + def __init__(self, lists: Optional[List[ContactdbList2xx]] = None): + self.lists = lists def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "lists": self.lists - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"lists": self.lists}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListAllListsResponse( - lists=payload.get('lists') - ) - + return ListAllListsResponse(lists=payload.get("lists")) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/list_all_segments_response.py b/sendgrid/rest/api/lmc_contactdb/v3/models/list_all_segments_response.py index 4e377cb4..e7421572 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/list_all_segments_response.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/list_all_segments_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments import ContactdbSegments - +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments import ( + ContactdbSegments, +) class ListAllSegmentsResponse: - def __init__( - self, - segments: Optional[List[ContactdbSegments]]=None - ): - self.segments=segments + def __init__(self, segments: Optional[List[ContactdbSegments]] = None): + self.segments = segments def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "segments": self.segments - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"segments": self.segments}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListAllSegmentsResponse( - segments=payload.get('segments') - ) - + return ListAllSegmentsResponse(segments=payload.get("segments")) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/list_recipients_from_contact_db_list200_response.py b/sendgrid/rest/api/lmc_contactdb/v3/models/list_recipients_from_contact_db_list200_response.py index d9e146c8..9e93466c 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/list_recipients_from_contact_db_list200_response.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/list_recipients_from_contact_db_list200_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient200 import ContactdbRecipient200 - +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient200 import ( + ContactdbRecipient200, +) class ListRecipientsFromContactDbList200Response: - def __init__( - self, - recipients: Optional[List[ContactdbRecipient200]]=None - ): - self.recipients=recipients + def __init__(self, recipients: Optional[List[ContactdbRecipient200]] = None): + self.recipients = recipients def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "recipients": self.recipients - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"recipients": self.recipients}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -26,6 +23,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListRecipientsFromContactDbList200Response( - recipients=payload.get('recipients') - ) - + recipients=payload.get("recipients") + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/list_recipients_on_a_segment_response.py b/sendgrid/rest/api/lmc_contactdb/v3/models/list_recipients_on_a_segment_response.py index 9b55a0c8..71c3d21b 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/list_recipients_on_a_segment_response.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/list_recipients_on_a_segment_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient200 import ContactdbRecipient200 - +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient200 import ( + ContactdbRecipient200, +) class ListRecipientsOnASegmentResponse: - def __init__( - self, - recipients: Optional[List[ContactdbRecipient200]]=None - ): - self.recipients=recipients + def __init__(self, recipients: Optional[List[ContactdbRecipient200]] = None): + self.recipients = recipients def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "recipients": self.recipients - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"recipients": self.recipients}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListRecipientsOnASegmentResponse( - recipients=payload.get('recipients') - ) - + return ListRecipientsOnASegmentResponse(recipients=payload.get("recipients")) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/list_recipients_response.py b/sendgrid/rest/api/lmc_contactdb/v3/models/list_recipients_response.py index d257fed2..5327ca49 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/list_recipients_response.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/list_recipients_response.py @@ -1,22 +1,17 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListRecipientsResponse: - def __init__( - self, - recipients: Optional[List[object]]=None - ): - self.recipients=recipients + def __init__(self, recipients: Optional[List[object]] = None): + self.recipients = recipients def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "recipients": self.recipients - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"recipients": self.recipients}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListRecipientsResponse( - recipients=payload.get('recipients') - ) - + return ListRecipientsResponse(recipients=payload.get("recipients")) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/list_reserved_field200_response.py b/sendgrid/rest/api/lmc_contactdb/v3/models/list_reserved_field200_response.py index 154a7b3a..2dcbc0a2 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/list_reserved_field200_response.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/list_reserved_field200_response.py @@ -1,23 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.list_reserved_field200_response_reserved_fields_inner import ListReservedField200ResponseReservedFieldsInner - +from sendgrid.rest.api.lmc_contactdb.v3.models.list_reserved_field200_response_reserved_fields_inner import ( + ListReservedField200ResponseReservedFieldsInner, +) class ListReservedField200Response: def __init__( - self, - reserved_fields: Optional[List[ListReservedField200ResponseReservedFieldsInner]]=None + self, + reserved_fields: Optional[ + List[ListReservedField200ResponseReservedFieldsInner] + ] = None, ): - self.reserved_fields=reserved_fields + self.reserved_fields = reserved_fields def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "reserved_fields": self.reserved_fields - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"reserved_fields": self.reserved_fields}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -26,6 +28,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListReservedField200Response( - reserved_fields=payload.get('reserved_fields') - ) - + reserved_fields=payload.get("reserved_fields") + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/list_reserved_field200_response_reserved_fields_inner.py b/sendgrid/rest/api/lmc_contactdb/v3/models/list_reserved_field200_response_reserved_fields_inner.py index 3579c5a1..c41573b2 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/list_reserved_field200_response_reserved_fields_inner.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/list_reserved_field200_response_reserved_fields_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListReservedField200ResponseReservedFieldsInner: - def __init__( - self, - name: Optional[str]=None, - type: Optional[str]=None - ): - self.name=name - self.type=type + def __init__(self, name: Optional[str] = None, type: Optional[str] = None): + self.name = name + self.type = type def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name, - "type": self.type - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name, "type": self.type}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListReservedField200ResponseReservedFieldsInner( - name=payload.get('name'), - type=payload.get('type') - ) - + name=payload.get("name"), type=payload.get("type") + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/list_status200_response.py b/sendgrid/rest/api/lmc_contactdb/v3/models/list_status200_response.py index 190c1af6..a06582cd 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/list_status200_response.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/list_status200_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.list_status200_response_status_inner import ListStatus200ResponseStatusInner - +from sendgrid.rest.api.lmc_contactdb.v3.models.list_status200_response_status_inner import ( + ListStatus200ResponseStatusInner, +) class ListStatus200Response: - def __init__( - self, - status: Optional[List[ListStatus200ResponseStatusInner]]=None - ): - self.status=status + def __init__(self, status: Optional[List[ListStatus200ResponseStatusInner]] = None): + self.status = status def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "status": self.status - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"status": self.status}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListStatus200Response( - status=payload.get('status') - ) - + return ListStatus200Response(status=payload.get("status")) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/list_status200_response_status_inner.py b/sendgrid/rest/api/lmc_contactdb/v3/models/list_status200_response_status_inner.py index e5b7da12..d14c4905 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/list_status200_response_status_inner.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/list_status200_response_status_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListStatus200ResponseStatusInner: - def __init__( - self, - id: Optional[str]=None, - value: Optional[str]=None - ): - self.id=id - self.value=value + def __init__(self, id: Optional[str] = None, value: Optional[str] = None): + self.id = id + self.value = value def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "id": self.id, - "value": self.value - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"id": self.id, "value": self.value}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListStatus200ResponseStatusInner( - id=payload.get('id'), - value=payload.get('value') - ) - + id=payload.get("id"), value=payload.get("value") + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/operator.py b/sendgrid/rest/api/lmc_contactdb/v3/models/operator.py index 884d3eb6..ad755a51 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/operator.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/operator.py @@ -1,14 +1,10 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Operator(Enum): - EQ='eq' - NE='ne' - LT='lt' - GT='gt' - CONTAINS='contains' - + EQ = "eq" + NE = "ne" + LT = "lt" + GT = "gt" + CONTAINS = "contains" diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient200_response.py b/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient200_response.py index 56e5aff8..6ed78b49 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient200_response.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient200_response.py @@ -1,26 +1,28 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response_recipients_inner import SearchRecipient200ResponseRecipientsInner - +from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response_recipients_inner import ( + SearchRecipient200ResponseRecipientsInner, +) class SearchRecipient200Response: def __init__( - self, - recipients: Optional[List[SearchRecipient200ResponseRecipientsInner]]=None, - recipient_count: Optional[int]=None + self, + recipients: Optional[List[SearchRecipient200ResponseRecipientsInner]] = None, + recipient_count: Optional[int] = None, ): - self.recipients=recipients - self.recipient_count=recipient_count + self.recipients = recipients + self.recipient_count = recipient_count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "recipients": self.recipients, - "recipient_count": self.recipient_count - }.items() if value is not None} + "recipients": self.recipients, + "recipient_count": self.recipient_count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +31,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SearchRecipient200Response( - recipients=payload.get('recipients'), - recipient_count=payload.get('recipient_count') - ) - + recipients=payload.get("recipients"), + recipient_count=payload.get("recipient_count"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient200_response_recipients_inner.py b/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient200_response_recipients_inner.py index 0dcae2aa..d42ee459 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient200_response_recipients_inner.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient200_response_recipients_inner.py @@ -1,47 +1,51 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response_recipients_inner_custom_fields_inner import SearchRecipient200ResponseRecipientsInnerCustomFieldsInner - +from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response_recipients_inner_custom_fields_inner import ( + SearchRecipient200ResponseRecipientsInnerCustomFieldsInner, +) class SearchRecipient200ResponseRecipientsInner: def __init__( - self, - created_at: Optional[int]=None, - email: Optional[str]=None, - id: Optional[str]=None, - last_emailed: Optional[int]=None, - last_clicked: Optional[int]=None, - last_opened: Optional[int]=None, - custom_fields: Optional[List[SearchRecipient200ResponseRecipientsInnerCustomFieldsInner]]=None, - updated_at: Optional[int]=None, - first_name: Optional[str]=None + self, + created_at: Optional[int] = None, + email: Optional[str] = None, + id: Optional[str] = None, + last_emailed: Optional[int] = None, + last_clicked: Optional[int] = None, + last_opened: Optional[int] = None, + custom_fields: Optional[ + List[SearchRecipient200ResponseRecipientsInnerCustomFieldsInner] + ] = None, + updated_at: Optional[int] = None, + first_name: Optional[str] = None, ): - self.created_at=created_at - self.email=email - self.id=id - self.last_emailed=last_emailed - self.last_clicked=last_clicked - self.last_opened=last_opened - self.custom_fields=custom_fields - self.updated_at=updated_at - self.first_name=first_name + self.created_at = created_at + self.email = email + self.id = id + self.last_emailed = last_emailed + self.last_clicked = last_clicked + self.last_opened = last_opened + self.custom_fields = custom_fields + self.updated_at = updated_at + self.first_name = first_name def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "created_at": self.created_at, - "email": self.email, - "id": self.id, - "last_emailed": self.last_emailed, - "last_clicked": self.last_clicked, - "last_opened": self.last_opened, - "custom_fields": self.custom_fields, - "updated_at": self.updated_at, - "first_name": self.first_name - }.items() if value is not None} + "created_at": self.created_at, + "email": self.email, + "id": self.id, + "last_emailed": self.last_emailed, + "last_clicked": self.last_clicked, + "last_opened": self.last_opened, + "custom_fields": self.custom_fields, + "updated_at": self.updated_at, + "first_name": self.first_name, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -50,14 +54,13 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SearchRecipient200ResponseRecipientsInner( - created_at=payload.get('created_at'), - email=payload.get('email'), - id=payload.get('id'), - last_emailed=payload.get('last_emailed'), - last_clicked=payload.get('last_clicked'), - last_opened=payload.get('last_opened'), - custom_fields=payload.get('custom_fields'), - updated_at=payload.get('updated_at'), - first_name=payload.get('first_name') - ) - + created_at=payload.get("created_at"), + email=payload.get("email"), + id=payload.get("id"), + last_emailed=payload.get("last_emailed"), + last_clicked=payload.get("last_clicked"), + last_opened=payload.get("last_opened"), + custom_fields=payload.get("custom_fields"), + updated_at=payload.get("updated_at"), + first_name=payload.get("first_name"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient200_response_recipients_inner_custom_fields_inner.py b/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient200_response_recipients_inner_custom_fields_inner.py index d2abb95b..e28926e4 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient200_response_recipients_inner_custom_fields_inner.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient200_response_recipients_inner_custom_fields_inner.py @@ -1,32 +1,36 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response_recipients_inner_custom_fields_inner_value import SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue - +from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response_recipients_inner_custom_fields_inner_value import ( + SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue, +) class SearchRecipient200ResponseRecipientsInnerCustomFieldsInner: def __init__( - self, - id: Optional[int]=None, - name: Optional[str]=None, - value: Optional[SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue]=None, - type: Optional[str]=None + self, + id: Optional[int] = None, + name: Optional[str] = None, + value: Optional[ + SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue + ] = None, + type: Optional[str] = None, ): - self.id=id - self.name=name - self.value=value - self.type=type + self.id = id + self.name = name + self.value = value + self.type = type def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "name": self.name, - "value": self.value, - "type": self.type - }.items() if value is not None} + "id": self.id, + "name": self.name, + "value": self.value, + "type": self.type, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -35,9 +39,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SearchRecipient200ResponseRecipientsInnerCustomFieldsInner( - id=payload.get('id'), - name=payload.get('name'), - value=payload.get('value'), - type=payload.get('type') - ) - + id=payload.get("id"), + name=payload.get("name"), + value=payload.get("value"), + type=payload.get("type"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient_request.py b/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient_request.py index 73249025..68311eab 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient_request.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/search_recipient_request.py @@ -1,26 +1,28 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments_conditions import ContactdbSegmentsConditions - +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments_conditions import ( + ContactdbSegmentsConditions, +) class SearchRecipientRequest: def __init__( - self, - list_id: Optional[int]=None, - conditions: Optional[List[ContactdbSegmentsConditions]]=None + self, + list_id: Optional[int] = None, + conditions: Optional[List[ContactdbSegmentsConditions]] = None, ): - self.list_id=list_id - self.conditions=conditions + self.list_id = list_id + self.conditions = conditions def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "list_id": self.list_id, - "conditions": self.conditions - }.items() if value is not None} + "list_id": self.list_id, + "conditions": self.conditions, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +31,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SearchRecipientRequest( - list_id=payload.get('list_id'), - conditions=payload.get('conditions') - ) - + list_id=payload.get("list_id"), conditions=payload.get("conditions") + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/type.py b/sendgrid/rest/api/lmc_contactdb/v3/models/type.py index fee71445..7de12d96 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/type.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/type.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Type(Enum): - DATE='date' - TEXT='text' - NUMBER='number' - + DATE = "date" + TEXT = "text" + NUMBER = "number" diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/update_a_list_request.py b/sendgrid/rest/api/lmc_contactdb/v3/models/update_a_list_request.py index 7bd55e03..17c0dd41 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/update_a_list_request.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/update_a_list_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateAListRequest: - def __init__( - self, - name: Optional[str]=None - ): - self.name=name + def __init__(self, name: Optional[str] = None): + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateAListRequest( - name=payload.get('name') - ) - + return UpdateAListRequest(name=payload.get("name")) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/update_contact_db_list200_response.py b/sendgrid/rest/api/lmc_contactdb/v3/models/update_contact_db_list200_response.py index 03c48229..a1ea57ea 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/update_contact_db_list200_response.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/update_contact_db_list200_response.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateContactDbList200Response: def __init__( - self, - id: Optional[int]=None, - name: Optional[str]=None, - recipient_count: Optional[int]=None + self, + id: Optional[int] = None, + name: Optional[str] = None, + recipient_count: Optional[int] = None, ): - self.id=id - self.name=name - self.recipient_count=recipient_count + self.id = id + self.name = name + self.recipient_count = recipient_count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "name": self.name, - "recipient_count": self.recipient_count - }.items() if value is not None} + "id": self.id, + "name": self.name, + "recipient_count": self.recipient_count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateContactDbList200Response( - id=payload.get('id'), - name=payload.get('name'), - recipient_count=payload.get('recipient_count') - ) - + id=payload.get("id"), + name=payload.get("name"), + recipient_count=payload.get("recipient_count"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/update_recipient_request_inner.py b/sendgrid/rest/api/lmc_contactdb/v3/models/update_recipient_request_inner.py index 90fa29aa..54112eb4 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/update_recipient_request_inner.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/update_recipient_request_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateRecipientRequestInner: def __init__( - self, - email: Optional[str]=None, - last_name: Optional[str]=None, - first_name: Optional[str]=None + self, + email: Optional[str] = None, + last_name: Optional[str] = None, + first_name: Optional[str] = None, ): - self.email=email - self.last_name=last_name - self.first_name=first_name + self.email = email + self.last_name = last_name + self.first_name = first_name def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "email": self.email, - "last_name": self.last_name, - "first_name": self.first_name - }.items() if value is not None} + "email": self.email, + "last_name": self.last_name, + "first_name": self.first_name, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateRecipientRequestInner( - email=payload.get('email'), - last_name=payload.get('last_name'), - first_name=payload.get('first_name') - ) - + email=payload.get("email"), + last_name=payload.get("last_name"), + first_name=payload.get("first_name"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/models/update_segment_request.py b/sendgrid/rest/api/lmc_contactdb/v3/models/update_segment_request.py index a1e7245c..3c7ce060 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/models/update_segment_request.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/models/update_segment_request.py @@ -1,29 +1,31 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments_conditions import ContactdbSegmentsConditions - +from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments_conditions import ( + ContactdbSegmentsConditions, +) class UpdateSegmentRequest: def __init__( - self, - name: Optional[str]=None, - list_id: Optional[float]=None, - conditions: Optional[List[ContactdbSegmentsConditions]]=None + self, + name: Optional[str] = None, + list_id: Optional[float] = None, + conditions: Optional[List[ContactdbSegmentsConditions]] = None, ): - self.name=name - self.list_id=list_id - self.conditions=conditions + self.name = name + self.list_id = list_id + self.conditions = conditions def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "list_id": self.list_id, - "conditions": self.conditions - }.items() if value is not None} + "name": self.name, + "list_id": self.list_id, + "conditions": self.conditions, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +34,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateSegmentRequest( - name=payload.get('name'), - list_id=payload.get('list_id'), - conditions=payload.get('conditions') - ) - + name=payload.get("name"), + list_id=payload.get("list_id"), + conditions=payload.get("conditions"), + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/search_recipient.py b/sendgrid/rest/api/lmc_contactdb/v3/search_recipient.py index fd0c4991..9f2e2022 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/search_recipient.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/search_recipient.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient200_response import SearchRecipient200Response -from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient_request import SearchRecipientRequest +from sendgrid.rest.api.lmc_contactdb.v3.models.search_recipient_request import ( + SearchRecipientRequest, +) + class SearchRecipient: def __init__(self, client) -> None: self.client = client - + def send( self, - search_recipient_request: Optional[SearchRecipientRequest] = None, - + search_recipient_request: Optional[SearchRecipientRequest] = None, ): - path='/v3/contactdb/recipients/search' + path = "/v3/contactdb/recipients/search" data = None if search_recipient_request: data = search_recipient_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/update_contact_db_list.py b/sendgrid/rest/api/lmc_contactdb/v3/update_contact_db_list.py index 55f7dc35..5bd5e25b 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/update_contact_db_list.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/update_contact_db_list.py @@ -12,59 +12,58 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.update_a_list_request import UpdateAListRequest -from sendgrid.rest.api.lmc_contactdb.v3.models.update_contact_db_list200_response import UpdateContactDbList200Response +from sendgrid.rest.api.lmc_contactdb.v3.models.update_a_list_request import ( + UpdateAListRequest, +) + class UpdateContactDbList: def __init__(self, client) -> None: self.client = client - + def send( self, - list_id: int, - on_behalf_of: Optional[str] = None, - update_a_list_request: Optional[UpdateAListRequest] = None, - + list_id: int, + on_behalf_of: Optional[str] = None, + update_a_list_request: Optional[UpdateAListRequest] = None, ): - path='/v3/contactdb/lists/{list_id}' + path = "/v3/contactdb/lists/{list_id}" path = path.format( - list_id=list_id, + list_id=list_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_a_list_request: data = update_a_list_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/update_recipient.py b/sendgrid/rest/api/lmc_contactdb/v3/update_recipient.py index 6976d86f..3bd1d3b2 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/update_recipient.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/update_recipient.py @@ -12,55 +12,56 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import List, Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import List, Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_recipient_response201 import ContactdbRecipientResponse201 -from sendgrid.rest.api.lmc_contactdb.v3.models.update_recipient_request_inner import UpdateRecipientRequestInner +from sendgrid.rest.api.lmc_contactdb.v3.models.update_recipient_request_inner import ( + UpdateRecipientRequestInner, +) + class UpdateRecipient: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - update_recipient_request_inner: Optional[List[UpdateRecipientRequestInner]] = None, - + on_behalf_of: Optional[str] = None, + update_recipient_request_inner: Optional[ + List[UpdateRecipientRequestInner] + ] = None, ): - path='/v3/contactdb/recipients' + path = "/v3/contactdb/recipients" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_recipient_request_inner: data = update_recipient_request_inner.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_contactdb/v3/update_segment.py b/sendgrid/rest/api/lmc_contactdb/v3/update_segment.py index 317260ce..bc291802 100644 --- a/sendgrid/rest/api/lmc_contactdb/v3/update_segment.py +++ b/sendgrid/rest/api/lmc_contactdb/v3/update_segment.py @@ -12,59 +12,58 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_contactdb.v3.models.contactdb_segments import ContactdbSegments -from sendgrid.rest.api.lmc_contactdb.v3.models.update_segment_request import UpdateSegmentRequest +from sendgrid.rest.api.lmc_contactdb.v3.models.update_segment_request import ( + UpdateSegmentRequest, +) + class UpdateSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - segment_id: int, - on_behalf_of: Optional[str] = None, - update_segment_request: Optional[UpdateSegmentRequest] = None, - + segment_id: int, + on_behalf_of: Optional[str] = None, + update_segment_request: Optional[UpdateSegmentRequest] = None, ): - path='/v3/contactdb/segments/{segment_id}' + path = "/v3/contactdb/segments/{segment_id}" path = path.format( - segment_id=segment_id, + segment_id=segment_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_segment_request: data = update_segment_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_senders/v3/__init__.py b/sendgrid/rest/api/lmc_senders/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/lmc_senders/v3/__init__.py +++ b/sendgrid/rest/api/lmc_senders/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/lmc_senders/v3/create_sender.py b/sendgrid/rest/api/lmc_senders/v3/create_sender.py index 1a16381a..e3e909a8 100644 --- a/sendgrid/rest/api/lmc_senders/v3/create_sender.py +++ b/sendgrid/rest/api/lmc_senders/v3/create_sender.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_senders.v3.models.create_sender_request import CreateSenderRequest -from sendgrid.rest.api.lmc_senders.v3.models.sender_id import SenderId +from sendgrid.rest.api.lmc_senders.v3.models.create_sender_request import ( + CreateSenderRequest, +) + class CreateSender: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - create_sender_request: Optional[CreateSenderRequest] = None, - + on_behalf_of: Optional[str] = None, + create_sender_request: Optional[CreateSenderRequest] = None, ): - path='/v3/senders' + path = "/v3/senders" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if create_sender_request: data = create_sender_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_senders/v3/delete_sender.py b/sendgrid/rest/api/lmc_senders/v3/delete_sender.py index 635c3456..f92da99d 100644 --- a/sendgrid/rest/api/lmc_senders/v3/delete_sender.py +++ b/sendgrid/rest/api/lmc_senders/v3/delete_sender.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteSender: def __init__(self, client) -> None: self.client = client - + def send( self, - sender_id: int, - on_behalf_of: Optional[str] = None, - + sender_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/senders/{sender_id}' + path = "/v3/senders/{sender_id}" path = path.format( - sender_id=sender_id, + sender_id=sender_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_senders/v3/get_sender.py b/sendgrid/rest/api/lmc_senders/v3/get_sender.py index a6492493..a86106aa 100644 --- a/sendgrid/rest/api/lmc_senders/v3/get_sender.py +++ b/sendgrid/rest/api/lmc_senders/v3/get_sender.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_senders.v3.models.sender_id import SenderId + class GetSender: def __init__(self, client) -> None: self.client = client - + def send( self, - sender_id: int, - on_behalf_of: Optional[str] = None, - + sender_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/senders/{sender_id}' + path = "/v3/senders/{sender_id}" path = path.format( - sender_id=sender_id, + sender_id=sender_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_senders/v3/list_sender.py b/sendgrid/rest/api/lmc_senders/v3/list_sender.py index 4568155b..b0500c97 100644 --- a/sendgrid/rest/api/lmc_senders/v3/list_sender.py +++ b/sendgrid/rest/api/lmc_senders/v3/list_sender.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_senders.v3.models.list_sender200_response import ListSender200Response + class ListSender: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/senders' + path = "/v3/senders" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_senders/v3/models/__init__.py b/sendgrid/rest/api/lmc_senders/v3/models/__init__.py index 9c90186e..d8123f34 100644 --- a/sendgrid/rest/api/lmc_senders/v3/models/__init__.py +++ b/sendgrid/rest/api/lmc_senders/v3/models/__init__.py @@ -11,15 +11,36 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.lmc_senders.v3.models.create_sender400_response import CreateSender400Response -from sendgrid.rest.api.lmc_senders.v3.models.create_sender400_response_errors_inner import CreateSender400ResponseErrorsInner -from sendgrid.rest.api.lmc_senders.v3.models.create_sender_request import CreateSenderRequest -from sendgrid.rest.api.lmc_senders.v3.models.list_sender200_response import ListSender200Response +from sendgrid.rest.api.lmc_senders.v3.models.create_sender400_response import ( + CreateSender400Response, +) +from sendgrid.rest.api.lmc_senders.v3.models.create_sender400_response_errors_inner import ( + CreateSender400ResponseErrorsInner, +) +from sendgrid.rest.api.lmc_senders.v3.models.create_sender_request import ( + CreateSenderRequest, +) +from sendgrid.rest.api.lmc_senders.v3.models.list_sender200_response import ( + ListSender200Response, +) from sendgrid.rest.api.lmc_senders.v3.models.sender_id import SenderId from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request import SenderIdRequest -from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request_from import SenderIdRequestFrom -from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request_reply_to import SenderIdRequestReplyTo -__all__ = [ 'CreateSender400Response', 'CreateSender400ResponseErrorsInner', 'CreateSenderRequest', 'ListSender200Response', 'SenderId', 'SenderIdRequest', 'SenderIdRequestFrom', 'SenderIdRequestReplyTo' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request_from import ( + SenderIdRequestFrom, +) +from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request_reply_to import ( + SenderIdRequestReplyTo, +) + +__all__ = [ + "CreateSender400Response", + "CreateSender400ResponseErrorsInner", + "CreateSenderRequest", + "ListSender200Response", + "SenderId", + "SenderIdRequest", + "SenderIdRequestFrom", + "SenderIdRequestReplyTo", +] +# Testing code diff --git a/sendgrid/rest/api/lmc_senders/v3/models/create_sender400_response.py b/sendgrid/rest/api/lmc_senders/v3/models/create_sender400_response.py index eaf14151..6de1783d 100644 --- a/sendgrid/rest/api/lmc_senders/v3/models/create_sender400_response.py +++ b/sendgrid/rest/api/lmc_senders/v3/models/create_sender400_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_senders.v3.models.create_sender400_response_errors_inner import CreateSender400ResponseErrorsInner - +from sendgrid.rest.api.lmc_senders.v3.models.create_sender400_response_errors_inner import ( + CreateSender400ResponseErrorsInner, +) class CreateSender400Response: def __init__( - self, - errors: Optional[List[CreateSender400ResponseErrorsInner]]=None + self, errors: Optional[List[CreateSender400ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return CreateSender400Response( - errors=payload.get('errors') - ) - + return CreateSender400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/lmc_senders/v3/models/create_sender400_response_errors_inner.py b/sendgrid/rest/api/lmc_senders/v3/models/create_sender400_response_errors_inner.py index fe33bff4..eda8322a 100644 --- a/sendgrid/rest/api/lmc_senders/v3/models/create_sender400_response_errors_inner.py +++ b/sendgrid/rest/api/lmc_senders/v3/models/create_sender400_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateSender400ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None - ): - self.message=message - self.field=field + def __init__(self, message: Optional[str] = None, field: Optional[str] = None): + self.message = message + self.field = field def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message, - "field": self.field - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message, "field": self.field}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateSender400ResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field') - ) - + message=payload.get("message"), field=payload.get("field") + ) diff --git a/sendgrid/rest/api/lmc_senders/v3/models/create_sender_request.py b/sendgrid/rest/api/lmc_senders/v3/models/create_sender_request.py index f70bdc84..7031de47 100644 --- a/sendgrid/rest/api/lmc_senders/v3/models/create_sender_request.py +++ b/sendgrid/rest/api/lmc_senders/v3/models/create_sender_request.py @@ -1,46 +1,46 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateSenderRequest: def __init__( - self, - nickname: Optional[str]=None, - var_from: Optional[object]=None, - reply_to: Optional[object]=None, - address: Optional[str]=None, - address_2: Optional[str]=None, - city: Optional[str]=None, - state: Optional[str]=None, - zip: Optional[str]=None, - country: Optional[str]=None + self, + nickname: Optional[str] = None, + var_from: Optional[object] = None, + reply_to: Optional[object] = None, + address: Optional[str] = None, + address_2: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + zip: Optional[str] = None, + country: Optional[str] = None, ): - self.nickname=nickname - self.var_from=var_from - self.reply_to=reply_to - self.address=address - self.address_2=address_2 - self.city=city - self.state=state - self.zip=zip - self.country=country + self.nickname = nickname + self.var_from = var_from + self.reply_to = reply_to + self.address = address + self.address_2 = address_2 + self.city = city + self.state = state + self.zip = zip + self.country = country def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "nickname": self.nickname, - "from": self.var_from, - "reply_to": self.reply_to, - "address": self.address, - "address_2": self.address_2, - "city": self.city, - "state": self.state, - "zip": self.zip, - "country": self.country - }.items() if value is not None} + "nickname": self.nickname, + "from": self.var_from, + "reply_to": self.reply_to, + "address": self.address, + "address_2": self.address_2, + "city": self.city, + "state": self.state, + "zip": self.zip, + "country": self.country, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -49,14 +49,13 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateSenderRequest( - nickname=payload.get('nickname'), - var_from=payload.get('from'), - reply_to=payload.get('reply_to'), - address=payload.get('address'), - address_2=payload.get('address_2'), - city=payload.get('city'), - state=payload.get('state'), - zip=payload.get('zip'), - country=payload.get('country') - ) - + nickname=payload.get("nickname"), + var_from=payload.get("from"), + reply_to=payload.get("reply_to"), + address=payload.get("address"), + address_2=payload.get("address_2"), + city=payload.get("city"), + state=payload.get("state"), + zip=payload.get("zip"), + country=payload.get("country"), + ) diff --git a/sendgrid/rest/api/lmc_senders/v3/models/list_sender200_response.py b/sendgrid/rest/api/lmc_senders/v3/models/list_sender200_response.py index d54980a1..b84c2c1a 100644 --- a/sendgrid/rest/api/lmc_senders/v3/models/list_sender200_response.py +++ b/sendgrid/rest/api/lmc_senders/v3/models/list_sender200_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.lmc_senders.v3.models.sender_id import SenderId - class ListSender200Response: - def __init__( - self, - result: Optional[List[SenderId]]=None - ): - self.result=result + def __init__(self, result: Optional[List[SenderId]] = None): + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListSender200Response( - result=payload.get('result') - ) - + return ListSender200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/lmc_senders/v3/models/sender_id.py b/sendgrid/rest/api/lmc_senders/v3/models/sender_id.py index bde75fd7..af6acf31 100644 --- a/sendgrid/rest/api/lmc_senders/v3/models/sender_id.py +++ b/sendgrid/rest/api/lmc_senders/v3/models/sender_id.py @@ -1,63 +1,67 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request_from import SenderIdRequestFrom -from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request_reply_to import SenderIdRequestReplyTo - +from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request_from import ( + SenderIdRequestFrom, +) +from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request_reply_to import ( + SenderIdRequestReplyTo, +) class SenderId: def __init__( - self, - nickname: Optional[str]=None, - var_from: Optional[SenderIdRequestFrom]=None, - reply_to: Optional[SenderIdRequestReplyTo]=None, - address: Optional[str]=None, - address_2: Optional[str]=None, - city: Optional[str]=None, - state: Optional[str]=None, - zip: Optional[str]=None, - country: Optional[str]=None, - id: Optional[int]=None, - verified: Optional[bool]=None, - updated_at: Optional[int]=None, - created_at: Optional[int]=None, - locked: Optional[bool]=None + self, + nickname: Optional[str] = None, + var_from: Optional[SenderIdRequestFrom] = None, + reply_to: Optional[SenderIdRequestReplyTo] = None, + address: Optional[str] = None, + address_2: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + zip: Optional[str] = None, + country: Optional[str] = None, + id: Optional[int] = None, + verified: Optional[bool] = None, + updated_at: Optional[int] = None, + created_at: Optional[int] = None, + locked: Optional[bool] = None, ): - self.nickname=nickname - self.var_from=var_from - self.reply_to=reply_to - self.address=address - self.address_2=address_2 - self.city=city - self.state=state - self.zip=zip - self.country=country - self.id=id - self.verified=verified - self.updated_at=updated_at - self.created_at=created_at - self.locked=locked + self.nickname = nickname + self.var_from = var_from + self.reply_to = reply_to + self.address = address + self.address_2 = address_2 + self.city = city + self.state = state + self.zip = zip + self.country = country + self.id = id + self.verified = verified + self.updated_at = updated_at + self.created_at = created_at + self.locked = locked def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "nickname": self.nickname, - "from": self.var_from, - "reply_to": self.reply_to, - "address": self.address, - "address_2": self.address_2, - "city": self.city, - "state": self.state, - "zip": self.zip, - "country": self.country, - "id": self.id, - "verified": self.verified, - "updated_at": self.updated_at, - "created_at": self.created_at, - "locked": self.locked - }.items() if value is not None} + "nickname": self.nickname, + "from": self.var_from, + "reply_to": self.reply_to, + "address": self.address, + "address_2": self.address_2, + "city": self.city, + "state": self.state, + "zip": self.zip, + "country": self.country, + "id": self.id, + "verified": self.verified, + "updated_at": self.updated_at, + "created_at": self.created_at, + "locked": self.locked, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -66,19 +70,18 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SenderId( - nickname=payload.get('nickname'), - var_from=payload.get('from'), - reply_to=payload.get('reply_to'), - address=payload.get('address'), - address_2=payload.get('address_2'), - city=payload.get('city'), - state=payload.get('state'), - zip=payload.get('zip'), - country=payload.get('country'), - id=payload.get('id'), - verified=payload.get('verified'), - updated_at=payload.get('updated_at'), - created_at=payload.get('created_at'), - locked=payload.get('locked') - ) - + nickname=payload.get("nickname"), + var_from=payload.get("from"), + reply_to=payload.get("reply_to"), + address=payload.get("address"), + address_2=payload.get("address_2"), + city=payload.get("city"), + state=payload.get("state"), + zip=payload.get("zip"), + country=payload.get("country"), + id=payload.get("id"), + verified=payload.get("verified"), + updated_at=payload.get("updated_at"), + created_at=payload.get("created_at"), + locked=payload.get("locked"), + ) diff --git a/sendgrid/rest/api/lmc_senders/v3/models/sender_id_request.py b/sendgrid/rest/api/lmc_senders/v3/models/sender_id_request.py index f8723935..87271ba0 100644 --- a/sendgrid/rest/api/lmc_senders/v3/models/sender_id_request.py +++ b/sendgrid/rest/api/lmc_senders/v3/models/sender_id_request.py @@ -1,48 +1,52 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request_from import SenderIdRequestFrom -from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request_reply_to import SenderIdRequestReplyTo - +from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request_from import ( + SenderIdRequestFrom, +) +from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request_reply_to import ( + SenderIdRequestReplyTo, +) class SenderIdRequest: def __init__( - self, - nickname: Optional[str]=None, - var_from: Optional[SenderIdRequestFrom]=None, - reply_to: Optional[SenderIdRequestReplyTo]=None, - address: Optional[str]=None, - address_2: Optional[str]=None, - city: Optional[str]=None, - state: Optional[str]=None, - zip: Optional[str]=None, - country: Optional[str]=None + self, + nickname: Optional[str] = None, + var_from: Optional[SenderIdRequestFrom] = None, + reply_to: Optional[SenderIdRequestReplyTo] = None, + address: Optional[str] = None, + address_2: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + zip: Optional[str] = None, + country: Optional[str] = None, ): - self.nickname=nickname - self.var_from=var_from - self.reply_to=reply_to - self.address=address - self.address_2=address_2 - self.city=city - self.state=state - self.zip=zip - self.country=country + self.nickname = nickname + self.var_from = var_from + self.reply_to = reply_to + self.address = address + self.address_2 = address_2 + self.city = city + self.state = state + self.zip = zip + self.country = country def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "nickname": self.nickname, - "from": self.var_from, - "reply_to": self.reply_to, - "address": self.address, - "address_2": self.address_2, - "city": self.city, - "state": self.state, - "zip": self.zip, - "country": self.country - }.items() if value is not None} + "nickname": self.nickname, + "from": self.var_from, + "reply_to": self.reply_to, + "address": self.address, + "address_2": self.address_2, + "city": self.city, + "state": self.state, + "zip": self.zip, + "country": self.country, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -51,14 +55,13 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SenderIdRequest( - nickname=payload.get('nickname'), - var_from=payload.get('from'), - reply_to=payload.get('reply_to'), - address=payload.get('address'), - address_2=payload.get('address_2'), - city=payload.get('city'), - state=payload.get('state'), - zip=payload.get('zip'), - country=payload.get('country') - ) - + nickname=payload.get("nickname"), + var_from=payload.get("from"), + reply_to=payload.get("reply_to"), + address=payload.get("address"), + address_2=payload.get("address_2"), + city=payload.get("city"), + state=payload.get("state"), + zip=payload.get("zip"), + country=payload.get("country"), + ) diff --git a/sendgrid/rest/api/lmc_senders/v3/models/sender_id_request_from.py b/sendgrid/rest/api/lmc_senders/v3/models/sender_id_request_from.py index 22799719..2423f9e9 100644 --- a/sendgrid/rest/api/lmc_senders/v3/models/sender_id_request_from.py +++ b/sendgrid/rest/api/lmc_senders/v3/models/sender_id_request_from.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SenderIdRequestFrom: - def __init__( - self, - email: Optional[str]=None, - name: Optional[str]=None - ): - self.email=email - self.name=name + def __init__(self, email: Optional[str] = None, name: Optional[str] = None): + self.email = email + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email, - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email, "name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -27,8 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SenderIdRequestFrom( - email=payload.get('email'), - name=payload.get('name') - ) - + return SenderIdRequestFrom(email=payload.get("email"), name=payload.get("name")) diff --git a/sendgrid/rest/api/lmc_senders/v3/models/sender_id_request_reply_to.py b/sendgrid/rest/api/lmc_senders/v3/models/sender_id_request_reply_to.py index bc5bcc22..541d552f 100644 --- a/sendgrid/rest/api/lmc_senders/v3/models/sender_id_request_reply_to.py +++ b/sendgrid/rest/api/lmc_senders/v3/models/sender_id_request_reply_to.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SenderIdRequestReplyTo: - def __init__( - self, - email: Optional[str]=None, - name: Optional[str]=None - ): - self.email=email - self.name=name + def __init__(self, email: Optional[str] = None, name: Optional[str] = None): + self.email = email + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email, - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email, "name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SenderIdRequestReplyTo( - email=payload.get('email'), - name=payload.get('name') - ) - + email=payload.get("email"), name=payload.get("name") + ) diff --git a/sendgrid/rest/api/lmc_senders/v3/reset_sender_verification.py b/sendgrid/rest/api/lmc_senders/v3/reset_sender_verification.py index de94cf1e..79c51b7b 100644 --- a/sendgrid/rest/api/lmc_senders/v3/reset_sender_verification.py +++ b/sendgrid/rest/api/lmc_senders/v3/reset_sender_verification.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated + class ResetSenderVerification: def __init__(self, client) -> None: self.client = client - + def send( self, - sender_id: int, - on_behalf_of: Optional[str] = None, - + sender_id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/senders/{sender_id}/resend_verification' + path = "/v3/senders/{sender_id}/resend_verification" path = path.format( - sender_id=sender_id, + sender_id=sender_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='POST', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/lmc_senders/v3/update_sender.py b/sendgrid/rest/api/lmc_senders/v3/update_sender.py index 71e49c0f..f7d90b81 100644 --- a/sendgrid/rest/api/lmc_senders/v3/update_sender.py +++ b/sendgrid/rest/api/lmc_senders/v3/update_sender.py @@ -12,59 +12,56 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.lmc_senders.v3.models.sender_id import SenderId from sendgrid.rest.api.lmc_senders.v3.models.sender_id_request import SenderIdRequest + class UpdateSender: def __init__(self, client) -> None: self.client = client - + def send( self, - sender_id: int, - on_behalf_of: Optional[str] = None, - sender_id_request: Optional[SenderIdRequest] = None, - + sender_id: int, + on_behalf_of: Optional[str] = None, + sender_id_request: Optional[SenderIdRequest] = None, ): - path='/v3/senders/{sender_id}' + path = "/v3/senders/{sender_id}" path = path.format( - sender_id=sender_id, + sender_id=sender_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if sender_id_request: data = sender_id_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail/v3/__init__.py b/sendgrid/rest/api/mail/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/mail/v3/__init__.py +++ b/sendgrid/rest/api/mail/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/mail/v3/create_mail_batch.py b/sendgrid/rest/api/mail/v3/create_mail_batch.py index 228ceddc..29968326 100644 --- a/sendgrid/rest/api/mail/v3/create_mail_batch.py +++ b/sendgrid/rest/api/mail/v3/create_mail_batch.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail.v3.models.mail_batch_response import MailBatchResponse + class CreateMailBatch: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/mail/batch' + path = "/v3/mail/batch" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='POST', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail/v3/get_mail_batch.py b/sendgrid/rest/api/mail/v3/get_mail_batch.py index c5f14b34..04173c54 100644 --- a/sendgrid/rest/api/mail/v3/get_mail_batch.py +++ b/sendgrid/rest/api/mail/v3/get_mail_batch.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail.v3.models.mail_batch_response import MailBatchResponse + class GetMailBatch: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/mail/batch/{batch_id}' + path = "/v3/mail/batch/{batch_id}" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail/v3/models/__init__.py b/sendgrid/rest/api/mail/v3/models/__init__.py index c3747d32..f0adea87 100644 --- a/sendgrid/rest/api/mail/v3/models/__init__.py +++ b/sendgrid/rest/api/mail/v3/models/__init__.py @@ -11,31 +11,88 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.mail.v3.models.content_encoding import ContentEncoding from sendgrid.rest.api.mail.v3.models.disposition import Disposition from sendgrid.rest.api.mail.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.mail.v3.models.error_response_errors_inner import ErrorResponseErrorsInner +from sendgrid.rest.api.mail.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) from sendgrid.rest.api.mail.v3.models.mail_batch_response import MailBatchResponse from sendgrid.rest.api.mail.v3.models.mail_from import MailFrom from sendgrid.rest.api.mail.v3.models.mail_to import MailTo from sendgrid.rest.api.mail.v3.models.send_mail_request import SendMailRequest from sendgrid.rest.api.mail.v3.models.send_mail_request_asm import SendMailRequestAsm -from sendgrid.rest.api.mail.v3.models.send_mail_request_attachments_inner import SendMailRequestAttachmentsInner -from sendgrid.rest.api.mail.v3.models.send_mail_request_content_inner import SendMailRequestContentInner -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings import SendMailRequestMailSettings -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_bounce_management import SendMailRequestMailSettingsBypassBounceManagement -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_list_management import SendMailRequestMailSettingsBypassListManagement -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_spam_management import SendMailRequestMailSettingsBypassSpamManagement -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_unsubscribe_management import SendMailRequestMailSettingsBypassUnsubscribeManagement -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_footer import SendMailRequestMailSettingsFooter -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_sandbox_mode import SendMailRequestMailSettingsSandboxMode -from sendgrid.rest.api.mail.v3.models.send_mail_request_personalizations_inner import SendMailRequestPersonalizationsInner -from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings import SendMailRequestTrackingSettings -from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_click_tracking import SendMailRequestTrackingSettingsClickTracking -from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_ganalytics import SendMailRequestTrackingSettingsGanalytics -from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_open_tracking import SendMailRequestTrackingSettingsOpenTracking -from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_subscription_tracking import SendMailRequestTrackingSettingsSubscriptionTracking -__all__ = [ 'ContentEncoding', 'Disposition', 'ErrorResponse', 'ErrorResponseErrorsInner', 'MailBatchResponse', 'MailFrom', 'MailTo', 'SendMailRequest', 'SendMailRequestAsm', 'SendMailRequestAttachmentsInner', 'SendMailRequestContentInner', 'SendMailRequestMailSettings', 'SendMailRequestMailSettingsBypassBounceManagement', 'SendMailRequestMailSettingsBypassListManagement', 'SendMailRequestMailSettingsBypassSpamManagement', 'SendMailRequestMailSettingsBypassUnsubscribeManagement', 'SendMailRequestMailSettingsFooter', 'SendMailRequestMailSettingsSandboxMode', 'SendMailRequestPersonalizationsInner', 'SendMailRequestTrackingSettings', 'SendMailRequestTrackingSettingsClickTracking', 'SendMailRequestTrackingSettingsGanalytics', 'SendMailRequestTrackingSettingsOpenTracking', 'SendMailRequestTrackingSettingsSubscriptionTracking' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.mail.v3.models.send_mail_request_attachments_inner import ( + SendMailRequestAttachmentsInner, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_content_inner import ( + SendMailRequestContentInner, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings import ( + SendMailRequestMailSettings, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_bounce_management import ( + SendMailRequestMailSettingsBypassBounceManagement, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_list_management import ( + SendMailRequestMailSettingsBypassListManagement, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_spam_management import ( + SendMailRequestMailSettingsBypassSpamManagement, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_unsubscribe_management import ( + SendMailRequestMailSettingsBypassUnsubscribeManagement, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_footer import ( + SendMailRequestMailSettingsFooter, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_sandbox_mode import ( + SendMailRequestMailSettingsSandboxMode, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_personalizations_inner import ( + SendMailRequestPersonalizationsInner, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings import ( + SendMailRequestTrackingSettings, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_click_tracking import ( + SendMailRequestTrackingSettingsClickTracking, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_ganalytics import ( + SendMailRequestTrackingSettingsGanalytics, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_open_tracking import ( + SendMailRequestTrackingSettingsOpenTracking, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_subscription_tracking import ( + SendMailRequestTrackingSettingsSubscriptionTracking, +) + +__all__ = [ + "ContentEncoding", + "Disposition", + "ErrorResponse", + "ErrorResponseErrorsInner", + "MailBatchResponse", + "MailFrom", + "MailTo", + "SendMailRequest", + "SendMailRequestAsm", + "SendMailRequestAttachmentsInner", + "SendMailRequestContentInner", + "SendMailRequestMailSettings", + "SendMailRequestMailSettingsBypassBounceManagement", + "SendMailRequestMailSettingsBypassListManagement", + "SendMailRequestMailSettingsBypassSpamManagement", + "SendMailRequestMailSettingsBypassUnsubscribeManagement", + "SendMailRequestMailSettingsFooter", + "SendMailRequestMailSettingsSandboxMode", + "SendMailRequestPersonalizationsInner", + "SendMailRequestTrackingSettings", + "SendMailRequestTrackingSettingsClickTracking", + "SendMailRequestTrackingSettingsGanalytics", + "SendMailRequestTrackingSettingsOpenTracking", + "SendMailRequestTrackingSettingsSubscriptionTracking", +] +# Testing code diff --git a/sendgrid/rest/api/mail/v3/models/content_encoding.py b/sendgrid/rest/api/mail/v3/models/content_encoding.py index 3d42839d..effc5307 100644 --- a/sendgrid/rest/api/mail/v3/models/content_encoding.py +++ b/sendgrid/rest/api/mail/v3/models/content_encoding.py @@ -1,10 +1,6 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class ContentEncoding(Enum): - GZIP='gzip' - + GZIP = "gzip" diff --git a/sendgrid/rest/api/mail/v3/models/disposition.py b/sendgrid/rest/api/mail/v3/models/disposition.py index af38ca8e..b68290a6 100644 --- a/sendgrid/rest/api/mail/v3/models/disposition.py +++ b/sendgrid/rest/api/mail/v3/models/disposition.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Disposition(Enum): - INLINE='inline' - ATTACHMENT='attachment' - + INLINE = "inline" + ATTACHMENT = "attachment" diff --git a/sendgrid/rest/api/mail/v3/models/error_response.py b/sendgrid/rest/api/mail/v3/models/error_response.py index 8d01af00..d4e780fe 100644 --- a/sendgrid/rest/api/mail/v3/models/error_response.py +++ b/sendgrid/rest/api/mail/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mail.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.mail.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/mail/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/mail/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/mail/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/mail/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/mail/v3/models/mail_batch_response.py b/sendgrid/rest/api/mail/v3/models/mail_batch_response.py index dcc52332..e35bbcf4 100644 --- a/sendgrid/rest/api/mail/v3/models/mail_batch_response.py +++ b/sendgrid/rest/api/mail/v3/models/mail_batch_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class MailBatchResponse: - def __init__( - self, - batch_id: Optional[str]=None - ): - self.batch_id=batch_id + def __init__(self, batch_id: Optional[str] = None): + self.batch_id = batch_id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "batch_id": self.batch_id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"batch_id": self.batch_id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return MailBatchResponse( - batch_id=payload.get('batch_id') - ) - + return MailBatchResponse(batch_id=payload.get("batch_id")) diff --git a/sendgrid/rest/api/mail/v3/models/mail_from.py b/sendgrid/rest/api/mail/v3/models/mail_from.py index 28ecc034..a487a8d2 100644 --- a/sendgrid/rest/api/mail/v3/models/mail_from.py +++ b/sendgrid/rest/api/mail/v3/models/mail_from.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class MailFrom: - def __init__( - self, - email: Optional[str]=None, - name: Optional[str]=None - ): - self.email=email - self.name=name + def __init__(self, email: Optional[str] = None, name: Optional[str] = None): + self.email = email + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email, - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email, "name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -27,8 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return MailFrom( - email=payload.get('email'), - name=payload.get('name') - ) - + return MailFrom(email=payload.get("email"), name=payload.get("name")) diff --git a/sendgrid/rest/api/mail/v3/models/mail_to.py b/sendgrid/rest/api/mail/v3/models/mail_to.py index ad9c8345..9f8e83bc 100644 --- a/sendgrid/rest/api/mail/v3/models/mail_to.py +++ b/sendgrid/rest/api/mail/v3/models/mail_to.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class MailTo: - def __init__( - self, - email: Optional[str]=None, - name: Optional[str]=None - ): - self.email=email - self.name=name + def __init__(self, email: Optional[str] = None, name: Optional[str] = None): + self.email = email + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email, - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email, "name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -27,8 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return MailTo( - email=payload.get('email'), - name=payload.get('name') - ) - + return MailTo(email=payload.get("email"), name=payload.get("name")) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request.py b/sendgrid/rest/api/mail/v3/models/send_mail_request.py index c53c274f..8dcf0ad7 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request.py @@ -1,78 +1,88 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mail.v3.models.mail_from import MailFrom from sendgrid.rest.api.mail.v3.models.mail_to import MailTo from sendgrid.rest.api.mail.v3.models.send_mail_request_asm import SendMailRequestAsm -from sendgrid.rest.api.mail.v3.models.send_mail_request_attachments_inner import SendMailRequestAttachmentsInner -from sendgrid.rest.api.mail.v3.models.send_mail_request_content_inner import SendMailRequestContentInner -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings import SendMailRequestMailSettings -from sendgrid.rest.api.mail.v3.models.send_mail_request_personalizations_inner import SendMailRequestPersonalizationsInner -from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings import SendMailRequestTrackingSettings - +from sendgrid.rest.api.mail.v3.models.send_mail_request_attachments_inner import ( + SendMailRequestAttachmentsInner, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_content_inner import ( + SendMailRequestContentInner, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings import ( + SendMailRequestMailSettings, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_personalizations_inner import ( + SendMailRequestPersonalizationsInner, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings import ( + SendMailRequestTrackingSettings, +) class SendMailRequest: def __init__( - self, - personalizations: Optional[List[SendMailRequestPersonalizationsInner]]=None, - var_from: Optional[MailFrom]=None, - reply_to: Optional[MailTo]=None, - reply_to_list: Optional[List[MailTo]]=None, - subject: Optional[str]=None, - content: Optional[List[SendMailRequestContentInner]]=None, - attachments: Optional[List[SendMailRequestAttachmentsInner]]=None, - template_id: Optional[str]=None, - headers: Optional[object]=None, - categories: Optional[List[str]]=None, - custom_args: Optional[str]=None, - send_at: Optional[int]=None, - batch_id: Optional[str]=None, - asm: Optional[SendMailRequestAsm]=None, - ip_pool_name: Optional[str]=None, - mail_settings: Optional[SendMailRequestMailSettings]=None, - tracking_settings: Optional[SendMailRequestTrackingSettings]=None + self, + personalizations: Optional[List[SendMailRequestPersonalizationsInner]] = None, + var_from: Optional[MailFrom] = None, + reply_to: Optional[MailTo] = None, + reply_to_list: Optional[List[MailTo]] = None, + subject: Optional[str] = None, + content: Optional[List[SendMailRequestContentInner]] = None, + attachments: Optional[List[SendMailRequestAttachmentsInner]] = None, + template_id: Optional[str] = None, + headers: Optional[object] = None, + categories: Optional[List[str]] = None, + custom_args: Optional[str] = None, + send_at: Optional[int] = None, + batch_id: Optional[str] = None, + asm: Optional[SendMailRequestAsm] = None, + ip_pool_name: Optional[str] = None, + mail_settings: Optional[SendMailRequestMailSettings] = None, + tracking_settings: Optional[SendMailRequestTrackingSettings] = None, ): - self.personalizations=personalizations - self.var_from=var_from - self.reply_to=reply_to - self.reply_to_list=reply_to_list - self.subject=subject - self.content=content - self.attachments=attachments - self.template_id=template_id - self.headers=headers - self.categories=categories - self.custom_args=custom_args - self.send_at=send_at - self.batch_id=batch_id - self.asm=asm - self.ip_pool_name=ip_pool_name - self.mail_settings=mail_settings - self.tracking_settings=tracking_settings + self.personalizations = personalizations + self.var_from = var_from + self.reply_to = reply_to + self.reply_to_list = reply_to_list + self.subject = subject + self.content = content + self.attachments = attachments + self.template_id = template_id + self.headers = headers + self.categories = categories + self.custom_args = custom_args + self.send_at = send_at + self.batch_id = batch_id + self.asm = asm + self.ip_pool_name = ip_pool_name + self.mail_settings = mail_settings + self.tracking_settings = tracking_settings def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "personalizations": self.personalizations, - "from": self.var_from, - "reply_to": self.reply_to, - "reply_to_list": self.reply_to_list, - "subject": self.subject, - "content": self.content, - "attachments": self.attachments, - "template_id": self.template_id, - "headers": self.headers, - "categories": self.categories, - "custom_args": self.custom_args, - "send_at": self.send_at, - "batch_id": self.batch_id, - "asm": self.asm, - "ip_pool_name": self.ip_pool_name, - "mail_settings": self.mail_settings, - "tracking_settings": self.tracking_settings - }.items() if value is not None} + "personalizations": self.personalizations, + "from": self.var_from, + "reply_to": self.reply_to, + "reply_to_list": self.reply_to_list, + "subject": self.subject, + "content": self.content, + "attachments": self.attachments, + "template_id": self.template_id, + "headers": self.headers, + "categories": self.categories, + "custom_args": self.custom_args, + "send_at": self.send_at, + "batch_id": self.batch_id, + "asm": self.asm, + "ip_pool_name": self.ip_pool_name, + "mail_settings": self.mail_settings, + "tracking_settings": self.tracking_settings, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -81,22 +91,21 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequest( - personalizations=payload.get('personalizations'), - var_from=payload.get('from'), - reply_to=payload.get('reply_to'), - reply_to_list=payload.get('reply_to_list'), - subject=payload.get('subject'), - content=payload.get('content'), - attachments=payload.get('attachments'), - template_id=payload.get('template_id'), - headers=payload.get('headers'), - categories=payload.get('categories'), - custom_args=payload.get('custom_args'), - send_at=payload.get('send_at'), - batch_id=payload.get('batch_id'), - asm=payload.get('asm'), - ip_pool_name=payload.get('ip_pool_name'), - mail_settings=payload.get('mail_settings'), - tracking_settings=payload.get('tracking_settings') - ) - + personalizations=payload.get("personalizations"), + var_from=payload.get("from"), + reply_to=payload.get("reply_to"), + reply_to_list=payload.get("reply_to_list"), + subject=payload.get("subject"), + content=payload.get("content"), + attachments=payload.get("attachments"), + template_id=payload.get("template_id"), + headers=payload.get("headers"), + categories=payload.get("categories"), + custom_args=payload.get("custom_args"), + send_at=payload.get("send_at"), + batch_id=payload.get("batch_id"), + asm=payload.get("asm"), + ip_pool_name=payload.get("ip_pool_name"), + mail_settings=payload.get("mail_settings"), + tracking_settings=payload.get("tracking_settings"), + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_asm.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_asm.py index c2f117db..9ca34fe6 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_asm.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_asm.py @@ -1,25 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendMailRequestAsm: def __init__( - self, - group_id: Optional[int]=None, - groups_to_display: Optional[List[int]]=None + self, + group_id: Optional[int] = None, + groups_to_display: Optional[List[int]] = None, ): - self.group_id=group_id - self.groups_to_display=groups_to_display + self.group_id = group_id + self.groups_to_display = groups_to_display def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "group_id": self.group_id, - "groups_to_display": self.groups_to_display - }.items() if value is not None} + "group_id": self.group_id, + "groups_to_display": self.groups_to_display, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +28,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestAsm( - group_id=payload.get('group_id'), - groups_to_display=payload.get('groups_to_display') - ) - + group_id=payload.get("group_id"), + groups_to_display=payload.get("groups_to_display"), + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_attachments_inner.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_attachments_inner.py index e5aeabeb..2142ca96 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_attachments_inner.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_attachments_inner.py @@ -1,35 +1,35 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mail.v3.models.disposition import Disposition - class SendMailRequestAttachmentsInner: def __init__( - self, - content: Optional[str]=None, - type: Optional[str]=None, - filename: Optional[str]=None, - disposition: Optional[Disposition]=None, - content_id: Optional[str]=None + self, + content: Optional[str] = None, + type: Optional[str] = None, + filename: Optional[str] = None, + disposition: Optional[Disposition] = None, + content_id: Optional[str] = None, ): - self.content=content - self.type=type - self.filename=filename - self.disposition=disposition - self.content_id=content_id + self.content = content + self.type = type + self.filename = filename + self.disposition = disposition + self.content_id = content_id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "content": self.content, - "type": self.type, - "filename": self.filename, - "disposition": self.disposition, - "content_id": self.content_id - }.items() if value is not None} + "content": self.content, + "type": self.type, + "filename": self.filename, + "disposition": self.disposition, + "content_id": self.content_id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -38,10 +38,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestAttachmentsInner( - content=payload.get('content'), - type=payload.get('type'), - filename=payload.get('filename'), - disposition=payload.get('disposition'), - content_id=payload.get('content_id') - ) - + content=payload.get("content"), + type=payload.get("type"), + filename=payload.get("filename"), + disposition=payload.get("disposition"), + content_id=payload.get("content_id"), + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_content_inner.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_content_inner.py index dd2b241f..bc81a6c4 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_content_inner.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_content_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendMailRequestContentInner: - def __init__( - self, - type: Optional[str]=None, - value: Optional[str]=None - ): - self.type=type - self.value=value + def __init__(self, type: Optional[str] = None, value: Optional[str] = None): + self.type = type + self.value = value def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "type": self.type, - "value": self.value - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"type": self.type, "value": self.value}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestContentInner( - type=payload.get('type'), - value=payload.get('value') - ) - + type=payload.get("type"), value=payload.get("value") + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings.py index 47a7332a..66ba00fb 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings.py @@ -1,43 +1,63 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_bounce_management import SendMailRequestMailSettingsBypassBounceManagement -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_list_management import SendMailRequestMailSettingsBypassListManagement -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_spam_management import SendMailRequestMailSettingsBypassSpamManagement -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_unsubscribe_management import SendMailRequestMailSettingsBypassUnsubscribeManagement -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_footer import SendMailRequestMailSettingsFooter -from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_sandbox_mode import SendMailRequestMailSettingsSandboxMode - +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_bounce_management import ( + SendMailRequestMailSettingsBypassBounceManagement, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_list_management import ( + SendMailRequestMailSettingsBypassListManagement, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_spam_management import ( + SendMailRequestMailSettingsBypassSpamManagement, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_bypass_unsubscribe_management import ( + SendMailRequestMailSettingsBypassUnsubscribeManagement, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_footer import ( + SendMailRequestMailSettingsFooter, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_mail_settings_sandbox_mode import ( + SendMailRequestMailSettingsSandboxMode, +) class SendMailRequestMailSettings: def __init__( - self, - bypass_list_management: Optional[SendMailRequestMailSettingsBypassListManagement]=None, - bypass_spam_management: Optional[SendMailRequestMailSettingsBypassSpamManagement]=None, - bypass_bounce_management: Optional[SendMailRequestMailSettingsBypassBounceManagement]=None, - bypass_unsubscribe_management: Optional[SendMailRequestMailSettingsBypassUnsubscribeManagement]=None, - footer: Optional[SendMailRequestMailSettingsFooter]=None, - sandbox_mode: Optional[SendMailRequestMailSettingsSandboxMode]=None + self, + bypass_list_management: Optional[ + SendMailRequestMailSettingsBypassListManagement + ] = None, + bypass_spam_management: Optional[ + SendMailRequestMailSettingsBypassSpamManagement + ] = None, + bypass_bounce_management: Optional[ + SendMailRequestMailSettingsBypassBounceManagement + ] = None, + bypass_unsubscribe_management: Optional[ + SendMailRequestMailSettingsBypassUnsubscribeManagement + ] = None, + footer: Optional[SendMailRequestMailSettingsFooter] = None, + sandbox_mode: Optional[SendMailRequestMailSettingsSandboxMode] = None, ): - self.bypass_list_management=bypass_list_management - self.bypass_spam_management=bypass_spam_management - self.bypass_bounce_management=bypass_bounce_management - self.bypass_unsubscribe_management=bypass_unsubscribe_management - self.footer=footer - self.sandbox_mode=sandbox_mode + self.bypass_list_management = bypass_list_management + self.bypass_spam_management = bypass_spam_management + self.bypass_bounce_management = bypass_bounce_management + self.bypass_unsubscribe_management = bypass_unsubscribe_management + self.footer = footer + self.sandbox_mode = sandbox_mode def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "bypass_list_management": self.bypass_list_management, - "bypass_spam_management": self.bypass_spam_management, - "bypass_bounce_management": self.bypass_bounce_management, - "bypass_unsubscribe_management": self.bypass_unsubscribe_management, - "footer": self.footer, - "sandbox_mode": self.sandbox_mode - }.items() if value is not None} + "bypass_list_management": self.bypass_list_management, + "bypass_spam_management": self.bypass_spam_management, + "bypass_bounce_management": self.bypass_bounce_management, + "bypass_unsubscribe_management": self.bypass_unsubscribe_management, + "footer": self.footer, + "sandbox_mode": self.sandbox_mode, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -46,11 +66,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestMailSettings( - bypass_list_management=payload.get('bypass_list_management'), - bypass_spam_management=payload.get('bypass_spam_management'), - bypass_bounce_management=payload.get('bypass_bounce_management'), - bypass_unsubscribe_management=payload.get('bypass_unsubscribe_management'), - footer=payload.get('footer'), - sandbox_mode=payload.get('sandbox_mode') - ) - + bypass_list_management=payload.get("bypass_list_management"), + bypass_spam_management=payload.get("bypass_spam_management"), + bypass_bounce_management=payload.get("bypass_bounce_management"), + bypass_unsubscribe_management=payload.get("bypass_unsubscribe_management"), + footer=payload.get("footer"), + sandbox_mode=payload.get("sandbox_mode"), + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_bounce_management.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_bounce_management.py index f8403aa8..1e395e76 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_bounce_management.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_bounce_management.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendMailRequestMailSettingsBypassBounceManagement: - def __init__( - self, - enable: Optional[bool]=None - ): - self.enable=enable + def __init__(self, enable: Optional[bool] = None): + self.enable = enable def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "enable": self.enable - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"enable": self.enable}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,6 +20,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestMailSettingsBypassBounceManagement( - enable=payload.get('enable') - ) - + enable=payload.get("enable") + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_list_management.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_list_management.py index fb64f700..76e457ba 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_list_management.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_list_management.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendMailRequestMailSettingsBypassListManagement: - def __init__( - self, - enable: Optional[bool]=None - ): - self.enable=enable + def __init__(self, enable: Optional[bool] = None): + self.enable = enable def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "enable": self.enable - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"enable": self.enable}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,6 +20,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestMailSettingsBypassListManagement( - enable=payload.get('enable') - ) - + enable=payload.get("enable") + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_spam_management.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_spam_management.py index 282de6a3..c2b2a7a2 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_spam_management.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_spam_management.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendMailRequestMailSettingsBypassSpamManagement: - def __init__( - self, - enable: Optional[bool]=None - ): - self.enable=enable + def __init__(self, enable: Optional[bool] = None): + self.enable = enable def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "enable": self.enable - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"enable": self.enable}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,6 +20,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestMailSettingsBypassSpamManagement( - enable=payload.get('enable') - ) - + enable=payload.get("enable") + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_unsubscribe_management.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_unsubscribe_management.py index 3b529dd9..a9395e44 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_unsubscribe_management.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_bypass_unsubscribe_management.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendMailRequestMailSettingsBypassUnsubscribeManagement: - def __init__( - self, - enable: Optional[bool]=None - ): - self.enable=enable + def __init__(self, enable: Optional[bool] = None): + self.enable = enable def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "enable": self.enable - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"enable": self.enable}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,6 +20,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestMailSettingsBypassUnsubscribeManagement( - enable=payload.get('enable') - ) - + enable=payload.get("enable") + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_footer.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_footer.py index 766a55df..7c5beb19 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_footer.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_footer.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendMailRequestMailSettingsFooter: def __init__( - self, - enable: Optional[bool]=None, - text: Optional[str]=None, - html: Optional[str]=None + self, + enable: Optional[bool] = None, + text: Optional[str] = None, + html: Optional[str] = None, ): - self.enable=enable - self.text=text - self.html=html + self.enable = enable + self.text = text + self.html = html def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enable": self.enable, - "text": self.text, - "html": self.html - }.items() if value is not None} + "enable": self.enable, + "text": self.text, + "html": self.html, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestMailSettingsFooter( - enable=payload.get('enable'), - text=payload.get('text'), - html=payload.get('html') - ) - + enable=payload.get("enable"), + text=payload.get("text"), + html=payload.get("html"), + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_sandbox_mode.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_sandbox_mode.py index d842111c..e1e390ef 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_sandbox_mode.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_mail_settings_sandbox_mode.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendMailRequestMailSettingsSandboxMode: - def __init__( - self, - enable: Optional[bool]=None - ): - self.enable=enable + def __init__(self, enable: Optional[bool] = None): + self.enable = enable def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "enable": self.enable - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"enable": self.enable}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SendMailRequestMailSettingsSandboxMode( - enable=payload.get('enable') - ) - + return SendMailRequestMailSettingsSandboxMode(enable=payload.get("enable")) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_personalizations_inner.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_personalizations_inner.py index aa5bf610..212dec09 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_personalizations_inner.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_personalizations_inner.py @@ -1,51 +1,51 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mail.v3.models.mail_from import MailFrom from sendgrid.rest.api.mail.v3.models.mail_to import MailTo - class SendMailRequestPersonalizationsInner: def __init__( - self, - var_from: Optional[MailFrom]=None, - to: Optional[List[MailTo]]=None, - cc: Optional[List[MailTo]]=None, - bcc: Optional[List[MailTo]]=None, - subject: Optional[str]=None, - headers: Optional[object]=None, - substitutions: Optional[Dict[str, str]]=None, - dynamic_template_data: Optional[object]=None, - custom_args: Optional[object]=None, - send_at: Optional[int]=None + self, + var_from: Optional[MailFrom] = None, + to: Optional[List[MailTo]] = None, + cc: Optional[List[MailTo]] = None, + bcc: Optional[List[MailTo]] = None, + subject: Optional[str] = None, + headers: Optional[object] = None, + substitutions: Optional[Dict[str, str]] = None, + dynamic_template_data: Optional[object] = None, + custom_args: Optional[object] = None, + send_at: Optional[int] = None, ): - self.var_from=var_from - self.to=to - self.cc=cc - self.bcc=bcc - self.subject=subject - self.headers=headers - self.substitutions=substitutions - self.dynamic_template_data=dynamic_template_data - self.custom_args=custom_args - self.send_at=send_at + self.var_from = var_from + self.to = to + self.cc = cc + self.bcc = bcc + self.subject = subject + self.headers = headers + self.substitutions = substitutions + self.dynamic_template_data = dynamic_template_data + self.custom_args = custom_args + self.send_at = send_at def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "from": self.var_from, - "to": self.to, - "cc": self.cc, - "bcc": self.bcc, - "subject": self.subject, - "headers": self.headers, - "substitutions": self.substitutions, - "dynamic_template_data": self.dynamic_template_data, - "custom_args": self.custom_args, - "send_at": self.send_at - }.items() if value is not None} + "from": self.var_from, + "to": self.to, + "cc": self.cc, + "bcc": self.bcc, + "subject": self.subject, + "headers": self.headers, + "substitutions": self.substitutions, + "dynamic_template_data": self.dynamic_template_data, + "custom_args": self.custom_args, + "send_at": self.send_at, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -54,15 +54,14 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestPersonalizationsInner( - var_from=payload.get('from'), - to=payload.get('to'), - cc=payload.get('cc'), - bcc=payload.get('bcc'), - subject=payload.get('subject'), - headers=payload.get('headers'), - substitutions=payload.get('substitutions'), - dynamic_template_data=payload.get('dynamic_template_data'), - custom_args=payload.get('custom_args'), - send_at=payload.get('send_at') - ) - + var_from=payload.get("from"), + to=payload.get("to"), + cc=payload.get("cc"), + bcc=payload.get("bcc"), + subject=payload.get("subject"), + headers=payload.get("headers"), + substitutions=payload.get("substitutions"), + dynamic_template_data=payload.get("dynamic_template_data"), + custom_args=payload.get("custom_args"), + send_at=payload.get("send_at"), + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings.py index efe019b9..85ae5c59 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings.py @@ -1,35 +1,45 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_click_tracking import SendMailRequestTrackingSettingsClickTracking -from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_ganalytics import SendMailRequestTrackingSettingsGanalytics -from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_open_tracking import SendMailRequestTrackingSettingsOpenTracking -from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_subscription_tracking import SendMailRequestTrackingSettingsSubscriptionTracking - +from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_click_tracking import ( + SendMailRequestTrackingSettingsClickTracking, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_ganalytics import ( + SendMailRequestTrackingSettingsGanalytics, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_open_tracking import ( + SendMailRequestTrackingSettingsOpenTracking, +) +from sendgrid.rest.api.mail.v3.models.send_mail_request_tracking_settings_subscription_tracking import ( + SendMailRequestTrackingSettingsSubscriptionTracking, +) class SendMailRequestTrackingSettings: def __init__( - self, - click_tracking: Optional[SendMailRequestTrackingSettingsClickTracking]=None, - open_tracking: Optional[SendMailRequestTrackingSettingsOpenTracking]=None, - subscription_tracking: Optional[SendMailRequestTrackingSettingsSubscriptionTracking]=None, - ganalytics: Optional[SendMailRequestTrackingSettingsGanalytics]=None + self, + click_tracking: Optional[SendMailRequestTrackingSettingsClickTracking] = None, + open_tracking: Optional[SendMailRequestTrackingSettingsOpenTracking] = None, + subscription_tracking: Optional[ + SendMailRequestTrackingSettingsSubscriptionTracking + ] = None, + ganalytics: Optional[SendMailRequestTrackingSettingsGanalytics] = None, ): - self.click_tracking=click_tracking - self.open_tracking=open_tracking - self.subscription_tracking=subscription_tracking - self.ganalytics=ganalytics + self.click_tracking = click_tracking + self.open_tracking = open_tracking + self.subscription_tracking = subscription_tracking + self.ganalytics = ganalytics def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "click_tracking": self.click_tracking, - "open_tracking": self.open_tracking, - "subscription_tracking": self.subscription_tracking, - "ganalytics": self.ganalytics - }.items() if value is not None} + "click_tracking": self.click_tracking, + "open_tracking": self.open_tracking, + "subscription_tracking": self.subscription_tracking, + "ganalytics": self.ganalytics, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -38,9 +48,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestTrackingSettings( - click_tracking=payload.get('click_tracking'), - open_tracking=payload.get('open_tracking'), - subscription_tracking=payload.get('subscription_tracking'), - ganalytics=payload.get('ganalytics') - ) - + click_tracking=payload.get("click_tracking"), + open_tracking=payload.get("open_tracking"), + subscription_tracking=payload.get("subscription_tracking"), + ganalytics=payload.get("ganalytics"), + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_click_tracking.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_click_tracking.py index 29185878..02e57388 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_click_tracking.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_click_tracking.py @@ -1,25 +1,23 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendMailRequestTrackingSettingsClickTracking: def __init__( - self, - enable: Optional[bool]=None, - enable_text: Optional[bool]=None + self, enable: Optional[bool] = None, enable_text: Optional[bool] = None ): - self.enable=enable - self.enable_text=enable_text + self.enable = enable + self.enable_text = enable_text def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enable": self.enable, - "enable_text": self.enable_text - }.items() if value is not None} + "enable": self.enable, + "enable_text": self.enable_text, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +26,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestTrackingSettingsClickTracking( - enable=payload.get('enable'), - enable_text=payload.get('enable_text') - ) - + enable=payload.get("enable"), enable_text=payload.get("enable_text") + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_ganalytics.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_ganalytics.py index 8b751e9f..7cdf500a 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_ganalytics.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_ganalytics.py @@ -1,37 +1,37 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendMailRequestTrackingSettingsGanalytics: def __init__( - self, - enable: Optional[bool]=None, - utm_source: Optional[str]=None, - utm_medium: Optional[str]=None, - utm_term: Optional[str]=None, - utm_content: Optional[str]=None, - utm_campaign: Optional[str]=None + self, + enable: Optional[bool] = None, + utm_source: Optional[str] = None, + utm_medium: Optional[str] = None, + utm_term: Optional[str] = None, + utm_content: Optional[str] = None, + utm_campaign: Optional[str] = None, ): - self.enable=enable - self.utm_source=utm_source - self.utm_medium=utm_medium - self.utm_term=utm_term - self.utm_content=utm_content - self.utm_campaign=utm_campaign + self.enable = enable + self.utm_source = utm_source + self.utm_medium = utm_medium + self.utm_term = utm_term + self.utm_content = utm_content + self.utm_campaign = utm_campaign def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enable": self.enable, - "utm_source": self.utm_source, - "utm_medium": self.utm_medium, - "utm_term": self.utm_term, - "utm_content": self.utm_content, - "utm_campaign": self.utm_campaign - }.items() if value is not None} + "enable": self.enable, + "utm_source": self.utm_source, + "utm_medium": self.utm_medium, + "utm_term": self.utm_term, + "utm_content": self.utm_content, + "utm_campaign": self.utm_campaign, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -40,11 +40,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestTrackingSettingsGanalytics( - enable=payload.get('enable'), - utm_source=payload.get('utm_source'), - utm_medium=payload.get('utm_medium'), - utm_term=payload.get('utm_term'), - utm_content=payload.get('utm_content'), - utm_campaign=payload.get('utm_campaign') - ) - + enable=payload.get("enable"), + utm_source=payload.get("utm_source"), + utm_medium=payload.get("utm_medium"), + utm_term=payload.get("utm_term"), + utm_content=payload.get("utm_content"), + utm_campaign=payload.get("utm_campaign"), + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_open_tracking.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_open_tracking.py index 4f3cede1..282743a3 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_open_tracking.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_open_tracking.py @@ -1,25 +1,23 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendMailRequestTrackingSettingsOpenTracking: def __init__( - self, - enable: Optional[bool]=None, - substitution_tag: Optional[str]=None + self, enable: Optional[bool] = None, substitution_tag: Optional[str] = None ): - self.enable=enable - self.substitution_tag=substitution_tag + self.enable = enable + self.substitution_tag = substitution_tag def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enable": self.enable, - "substitution_tag": self.substitution_tag - }.items() if value is not None} + "enable": self.enable, + "substitution_tag": self.substitution_tag, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +26,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestTrackingSettingsOpenTracking( - enable=payload.get('enable'), - substitution_tag=payload.get('substitution_tag') - ) - + enable=payload.get("enable"), + substitution_tag=payload.get("substitution_tag"), + ) diff --git a/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_subscription_tracking.py b/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_subscription_tracking.py index bafa40f6..f271c9eb 100644 --- a/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_subscription_tracking.py +++ b/sendgrid/rest/api/mail/v3/models/send_mail_request_tracking_settings_subscription_tracking.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendMailRequestTrackingSettingsSubscriptionTracking: def __init__( - self, - enable: Optional[bool]=None, - text: Optional[str]=None, - html: Optional[str]=None, - substitution_tag: Optional[str]=None + self, + enable: Optional[bool] = None, + text: Optional[str] = None, + html: Optional[str] = None, + substitution_tag: Optional[str] = None, ): - self.enable=enable - self.text=text - self.html=html - self.substitution_tag=substitution_tag + self.enable = enable + self.text = text + self.html = html + self.substitution_tag = substitution_tag def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enable": self.enable, - "text": self.text, - "html": self.html, - "substitution_tag": self.substitution_tag - }.items() if value is not None} + "enable": self.enable, + "text": self.text, + "html": self.html, + "substitution_tag": self.substitution_tag, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendMailRequestTrackingSettingsSubscriptionTracking( - enable=payload.get('enable'), - text=payload.get('text'), - html=payload.get('html'), - substitution_tag=payload.get('substitution_tag') - ) - + enable=payload.get("enable"), + text=payload.get("text"), + html=payload.get("html"), + substitution_tag=payload.get("substitution_tag"), + ) diff --git a/sendgrid/rest/api/mail/v3/send_mail.py b/sendgrid/rest/api/mail/v3/send_mail.py index 43031ed9..46cfb2b8 100644 --- a/sendgrid/rest/api/mail/v3/send_mail.py +++ b/sendgrid/rest/api/mail/v3/send_mail.py @@ -12,55 +12,53 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.mail.v3.models.content_encoding import ContentEncoding from sendgrid.rest.api.mail.v3.models.send_mail_request import SendMailRequest + class SendMail: def __init__(self, client) -> None: self.client = client - + def send( self, - content_encoding: Optional[ContentEncoding] = None, - send_mail_request: Optional[SendMailRequest] = None, - + content_encoding: Optional[ContentEncoding] = None, + send_mail_request: Optional[SendMailRequest] = None, ): - path='/v3/mail/send' + path = "/v3/mail/send" headers = values.of( - { - 'Content-Encoding': content_encoding, - }) + { + "Content-Encoding": content_encoding, + } + ) headers["Content-Type"] = "application/json" data = None if send_mail_request: data = send_mail_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail_settings/v3/__init__.py b/sendgrid/rest/api/mail_settings/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/mail_settings/v3/__init__.py +++ b/sendgrid/rest/api/mail_settings/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/mail_settings/v3/list_address_whitelist.py b/sendgrid/rest/api/mail_settings/v3/list_address_whitelist.py index ac1a65fa..0b737c70 100644 --- a/sendgrid/rest/api/mail_settings/v3/list_address_whitelist.py +++ b/sendgrid/rest/api/mail_settings/v3/list_address_whitelist.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_address_whitelabel200 import MailSettingsAddressWhitelabel200 + class ListAddressWhitelist: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/mail_settings/address_whitelist' + path = "/v3/mail_settings/address_whitelist" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail_settings/v3/list_bounce_purge.py b/sendgrid/rest/api/mail_settings/v3/list_bounce_purge.py index 415325f8..195f47be 100644 --- a/sendgrid/rest/api/mail_settings/v3/list_bounce_purge.py +++ b/sendgrid/rest/api/mail_settings/v3/list_bounce_purge.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_bounce_purge import MailSettingsBouncePurge + class ListBouncePurge: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/mail_settings/bounce_purge' + path = "/v3/mail_settings/bounce_purge" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail_settings/v3/list_footer.py b/sendgrid/rest/api/mail_settings/v3/list_footer.py index bfb75e4a..e237473d 100644 --- a/sendgrid/rest/api/mail_settings/v3/list_footer.py +++ b/sendgrid/rest/api/mail_settings/v3/list_footer.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_footer import MailSettingsFooter + class ListFooter: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/mail_settings/footer' + path = "/v3/mail_settings/footer" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail_settings/v3/list_forward_bounce.py b/sendgrid/rest/api/mail_settings/v3/list_forward_bounce.py index c8aba9f6..4c43c52e 100644 --- a/sendgrid/rest/api/mail_settings/v3/list_forward_bounce.py +++ b/sendgrid/rest/api/mail_settings/v3/list_forward_bounce.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_forward_bounce import MailSettingsForwardBounce + class ListForwardBounce: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/mail_settings/forward_bounce' + path = "/v3/mail_settings/forward_bounce" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail_settings/v3/list_forward_spam.py b/sendgrid/rest/api/mail_settings/v3/list_forward_spam.py index 3a5fd08c..e6412064 100644 --- a/sendgrid/rest/api/mail_settings/v3/list_forward_spam.py +++ b/sendgrid/rest/api/mail_settings/v3/list_forward_spam.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_forward_spam import MailSettingsForwardSpam + class ListForwardSpam: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/mail_settings/forward_spam' + path = "/v3/mail_settings/forward_spam" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail_settings/v3/list_mail_setting.py b/sendgrid/rest/api/mail_settings/v3/list_mail_setting.py index c117ab7a..03896ab0 100644 --- a/sendgrid/rest/api/mail_settings/v3/list_mail_setting.py +++ b/sendgrid/rest/api/mail_settings/v3/list_mail_setting.py @@ -12,52 +12,49 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail_settings.v3.models.list_mail_setting200_response import ListMailSetting200Response + class ListMailSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - + on_behalf_of: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, ): - path='/v3/mail_settings' + path = "/v3/mail_settings" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail_settings/v3/list_template.py b/sendgrid/rest/api/mail_settings/v3/list_template.py index 2bd760b3..d7c72c0a 100644 --- a/sendgrid/rest/api/mail_settings/v3/list_template.py +++ b/sendgrid/rest/api/mail_settings/v3/list_template.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_template200 import MailSettingsTemplate200 + class ListTemplate: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/mail_settings/template' + path = "/v3/mail_settings/template" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail_settings/v3/models/__init__.py b/sendgrid/rest/api/mail_settings/v3/models/__init__.py index e13e9a14..ab0d8d53 100644 --- a/sendgrid/rest/api/mail_settings/v3/models/__init__.py +++ b/sendgrid/rest/api/mail_settings/v3/models/__init__.py @@ -11,18 +11,52 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.mail_settings.v3.models.list_mail_setting200_response import ListMailSetting200Response -from sendgrid.rest.api.mail_settings.v3.models.list_mail_setting200_response_result_inner import ListMailSetting200ResponseResultInner -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_address_whitelabel200 import MailSettingsAddressWhitelabel200 -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_bounce_purge import MailSettingsBouncePurge -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_footer import MailSettingsFooter -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_forward_bounce import MailSettingsForwardBounce -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_forward_spam import MailSettingsForwardSpam -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_template200 import MailSettingsTemplate200 -from sendgrid.rest.api.mail_settings.v3.models.update_address_whitelist_request import UpdateAddressWhitelistRequest -from sendgrid.rest.api.mail_settings.v3.models.update_template200_response import UpdateTemplate200Response -from sendgrid.rest.api.mail_settings.v3.models.update_template_request import UpdateTemplateRequest -__all__ = [ 'ListMailSetting200Response', 'ListMailSetting200ResponseResultInner', 'MailSettingsAddressWhitelabel200', 'MailSettingsBouncePurge', 'MailSettingsFooter', 'MailSettingsForwardBounce', 'MailSettingsForwardSpam', 'MailSettingsTemplate200', 'UpdateAddressWhitelistRequest', 'UpdateTemplate200Response', 'UpdateTemplateRequest' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.mail_settings.v3.models.list_mail_setting200_response import ( + ListMailSetting200Response, +) +from sendgrid.rest.api.mail_settings.v3.models.list_mail_setting200_response_result_inner import ( + ListMailSetting200ResponseResultInner, +) +from sendgrid.rest.api.mail_settings.v3.models.mail_settings_address_whitelabel200 import ( + MailSettingsAddressWhitelabel200, +) +from sendgrid.rest.api.mail_settings.v3.models.mail_settings_bounce_purge import ( + MailSettingsBouncePurge, +) +from sendgrid.rest.api.mail_settings.v3.models.mail_settings_footer import ( + MailSettingsFooter, +) +from sendgrid.rest.api.mail_settings.v3.models.mail_settings_forward_bounce import ( + MailSettingsForwardBounce, +) +from sendgrid.rest.api.mail_settings.v3.models.mail_settings_forward_spam import ( + MailSettingsForwardSpam, +) +from sendgrid.rest.api.mail_settings.v3.models.mail_settings_template200 import ( + MailSettingsTemplate200, +) +from sendgrid.rest.api.mail_settings.v3.models.update_address_whitelist_request import ( + UpdateAddressWhitelistRequest, +) +from sendgrid.rest.api.mail_settings.v3.models.update_template200_response import ( + UpdateTemplate200Response, +) +from sendgrid.rest.api.mail_settings.v3.models.update_template_request import ( + UpdateTemplateRequest, +) + +__all__ = [ + "ListMailSetting200Response", + "ListMailSetting200ResponseResultInner", + "MailSettingsAddressWhitelabel200", + "MailSettingsBouncePurge", + "MailSettingsFooter", + "MailSettingsForwardBounce", + "MailSettingsForwardSpam", + "MailSettingsTemplate200", + "UpdateAddressWhitelistRequest", + "UpdateTemplate200Response", + "UpdateTemplateRequest", +] +# Testing code diff --git a/sendgrid/rest/api/mail_settings/v3/models/list_mail_setting200_response.py b/sendgrid/rest/api/mail_settings/v3/models/list_mail_setting200_response.py index b70d3792..014fddea 100644 --- a/sendgrid/rest/api/mail_settings/v3/models/list_mail_setting200_response.py +++ b/sendgrid/rest/api/mail_settings/v3/models/list_mail_setting200_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mail_settings.v3.models.list_mail_setting200_response_result_inner import ListMailSetting200ResponseResultInner - +from sendgrid.rest.api.mail_settings.v3.models.list_mail_setting200_response_result_inner import ( + ListMailSetting200ResponseResultInner, +) class ListMailSetting200Response: def __init__( - self, - result: Optional[List[ListMailSetting200ResponseResultInner]]=None + self, result: Optional[List[ListMailSetting200ResponseResultInner]] = None ): - self.result=result + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListMailSetting200Response( - result=payload.get('result') - ) - + return ListMailSetting200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/mail_settings/v3/models/list_mail_setting200_response_result_inner.py b/sendgrid/rest/api/mail_settings/v3/models/list_mail_setting200_response_result_inner.py index 4c9f75b7..6ffeb47e 100644 --- a/sendgrid/rest/api/mail_settings/v3/models/list_mail_setting200_response_result_inner.py +++ b/sendgrid/rest/api/mail_settings/v3/models/list_mail_setting200_response_result_inner.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListMailSetting200ResponseResultInner: def __init__( - self, - title: Optional[str]=None, - enabled: Optional[bool]=None, - name: Optional[str]=None, - description: Optional[str]=None + self, + title: Optional[str] = None, + enabled: Optional[bool] = None, + name: Optional[str] = None, + description: Optional[str] = None, ): - self.title=title - self.enabled=enabled - self.name=name - self.description=description + self.title = title + self.enabled = enabled + self.name = name + self.description = description def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "title": self.title, - "enabled": self.enabled, - "name": self.name, - "description": self.description - }.items() if value is not None} + "title": self.title, + "enabled": self.enabled, + "name": self.name, + "description": self.description, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListMailSetting200ResponseResultInner( - title=payload.get('title'), - enabled=payload.get('enabled'), - name=payload.get('name'), - description=payload.get('description') - ) - + title=payload.get("title"), + enabled=payload.get("enabled"), + name=payload.get("name"), + description=payload.get("description"), + ) diff --git a/sendgrid/rest/api/mail_settings/v3/models/mail_settings_address_whitelabel200.py b/sendgrid/rest/api/mail_settings/v3/models/mail_settings_address_whitelabel200.py index 4cf30262..3ed28f56 100644 --- a/sendgrid/rest/api/mail_settings/v3/models/mail_settings_address_whitelabel200.py +++ b/sendgrid/rest/api/mail_settings/v3/models/mail_settings_address_whitelabel200.py @@ -1,25 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class MailSettingsAddressWhitelabel200: def __init__( - self, - enabled: Optional[bool]=None, - list: Optional[List[str]]=None + self, enabled: Optional[bool] = None, list: Optional[List[str]] = None ): - self.enabled=enabled - self.list=list + self.enabled = enabled + self.list = list def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "enabled": self.enabled, - "list": self.list - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"enabled": self.enabled, "list": self.list}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +23,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return MailSettingsAddressWhitelabel200( - enabled=payload.get('enabled'), - list=payload.get('list') - ) - + enabled=payload.get("enabled"), list=payload.get("list") + ) diff --git a/sendgrid/rest/api/mail_settings/v3/models/mail_settings_bounce_purge.py b/sendgrid/rest/api/mail_settings/v3/models/mail_settings_bounce_purge.py index e935aa28..a03f8c2a 100644 --- a/sendgrid/rest/api/mail_settings/v3/models/mail_settings_bounce_purge.py +++ b/sendgrid/rest/api/mail_settings/v3/models/mail_settings_bounce_purge.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class MailSettingsBouncePurge: def __init__( - self, - enabled: Optional[bool]=None, - soft_bounces: Optional[int]=None, - hard_bounces: Optional[int]=None + self, + enabled: Optional[bool] = None, + soft_bounces: Optional[int] = None, + hard_bounces: Optional[int] = None, ): - self.enabled=enabled - self.soft_bounces=soft_bounces - self.hard_bounces=hard_bounces + self.enabled = enabled + self.soft_bounces = soft_bounces + self.hard_bounces = hard_bounces def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enabled": self.enabled, - "soft_bounces": self.soft_bounces, - "hard_bounces": self.hard_bounces - }.items() if value is not None} + "enabled": self.enabled, + "soft_bounces": self.soft_bounces, + "hard_bounces": self.hard_bounces, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return MailSettingsBouncePurge( - enabled=payload.get('enabled'), - soft_bounces=payload.get('soft_bounces'), - hard_bounces=payload.get('hard_bounces') - ) - + enabled=payload.get("enabled"), + soft_bounces=payload.get("soft_bounces"), + hard_bounces=payload.get("hard_bounces"), + ) diff --git a/sendgrid/rest/api/mail_settings/v3/models/mail_settings_footer.py b/sendgrid/rest/api/mail_settings/v3/models/mail_settings_footer.py index a75b770b..8e771d42 100644 --- a/sendgrid/rest/api/mail_settings/v3/models/mail_settings_footer.py +++ b/sendgrid/rest/api/mail_settings/v3/models/mail_settings_footer.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class MailSettingsFooter: def __init__( - self, - enabled: Optional[bool]=None, - html_content: Optional[str]=None, - plain_content: Optional[str]=None + self, + enabled: Optional[bool] = None, + html_content: Optional[str] = None, + plain_content: Optional[str] = None, ): - self.enabled=enabled - self.html_content=html_content - self.plain_content=plain_content + self.enabled = enabled + self.html_content = html_content + self.plain_content = plain_content def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enabled": self.enabled, - "html_content": self.html_content, - "plain_content": self.plain_content - }.items() if value is not None} + "enabled": self.enabled, + "html_content": self.html_content, + "plain_content": self.plain_content, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return MailSettingsFooter( - enabled=payload.get('enabled'), - html_content=payload.get('html_content'), - plain_content=payload.get('plain_content') - ) - + enabled=payload.get("enabled"), + html_content=payload.get("html_content"), + plain_content=payload.get("plain_content"), + ) diff --git a/sendgrid/rest/api/mail_settings/v3/models/mail_settings_forward_bounce.py b/sendgrid/rest/api/mail_settings/v3/models/mail_settings_forward_bounce.py index e7d75d39..d0343e24 100644 --- a/sendgrid/rest/api/mail_settings/v3/models/mail_settings_forward_bounce.py +++ b/sendgrid/rest/api/mail_settings/v3/models/mail_settings_forward_bounce.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class MailSettingsForwardBounce: - def __init__( - self, - email: Optional[str]=None, - enabled: Optional[bool]=None - ): - self.email=email - self.enabled=enabled + def __init__(self, email: Optional[str] = None, enabled: Optional[bool] = None): + self.email = email + self.enabled = enabled def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email, - "enabled": self.enabled - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email, "enabled": self.enabled}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return MailSettingsForwardBounce( - email=payload.get('email'), - enabled=payload.get('enabled') - ) - + email=payload.get("email"), enabled=payload.get("enabled") + ) diff --git a/sendgrid/rest/api/mail_settings/v3/models/mail_settings_forward_spam.py b/sendgrid/rest/api/mail_settings/v3/models/mail_settings_forward_spam.py index 61e19b24..2e24d53a 100644 --- a/sendgrid/rest/api/mail_settings/v3/models/mail_settings_forward_spam.py +++ b/sendgrid/rest/api/mail_settings/v3/models/mail_settings_forward_spam.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class MailSettingsForwardSpam: - def __init__( - self, - email: Optional[str]=None, - enabled: Optional[bool]=None - ): - self.email=email - self.enabled=enabled + def __init__(self, email: Optional[str] = None, enabled: Optional[bool] = None): + self.email = email + self.enabled = enabled def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email, - "enabled": self.enabled - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email, "enabled": self.enabled}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return MailSettingsForwardSpam( - email=payload.get('email'), - enabled=payload.get('enabled') - ) - + email=payload.get("email"), enabled=payload.get("enabled") + ) diff --git a/sendgrid/rest/api/mail_settings/v3/models/mail_settings_template200.py b/sendgrid/rest/api/mail_settings/v3/models/mail_settings_template200.py index 7301a864..c83ff420 100644 --- a/sendgrid/rest/api/mail_settings/v3/models/mail_settings_template200.py +++ b/sendgrid/rest/api/mail_settings/v3/models/mail_settings_template200.py @@ -1,25 +1,23 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class MailSettingsTemplate200: def __init__( - self, - enabled: Optional[bool]=None, - html_content: Optional[str]=None + self, enabled: Optional[bool] = None, html_content: Optional[str] = None ): - self.enabled=enabled - self.html_content=html_content + self.enabled = enabled + self.html_content = html_content def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enabled": self.enabled, - "html_content": self.html_content - }.items() if value is not None} + "enabled": self.enabled, + "html_content": self.html_content, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +26,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return MailSettingsTemplate200( - enabled=payload.get('enabled'), - html_content=payload.get('html_content') - ) - + enabled=payload.get("enabled"), html_content=payload.get("html_content") + ) diff --git a/sendgrid/rest/api/mail_settings/v3/models/update_address_whitelist_request.py b/sendgrid/rest/api/mail_settings/v3/models/update_address_whitelist_request.py index 4a439e61..f99ff206 100644 --- a/sendgrid/rest/api/mail_settings/v3/models/update_address_whitelist_request.py +++ b/sendgrid/rest/api/mail_settings/v3/models/update_address_whitelist_request.py @@ -1,25 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateAddressWhitelistRequest: def __init__( - self, - enabled: Optional[bool]=None, - list: Optional[List[str]]=None + self, enabled: Optional[bool] = None, list: Optional[List[str]] = None ): - self.enabled=enabled - self.list=list + self.enabled = enabled + self.list = list def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "enabled": self.enabled, - "list": self.list - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"enabled": self.enabled, "list": self.list}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +23,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateAddressWhitelistRequest( - enabled=payload.get('enabled'), - list=payload.get('list') - ) - + enabled=payload.get("enabled"), list=payload.get("list") + ) diff --git a/sendgrid/rest/api/mail_settings/v3/models/update_template200_response.py b/sendgrid/rest/api/mail_settings/v3/models/update_template200_response.py index 8e4ec82c..7c150dab 100644 --- a/sendgrid/rest/api/mail_settings/v3/models/update_template200_response.py +++ b/sendgrid/rest/api/mail_settings/v3/models/update_template200_response.py @@ -1,25 +1,23 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateTemplate200Response: def __init__( - self, - enabled: Optional[bool]=None, - html_content: Optional[str]=None + self, enabled: Optional[bool] = None, html_content: Optional[str] = None ): - self.enabled=enabled - self.html_content=html_content + self.enabled = enabled + self.html_content = html_content def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enabled": self.enabled, - "html_content": self.html_content - }.items() if value is not None} + "enabled": self.enabled, + "html_content": self.html_content, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +26,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateTemplate200Response( - enabled=payload.get('enabled'), - html_content=payload.get('html_content') - ) - + enabled=payload.get("enabled"), html_content=payload.get("html_content") + ) diff --git a/sendgrid/rest/api/mail_settings/v3/models/update_template_request.py b/sendgrid/rest/api/mail_settings/v3/models/update_template_request.py index f50102fc..cba2ece2 100644 --- a/sendgrid/rest/api/mail_settings/v3/models/update_template_request.py +++ b/sendgrid/rest/api/mail_settings/v3/models/update_template_request.py @@ -1,25 +1,23 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateTemplateRequest: def __init__( - self, - enabled: Optional[bool]=None, - html_content: Optional[str]=None + self, enabled: Optional[bool] = None, html_content: Optional[str] = None ): - self.enabled=enabled - self.html_content=html_content + self.enabled = enabled + self.html_content = html_content def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enabled": self.enabled, - "html_content": self.html_content - }.items() if value is not None} + "enabled": self.enabled, + "html_content": self.html_content, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +26,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateTemplateRequest( - enabled=payload.get('enabled'), - html_content=payload.get('html_content') - ) - + enabled=payload.get("enabled"), html_content=payload.get("html_content") + ) diff --git a/sendgrid/rest/api/mail_settings/v3/update_address_whitelist.py b/sendgrid/rest/api/mail_settings/v3/update_address_whitelist.py index 21de05b3..b1957442 100644 --- a/sendgrid/rest/api/mail_settings/v3/update_address_whitelist.py +++ b/sendgrid/rest/api/mail_settings/v3/update_address_whitelist.py @@ -12,55 +12,56 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_address_whitelabel200 import MailSettingsAddressWhitelabel200 -from sendgrid.rest.api.mail_settings.v3.models.update_address_whitelist_request import UpdateAddressWhitelistRequest +from sendgrid.rest.api.mail_settings.v3.models.update_address_whitelist_request import ( + UpdateAddressWhitelistRequest, +) + class UpdateAddressWhitelist: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - update_address_whitelist_request: Optional[UpdateAddressWhitelistRequest] = None, - + on_behalf_of: Optional[str] = None, + update_address_whitelist_request: Optional[ + UpdateAddressWhitelistRequest + ] = None, ): - path='/v3/mail_settings/address_whitelist' + path = "/v3/mail_settings/address_whitelist" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_address_whitelist_request: data = update_address_whitelist_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail_settings/v3/update_bounce_purge.py b/sendgrid/rest/api/mail_settings/v3/update_bounce_purge.py index 0d3fbe9d..1f788d66 100644 --- a/sendgrid/rest/api/mail_settings/v3/update_bounce_purge.py +++ b/sendgrid/rest/api/mail_settings/v3/update_bounce_purge.py @@ -12,54 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_bounce_purge import MailSettingsBouncePurge +from sendgrid.rest.api.mail_settings.v3.models.mail_settings_bounce_purge import ( + MailSettingsBouncePurge, +) + class UpdateBouncePurge: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - mail_settings_bounce_purge: Optional[MailSettingsBouncePurge] = None, - + on_behalf_of: Optional[str] = None, + mail_settings_bounce_purge: Optional[MailSettingsBouncePurge] = None, ): - path='/v3/mail_settings/bounce_purge' + path = "/v3/mail_settings/bounce_purge" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if mail_settings_bounce_purge: data = mail_settings_bounce_purge.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail_settings/v3/update_footer.py b/sendgrid/rest/api/mail_settings/v3/update_footer.py index 510c9b95..21c3286d 100644 --- a/sendgrid/rest/api/mail_settings/v3/update_footer.py +++ b/sendgrid/rest/api/mail_settings/v3/update_footer.py @@ -12,54 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_footer import MailSettingsFooter +from sendgrid.rest.api.mail_settings.v3.models.mail_settings_footer import ( + MailSettingsFooter, +) + class UpdateFooter: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - mail_settings_footer: Optional[MailSettingsFooter] = None, - + on_behalf_of: Optional[str] = None, + mail_settings_footer: Optional[MailSettingsFooter] = None, ): - path='/v3/mail_settings/footer' + path = "/v3/mail_settings/footer" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if mail_settings_footer: data = mail_settings_footer.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail_settings/v3/update_forward_bounce.py b/sendgrid/rest/api/mail_settings/v3/update_forward_bounce.py index 8e6c41e0..f4ae5c2f 100644 --- a/sendgrid/rest/api/mail_settings/v3/update_forward_bounce.py +++ b/sendgrid/rest/api/mail_settings/v3/update_forward_bounce.py @@ -12,54 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_forward_bounce import MailSettingsForwardBounce +from sendgrid.rest.api.mail_settings.v3.models.mail_settings_forward_bounce import ( + MailSettingsForwardBounce, +) + class UpdateForwardBounce: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - mail_settings_forward_bounce: Optional[MailSettingsForwardBounce] = None, - + on_behalf_of: Optional[str] = None, + mail_settings_forward_bounce: Optional[MailSettingsForwardBounce] = None, ): - path='/v3/mail_settings/forward_bounce' + path = "/v3/mail_settings/forward_bounce" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if mail_settings_forward_bounce: data = mail_settings_forward_bounce.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail_settings/v3/update_forward_spam.py b/sendgrid/rest/api/mail_settings/v3/update_forward_spam.py index 40fc38d9..a05b0783 100644 --- a/sendgrid/rest/api/mail_settings/v3/update_forward_spam.py +++ b/sendgrid/rest/api/mail_settings/v3/update_forward_spam.py @@ -12,54 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail_settings.v3.models.mail_settings_forward_spam import MailSettingsForwardSpam +from sendgrid.rest.api.mail_settings.v3.models.mail_settings_forward_spam import ( + MailSettingsForwardSpam, +) + class UpdateForwardSpam: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - mail_settings_forward_spam: Optional[MailSettingsForwardSpam] = None, - + on_behalf_of: Optional[str] = None, + mail_settings_forward_spam: Optional[MailSettingsForwardSpam] = None, ): - path='/v3/mail_settings/forward_spam' + path = "/v3/mail_settings/forward_spam" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if mail_settings_forward_spam: data = mail_settings_forward_spam.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mail_settings/v3/update_template.py b/sendgrid/rest/api/mail_settings/v3/update_template.py index 74f07d6e..60a9eff7 100644 --- a/sendgrid/rest/api/mail_settings/v3/update_template.py +++ b/sendgrid/rest/api/mail_settings/v3/update_template.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mail_settings.v3.models.update_template200_response import UpdateTemplate200Response -from sendgrid.rest.api.mail_settings.v3.models.update_template_request import UpdateTemplateRequest +from sendgrid.rest.api.mail_settings.v3.models.update_template_request import ( + UpdateTemplateRequest, +) + class UpdateTemplate: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - update_template_request: Optional[UpdateTemplateRequest] = None, - + on_behalf_of: Optional[str] = None, + update_template_request: Optional[UpdateTemplateRequest] = None, ): - path='/v3/mail_settings/template' + path = "/v3/mail_settings/template" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_template_request: data = update_template_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/__init__.py b/sendgrid/rest/api/mc_contacts/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/mc_contacts/v3/__init__.py +++ b/sendgrid/rest/api/mc_contacts/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/mc_contacts/v3/delete_contact.py b/sendgrid/rest/api/mc_contacts/v3/delete_contact.py index 4a962ec1..a6a516ab 100644 --- a/sendgrid/rest/api/mc_contacts/v3/delete_contact.py +++ b/sendgrid/rest/api/mc_contacts/v3/delete_contact.py @@ -12,47 +12,42 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_contacts.v3.models.delete_contact202_response import DeleteContact202Response + class DeleteContact: def __init__(self, client) -> None: self.client = client - + def send( self, - delete_all_contacts: Optional[str] = None, - ids: Optional[str] = None, - + delete_all_contacts: Optional[str] = None, + ids: Optional[str] = None, ): - path='/v3/marketing/contacts' + path = "/v3/marketing/contacts" data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/delete_contact_identifier.py b/sendgrid/rest/api/mc_contacts/v3/delete_contact_identifier.py index 06437f9f..934872ca 100644 --- a/sendgrid/rest/api/mc_contacts/v3/delete_contact_identifier.py +++ b/sendgrid/rest/api/mc_contacts/v3/delete_contact_identifier.py @@ -12,53 +12,52 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_contacts.v3.models.delete_contact_identifier202_response import DeleteContactIdentifier202Response -from sendgrid.rest.api.mc_contacts.v3.models.delete_contact_identifier_request import DeleteContactIdentifierRequest +from sendgrid.rest.api.mc_contacts.v3.models.delete_contact_identifier_request import ( + DeleteContactIdentifierRequest, +) + class DeleteContactIdentifier: def __init__(self, client) -> None: self.client = client - + def send( self, - contact_id: str, - delete_contact_identifier_request: Optional[DeleteContactIdentifierRequest] = None, - + contact_id: str, + delete_contact_identifier_request: Optional[ + DeleteContactIdentifierRequest + ] = None, ): - path='/v3/marketing/contacts/{contact_id}/identifiers' + path = "/v3/marketing/contacts/{contact_id}/identifiers" path = path.format( - contact_id=contact_id, + contact_id=contact_id, ) data = None if delete_contact_identifier_request: data = delete_contact_identifier_request.to_dict() - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/export_contact.py b/sendgrid/rest/api/mc_contacts/v3/export_contact.py index b948208b..3a9e6720 100644 --- a/sendgrid/rest/api/mc_contacts/v3/export_contact.py +++ b/sendgrid/rest/api/mc_contacts/v3/export_contact.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.mc_contacts.v3.models.export_contact202_response import ExportContact202Response -from sendgrid.rest.api.mc_contacts.v3.models.export_contact_request import ExportContactRequest +from sendgrid.rest.api.mc_contacts.v3.models.export_contact_request import ( + ExportContactRequest, +) + class ExportContact: def __init__(self, client) -> None: self.client = client - + def send( self, - export_contact_request: Optional[ExportContactRequest] = None, - + export_contact_request: Optional[ExportContactRequest] = None, ): - path='/v3/marketing/contacts/exports' + path = "/v3/marketing/contacts/exports" data = None if export_contact_request: data = export_contact_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/get_contact.py b/sendgrid/rest/api/mc_contacts/v3/get_contact.py index 629d789f..c1d7c0b6 100644 --- a/sendgrid/rest/api/mc_contacts/v3/get_contact.py +++ b/sendgrid/rest/api/mc_contacts/v3/get_contact.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr -from sendgrid.rest.api.mc_contacts.v3.models.contact_details3 import ContactDetails3 class GetContact: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - + id: str, ): - path='/v3/marketing/contacts/{id}' + path = "/v3/marketing/contacts/{id}" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/get_contact_by_identifiers.py b/sendgrid/rest/api/mc_contacts/v3/get_contact_by_identifiers.py index eb854dc5..b4c29d63 100644 --- a/sendgrid/rest/api/mc_contacts/v3/get_contact_by_identifiers.py +++ b/sendgrid/rest/api/mc_contacts/v3/get_contact_by_identifiers.py @@ -12,54 +12,53 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_contacts.v3.models.get_contact_by_identifiers200_response import GetContactByIdentifiers200Response -from sendgrid.rest.api.mc_contacts.v3.models.get_contact_by_identifiers_request import GetContactByIdentifiersRequest +from sendgrid.rest.api.mc_contacts.v3.models.get_contact_by_identifiers_request import ( + GetContactByIdentifiersRequest, +) from sendgrid.rest.api.mc_contacts.v3.models.identifier_type1 import IdentifierType1 + class GetContactByIdentifiers: def __init__(self, client) -> None: self.client = client - + def send( self, - identifier_type: IdentifierType1, - get_contact_by_identifiers_request: Optional[GetContactByIdentifiersRequest] = None, - + identifier_type: IdentifierType1, + get_contact_by_identifiers_request: Optional[ + GetContactByIdentifiersRequest + ] = None, ): - path='/v3/marketing/contacts/search/identifiers/{identifier_type}' + path = "/v3/marketing/contacts/search/identifiers/{identifier_type}" path = path.format( - identifier_type=identifier_type, + identifier_type=identifier_type, ) data = None if get_contact_by_identifiers_request: data = get_contact_by_identifiers_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/get_export_contact.py b/sendgrid/rest/api/mc_contacts/v3/get_export_contact.py index c14891ad..e64a2d09 100644 --- a/sendgrid/rest/api/mc_contacts/v3/get_export_contact.py +++ b/sendgrid/rest/api/mc_contacts/v3/get_export_contact.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr -from sendgrid.rest.api.mc_contacts.v3.models.contact_export import ContactExport class GetExportContact: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - + id: str, ): - path='/v3/marketing/contacts/exports/{id}' + path = "/v3/marketing/contacts/exports/{id}" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/get_import_contact.py b/sendgrid/rest/api/mc_contacts/v3/get_import_contact.py index 2c53b84d..f2c7e3a9 100644 --- a/sendgrid/rest/api/mc_contacts/v3/get_import_contact.py +++ b/sendgrid/rest/api/mc_contacts/v3/get_import_contact.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr -from sendgrid.rest.api.mc_contacts.v3.models.contact_import import ContactImport class GetImportContact: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - + id: str, ): - path='/v3/marketing/contacts/imports/{id}' + path = "/v3/marketing/contacts/imports/{id}" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/import_contact.py b/sendgrid/rest/api/mc_contacts/v3/import_contact.py index 0356af38..a70de835 100644 --- a/sendgrid/rest/api/mc_contacts/v3/import_contact.py +++ b/sendgrid/rest/api/mc_contacts/v3/import_contact.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.mc_contacts.v3.models.import_contact200_response import ImportContact200Response -from sendgrid.rest.api.mc_contacts.v3.models.import_contact_request import ImportContactRequest +from sendgrid.rest.api.mc_contacts.v3.models.import_contact_request import ( + ImportContactRequest, +) + class ImportContact: def __init__(self, client) -> None: self.client = client - + def send( self, - import_contact_request: Optional[ImportContactRequest] = None, - + import_contact_request: Optional[ImportContactRequest] = None, ): - path='/v3/marketing/contacts/imports' + path = "/v3/marketing/contacts/imports" data = None if import_contact_request: data = import_contact_request.to_dict() - request = Request( - method='PUT', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/list_batched_contact.py b/sendgrid/rest/api/mc_contacts/v3/list_batched_contact.py index 4b9c4cec..1b1ac39b 100644 --- a/sendgrid/rest/api/mc_contacts/v3/list_batched_contact.py +++ b/sendgrid/rest/api/mc_contacts/v3/list_batched_contact.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.mc_contacts.v3.models.list_batched_contact200_response import ListBatchedContact200Response -from sendgrid.rest.api.mc_contacts.v3.models.list_batched_contact_request import ListBatchedContactRequest +from sendgrid.rest.api.mc_contacts.v3.models.list_batched_contact_request import ( + ListBatchedContactRequest, +) + class ListBatchedContact: def __init__(self, client) -> None: self.client = client - + def send( self, - list_batched_contact_request: Optional[ListBatchedContactRequest] = None, - + list_batched_contact_request: Optional[ListBatchedContactRequest] = None, ): - path='/v3/marketing/contacts/batch' + path = "/v3/marketing/contacts/batch" data = None if list_batched_contact_request: data = list_batched_contact_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/list_contact.py b/sendgrid/rest/api/mc_contacts/v3/list_contact.py index 1b5c1db8..418e22a5 100644 --- a/sendgrid/rest/api/mc_contacts/v3/list_contact.py +++ b/sendgrid/rest/api/mc_contacts/v3/list_contact.py @@ -12,42 +12,37 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from sendgrid.rest.api.mc_contacts.v3.models.list_contact200_response import ListContact200Response class ListContact: def __init__(self, client) -> None: self.client = client - + def send( self, - ): - path='/v3/marketing/contacts' + path = "/v3/marketing/contacts" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/list_contact_by_email.py b/sendgrid/rest/api/mc_contacts/v3/list_contact_by_email.py index fef1ccb1..515f6a0a 100644 --- a/sendgrid/rest/api/mc_contacts/v3/list_contact_by_email.py +++ b/sendgrid/rest/api/mc_contacts/v3/list_contact_by_email.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.mc_contacts.v3.models.list_contact_by_email200_response import ListContactByEmail200Response -from sendgrid.rest.api.mc_contacts.v3.models.list_contact_by_email_request import ListContactByEmailRequest +from sendgrid.rest.api.mc_contacts.v3.models.list_contact_by_email_request import ( + ListContactByEmailRequest, +) + class ListContactByEmail: def __init__(self, client) -> None: self.client = client - + def send( self, - list_contact_by_email_request: Optional[ListContactByEmailRequest] = None, - + list_contact_by_email_request: Optional[ListContactByEmailRequest] = None, ): - path='/v3/marketing/contacts/search/emails' + path = "/v3/marketing/contacts/search/emails" data = None if list_contact_by_email_request: data = list_contact_by_email_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/list_contact_count.py b/sendgrid/rest/api/mc_contacts/v3/list_contact_count.py index b3f58528..c4f98a9e 100644 --- a/sendgrid/rest/api/mc_contacts/v3/list_contact_count.py +++ b/sendgrid/rest/api/mc_contacts/v3/list_contact_count.py @@ -12,42 +12,37 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from sendgrid.rest.api.mc_contacts.v3.models.list_contact_count200_response import ListContactCount200Response class ListContactCount: def __init__(self, client) -> None: self.client = client - + def send( self, - ): - path='/v3/marketing/contacts/count' + path = "/v3/marketing/contacts/count" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/list_export_contact.py b/sendgrid/rest/api/mc_contacts/v3/list_export_contact.py index 9018945d..1ccb4985 100644 --- a/sendgrid/rest/api/mc_contacts/v3/list_export_contact.py +++ b/sendgrid/rest/api/mc_contacts/v3/list_export_contact.py @@ -12,42 +12,37 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response import ListExportContact200Response class ListExportContact: def __init__(self, client) -> None: self.client = client - + def send( self, - ): - path='/v3/marketing/contacts/exports' + path = "/v3/marketing/contacts/exports" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/__init__.py b/sendgrid/rest/api/mc_contacts/v3/models/__init__.py index 8f3b2c5d..325e5c7a 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/__init__.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/__init__.py @@ -11,62 +11,202 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.mc_contacts.v3.models.contact_details3 import ContactDetails3 from sendgrid.rest.api.mc_contacts.v3.models.contact_export import ContactExport from sendgrid.rest.api.mc_contacts.v3.models.contact_import import ContactImport -from sendgrid.rest.api.mc_contacts.v3.models.contact_import_results import ContactImportResults +from sendgrid.rest.api.mc_contacts.v3.models.contact_import_results import ( + ContactImportResults, +) from sendgrid.rest.api.mc_contacts.v3.models.contact_request import ContactRequest -from sendgrid.rest.api.mc_contacts.v3.models.contact_request_custom_fields import ContactRequestCustomFields +from sendgrid.rest.api.mc_contacts.v3.models.contact_request_custom_fields import ( + ContactRequestCustomFields, +) from sendgrid.rest.api.mc_contacts.v3.models.contacts_error import ContactsError -from sendgrid.rest.api.mc_contacts.v3.models.delete_contact202_response import DeleteContact202Response -from sendgrid.rest.api.mc_contacts.v3.models.delete_contact400_response import DeleteContact400Response -from sendgrid.rest.api.mc_contacts.v3.models.delete_contact_identifier202_response import DeleteContactIdentifier202Response -from sendgrid.rest.api.mc_contacts.v3.models.delete_contact_identifier_request import DeleteContactIdentifierRequest +from sendgrid.rest.api.mc_contacts.v3.models.delete_contact202_response import ( + DeleteContact202Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.delete_contact400_response import ( + DeleteContact400Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.delete_contact_identifier202_response import ( + DeleteContactIdentifier202Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.delete_contact_identifier_request import ( + DeleteContactIdentifierRequest, +) from sendgrid.rest.api.mc_contacts.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.mc_contacts.v3.models.error_response_errors_inner import ErrorResponseErrorsInner -from sendgrid.rest.api.mc_contacts.v3.models.export_contact202_response import ExportContact202Response -from sendgrid.rest.api.mc_contacts.v3.models.export_contact_request import ExportContactRequest -from sendgrid.rest.api.mc_contacts.v3.models.export_contact_request_notifications import ExportContactRequestNotifications +from sendgrid.rest.api.mc_contacts.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) +from sendgrid.rest.api.mc_contacts.v3.models.export_contact202_response import ( + ExportContact202Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.export_contact_request import ( + ExportContactRequest, +) +from sendgrid.rest.api.mc_contacts.v3.models.export_contact_request_notifications import ( + ExportContactRequestNotifications, +) from sendgrid.rest.api.mc_contacts.v3.models.file_type import FileType from sendgrid.rest.api.mc_contacts.v3.models.file_type1 import FileType1 -from sendgrid.rest.api.mc_contacts.v3.models.get_contact_by_identifiers200_response import GetContactByIdentifiers200Response -from sendgrid.rest.api.mc_contacts.v3.models.get_contact_by_identifiers200_response_result_value import GetContactByIdentifiers200ResponseResultValue -from sendgrid.rest.api.mc_contacts.v3.models.get_contact_by_identifiers_request import GetContactByIdentifiersRequest -from sendgrid.rest.api.mc_contacts.v3.models.get_import_contact400_response import GetImportContact400Response +from sendgrid.rest.api.mc_contacts.v3.models.get_contact_by_identifiers200_response import ( + GetContactByIdentifiers200Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.get_contact_by_identifiers200_response_result_value import ( + GetContactByIdentifiers200ResponseResultValue, +) +from sendgrid.rest.api.mc_contacts.v3.models.get_contact_by_identifiers_request import ( + GetContactByIdentifiersRequest, +) +from sendgrid.rest.api.mc_contacts.v3.models.get_import_contact400_response import ( + GetImportContact400Response, +) from sendgrid.rest.api.mc_contacts.v3.models.identifier_type import IdentifierType from sendgrid.rest.api.mc_contacts.v3.models.identifier_type1 import IdentifierType1 -from sendgrid.rest.api.mc_contacts.v3.models.import_contact200_response import ImportContact200Response -from sendgrid.rest.api.mc_contacts.v3.models.import_contact200_response_upload_headers_inner import ImportContact200ResponseUploadHeadersInner -from sendgrid.rest.api.mc_contacts.v3.models.import_contact400_response import ImportContact400Response -from sendgrid.rest.api.mc_contacts.v3.models.import_contact404_response import ImportContact404Response -from sendgrid.rest.api.mc_contacts.v3.models.import_contact_request import ImportContactRequest -from sendgrid.rest.api.mc_contacts.v3.models.list_batched_contact200_response import ListBatchedContact200Response -from sendgrid.rest.api.mc_contacts.v3.models.list_batched_contact_request import ListBatchedContactRequest -from sendgrid.rest.api.mc_contacts.v3.models.list_contact200_response import ListContact200Response -from sendgrid.rest.api.mc_contacts.v3.models.list_contact400_response import ListContact400Response -from sendgrid.rest.api.mc_contacts.v3.models.list_contact_by_email200_response import ListContactByEmail200Response -from sendgrid.rest.api.mc_contacts.v3.models.list_contact_by_email_request import ListContactByEmailRequest -from sendgrid.rest.api.mc_contacts.v3.models.list_contact_count200_response import ListContactCount200Response -from sendgrid.rest.api.mc_contacts.v3.models.list_contact_count200_response_billable_breakdown import ListContactCount200ResponseBillableBreakdown -from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response import ListExportContact200Response -from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_metadata import ListExportContact200ResponseMetadata -from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_result_inner import ListExportContact200ResponseResultInner -from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_result_inner_metadata import ListExportContact200ResponseResultInnerMetadata -from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_result_inner_segments_inner import ListExportContact200ResponseResultInnerSegmentsInner -from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact400_response import ListExportContact400Response -from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact400_response_errors_inner import ListExportContact400ResponseErrorsInner +from sendgrid.rest.api.mc_contacts.v3.models.import_contact200_response import ( + ImportContact200Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.import_contact200_response_upload_headers_inner import ( + ImportContact200ResponseUploadHeadersInner, +) +from sendgrid.rest.api.mc_contacts.v3.models.import_contact400_response import ( + ImportContact400Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.import_contact404_response import ( + ImportContact404Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.import_contact_request import ( + ImportContactRequest, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_batched_contact200_response import ( + ListBatchedContact200Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_batched_contact_request import ( + ListBatchedContactRequest, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_contact200_response import ( + ListContact200Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_contact400_response import ( + ListContact400Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_contact_by_email200_response import ( + ListContactByEmail200Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_contact_by_email_request import ( + ListContactByEmailRequest, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_contact_count200_response import ( + ListContactCount200Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_contact_count200_response_billable_breakdown import ( + ListContactCount200ResponseBillableBreakdown, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response import ( + ListExportContact200Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_metadata import ( + ListExportContact200ResponseMetadata, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_result_inner import ( + ListExportContact200ResponseResultInner, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_result_inner_metadata import ( + ListExportContact200ResponseResultInnerMetadata, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_result_inner_segments_inner import ( + ListExportContact200ResponseResultInnerSegmentsInner, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact400_response import ( + ListExportContact400Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact400_response_errors_inner import ( + ListExportContact400ResponseErrorsInner, +) from sendgrid.rest.api.mc_contacts.v3.models.metadata import Metadata -from sendgrid.rest.api.mc_contacts.v3.models.search_contact200_response import SearchContact200Response -from sendgrid.rest.api.mc_contacts.v3.models.search_contact400_response import SearchContact400Response -from sendgrid.rest.api.mc_contacts.v3.models.search_contact400_response_errors_inner import SearchContact400ResponseErrorsInner -from sendgrid.rest.api.mc_contacts.v3.models.search_contact500_response import SearchContact500Response -from sendgrid.rest.api.mc_contacts.v3.models.search_contact500_response_errors_inner import SearchContact500ResponseErrorsInner -from sendgrid.rest.api.mc_contacts.v3.models.search_contact_request import SearchContactRequest +from sendgrid.rest.api.mc_contacts.v3.models.search_contact200_response import ( + SearchContact200Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.search_contact400_response import ( + SearchContact400Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.search_contact400_response_errors_inner import ( + SearchContact400ResponseErrorsInner, +) +from sendgrid.rest.api.mc_contacts.v3.models.search_contact500_response import ( + SearchContact500Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.search_contact500_response_errors_inner import ( + SearchContact500ResponseErrorsInner, +) +from sendgrid.rest.api.mc_contacts.v3.models.search_contact_request import ( + SearchContactRequest, +) from sendgrid.rest.api.mc_contacts.v3.models.self_metadata import SelfMetadata from sendgrid.rest.api.mc_contacts.v3.models.status import Status -from sendgrid.rest.api.mc_contacts.v3.models.update_contact202_response import UpdateContact202Response -from sendgrid.rest.api.mc_contacts.v3.models.update_contact_request import UpdateContactRequest -__all__ = [ 'ContactDetails3', 'ContactExport', 'ContactImport', 'ContactImportResults', 'ContactRequest', 'ContactRequestCustomFields', 'ContactsError', 'DeleteContact202Response', 'DeleteContact400Response', 'DeleteContactIdentifier202Response', 'DeleteContactIdentifierRequest', 'ErrorResponse', 'ErrorResponseErrorsInner', 'ExportContact202Response', 'ExportContactRequest', 'ExportContactRequestNotifications', 'FileType', 'FileType1', 'GetContactByIdentifiers200Response', 'GetContactByIdentifiers200ResponseResultValue', 'GetContactByIdentifiersRequest', 'GetImportContact400Response', 'IdentifierType', 'IdentifierType1', 'ImportContact200Response', 'ImportContact200ResponseUploadHeadersInner', 'ImportContact400Response', 'ImportContact404Response', 'ImportContactRequest', 'ListBatchedContact200Response', 'ListBatchedContactRequest', 'ListContact200Response', 'ListContact400Response', 'ListContactByEmail200Response', 'ListContactByEmailRequest', 'ListContactCount200Response', 'ListContactCount200ResponseBillableBreakdown', 'ListExportContact200Response', 'ListExportContact200ResponseMetadata', 'ListExportContact200ResponseResultInner', 'ListExportContact200ResponseResultInnerMetadata', 'ListExportContact200ResponseResultInnerSegmentsInner', 'ListExportContact400Response', 'ListExportContact400ResponseErrorsInner', 'Metadata', 'SearchContact200Response', 'SearchContact400Response', 'SearchContact400ResponseErrorsInner', 'SearchContact500Response', 'SearchContact500ResponseErrorsInner', 'SearchContactRequest', 'SelfMetadata', 'Status', 'UpdateContact202Response', 'UpdateContactRequest' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.mc_contacts.v3.models.update_contact202_response import ( + UpdateContact202Response, +) +from sendgrid.rest.api.mc_contacts.v3.models.update_contact_request import ( + UpdateContactRequest, +) + +__all__ = [ + "ContactDetails3", + "ContactExport", + "ContactImport", + "ContactImportResults", + "ContactRequest", + "ContactRequestCustomFields", + "ContactsError", + "DeleteContact202Response", + "DeleteContact400Response", + "DeleteContactIdentifier202Response", + "DeleteContactIdentifierRequest", + "ErrorResponse", + "ErrorResponseErrorsInner", + "ExportContact202Response", + "ExportContactRequest", + "ExportContactRequestNotifications", + "FileType", + "FileType1", + "GetContactByIdentifiers200Response", + "GetContactByIdentifiers200ResponseResultValue", + "GetContactByIdentifiersRequest", + "GetImportContact400Response", + "IdentifierType", + "IdentifierType1", + "ImportContact200Response", + "ImportContact200ResponseUploadHeadersInner", + "ImportContact400Response", + "ImportContact404Response", + "ImportContactRequest", + "ListBatchedContact200Response", + "ListBatchedContactRequest", + "ListContact200Response", + "ListContact400Response", + "ListContactByEmail200Response", + "ListContactByEmailRequest", + "ListContactCount200Response", + "ListContactCount200ResponseBillableBreakdown", + "ListExportContact200Response", + "ListExportContact200ResponseMetadata", + "ListExportContact200ResponseResultInner", + "ListExportContact200ResponseResultInnerMetadata", + "ListExportContact200ResponseResultInnerSegmentsInner", + "ListExportContact400Response", + "ListExportContact400ResponseErrorsInner", + "Metadata", + "SearchContact200Response", + "SearchContact400Response", + "SearchContact400ResponseErrorsInner", + "SearchContact500Response", + "SearchContact500ResponseErrorsInner", + "SearchContactRequest", + "SelfMetadata", + "Status", + "UpdateContact202Response", + "UpdateContactRequest", +] +# Testing code diff --git a/sendgrid/rest/api/mc_contacts/v3/models/contact_details3.py b/sendgrid/rest/api/mc_contacts/v3/models/contact_details3.py index ca0c50a3..a8a61a5e 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/contact_details3.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/contact_details3.py @@ -1,95 +1,95 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.self_metadata import SelfMetadata - class ContactDetails3: def __init__( - self, - id: Optional[str]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - unique_name: Optional[str]=None, - email: Optional[str]=None, - phone_number_id: Optional[str]=None, - external_id: Optional[str]=None, - anonymous_id: Optional[str]=None, - alternate_emails: Optional[List[str]]=None, - address_line_1: Optional[str]=None, - address_line_2: Optional[str]=None, - city: Optional[str]=None, - state_province_region: Optional[str]=None, - country: Optional[str]=None, - postal_code: Optional[str]=None, - phone_number: Optional[str]=None, - whatsapp: Optional[str]=None, - line: Optional[str]=None, - facebook: Optional[str]=None, - list_ids: Optional[List[str]]=None, - segment_ids: Optional[List[str]]=None, - custom_fields: Optional[object]=None, - created_at: Optional[str]=None, - updated_at: Optional[str]=None, - metadata: Optional[SelfMetadata]=None + self, + id: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + unique_name: Optional[str] = None, + email: Optional[str] = None, + phone_number_id: Optional[str] = None, + external_id: Optional[str] = None, + anonymous_id: Optional[str] = None, + alternate_emails: Optional[List[str]] = None, + address_line_1: Optional[str] = None, + address_line_2: Optional[str] = None, + city: Optional[str] = None, + state_province_region: Optional[str] = None, + country: Optional[str] = None, + postal_code: Optional[str] = None, + phone_number: Optional[str] = None, + whatsapp: Optional[str] = None, + line: Optional[str] = None, + facebook: Optional[str] = None, + list_ids: Optional[List[str]] = None, + segment_ids: Optional[List[str]] = None, + custom_fields: Optional[object] = None, + created_at: Optional[str] = None, + updated_at: Optional[str] = None, + metadata: Optional[SelfMetadata] = None, ): - self.id=id - self.first_name=first_name - self.last_name=last_name - self.unique_name=unique_name - self.email=email - self.phone_number_id=phone_number_id - self.external_id=external_id - self.anonymous_id=anonymous_id - self.alternate_emails=alternate_emails - self.address_line_1=address_line_1 - self.address_line_2=address_line_2 - self.city=city - self.state_province_region=state_province_region - self.country=country - self.postal_code=postal_code - self.phone_number=phone_number - self.whatsapp=whatsapp - self.line=line - self.facebook=facebook - self.list_ids=list_ids - self.segment_ids=segment_ids - self.custom_fields=custom_fields - self.created_at=created_at - self.updated_at=updated_at - self.metadata=metadata + self.id = id + self.first_name = first_name + self.last_name = last_name + self.unique_name = unique_name + self.email = email + self.phone_number_id = phone_number_id + self.external_id = external_id + self.anonymous_id = anonymous_id + self.alternate_emails = alternate_emails + self.address_line_1 = address_line_1 + self.address_line_2 = address_line_2 + self.city = city + self.state_province_region = state_province_region + self.country = country + self.postal_code = postal_code + self.phone_number = phone_number + self.whatsapp = whatsapp + self.line = line + self.facebook = facebook + self.list_ids = list_ids + self.segment_ids = segment_ids + self.custom_fields = custom_fields + self.created_at = created_at + self.updated_at = updated_at + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "first_name": self.first_name, - "last_name": self.last_name, - "unique_name": self.unique_name, - "email": self.email, - "phone_number_id": self.phone_number_id, - "external_id": self.external_id, - "anonymous_id": self.anonymous_id, - "alternate_emails": self.alternate_emails, - "address_line_1": self.address_line_1, - "address_line_2": self.address_line_2, - "city": self.city, - "state_province_region": self.state_province_region, - "country": self.country, - "postal_code": self.postal_code, - "phone_number": self.phone_number, - "whatsapp": self.whatsapp, - "line": self.line, - "facebook": self.facebook, - "list_ids": self.list_ids, - "segment_ids": self.segment_ids, - "custom_fields": self.custom_fields, - "created_at": self.created_at, - "updated_at": self.updated_at, - "_metadata": self.metadata - }.items() if value is not None} + "id": self.id, + "first_name": self.first_name, + "last_name": self.last_name, + "unique_name": self.unique_name, + "email": self.email, + "phone_number_id": self.phone_number_id, + "external_id": self.external_id, + "anonymous_id": self.anonymous_id, + "alternate_emails": self.alternate_emails, + "address_line_1": self.address_line_1, + "address_line_2": self.address_line_2, + "city": self.city, + "state_province_region": self.state_province_region, + "country": self.country, + "postal_code": self.postal_code, + "phone_number": self.phone_number, + "whatsapp": self.whatsapp, + "line": self.line, + "facebook": self.facebook, + "list_ids": self.list_ids, + "segment_ids": self.segment_ids, + "custom_fields": self.custom_fields, + "created_at": self.created_at, + "updated_at": self.updated_at, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -98,30 +98,29 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactDetails3( - id=payload.get('id'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - unique_name=payload.get('unique_name'), - email=payload.get('email'), - phone_number_id=payload.get('phone_number_id'), - external_id=payload.get('external_id'), - anonymous_id=payload.get('anonymous_id'), - alternate_emails=payload.get('alternate_emails'), - address_line_1=payload.get('address_line_1'), - address_line_2=payload.get('address_line_2'), - city=payload.get('city'), - state_province_region=payload.get('state_province_region'), - country=payload.get('country'), - postal_code=payload.get('postal_code'), - phone_number=payload.get('phone_number'), - whatsapp=payload.get('whatsapp'), - line=payload.get('line'), - facebook=payload.get('facebook'), - list_ids=payload.get('list_ids'), - segment_ids=payload.get('segment_ids'), - custom_fields=payload.get('custom_fields'), - created_at=payload.get('created_at'), - updated_at=payload.get('updated_at'), - metadata=payload.get('_metadata') - ) - + id=payload.get("id"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + unique_name=payload.get("unique_name"), + email=payload.get("email"), + phone_number_id=payload.get("phone_number_id"), + external_id=payload.get("external_id"), + anonymous_id=payload.get("anonymous_id"), + alternate_emails=payload.get("alternate_emails"), + address_line_1=payload.get("address_line_1"), + address_line_2=payload.get("address_line_2"), + city=payload.get("city"), + state_province_region=payload.get("state_province_region"), + country=payload.get("country"), + postal_code=payload.get("postal_code"), + phone_number=payload.get("phone_number"), + whatsapp=payload.get("whatsapp"), + line=payload.get("line"), + facebook=payload.get("facebook"), + list_ids=payload.get("list_ids"), + segment_ids=payload.get("segment_ids"), + custom_fields=payload.get("custom_fields"), + created_at=payload.get("created_at"), + updated_at=payload.get("updated_at"), + metadata=payload.get("_metadata"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/contact_export.py b/sendgrid/rest/api/mc_contacts/v3/models/contact_export.py index 8b6e3ab5..eaf4af9f 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/contact_export.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/contact_export.py @@ -1,51 +1,51 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.metadata import Metadata from sendgrid.rest.api.mc_contacts.v3.models.status import Status - class ContactExport: def __init__( - self, - id: Optional[str]=None, - status: Optional[Status]=None, - created_at: Optional[str]=None, - updated_at: Optional[str]=None, - completed_at: Optional[str]=None, - expires_at: Optional[str]=None, - urls: Optional[List[str]]=None, - message: Optional[str]=None, - metadata: Optional[Metadata]=None, - contact_count: Optional[int]=None + self, + id: Optional[str] = None, + status: Optional[Status] = None, + created_at: Optional[str] = None, + updated_at: Optional[str] = None, + completed_at: Optional[str] = None, + expires_at: Optional[str] = None, + urls: Optional[List[str]] = None, + message: Optional[str] = None, + metadata: Optional[Metadata] = None, + contact_count: Optional[int] = None, ): - self.id=id - self.status=status - self.created_at=created_at - self.updated_at=updated_at - self.completed_at=completed_at - self.expires_at=expires_at - self.urls=urls - self.message=message - self.metadata=metadata - self.contact_count=contact_count + self.id = id + self.status = status + self.created_at = created_at + self.updated_at = updated_at + self.completed_at = completed_at + self.expires_at = expires_at + self.urls = urls + self.message = message + self.metadata = metadata + self.contact_count = contact_count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "status": self.status, - "created_at": self.created_at, - "updated_at": self.updated_at, - "completed_at": self.completed_at, - "expires_at": self.expires_at, - "urls": self.urls, - "message": self.message, - "_metadata": self.metadata, - "contact_count": self.contact_count - }.items() if value is not None} + "id": self.id, + "status": self.status, + "created_at": self.created_at, + "updated_at": self.updated_at, + "completed_at": self.completed_at, + "expires_at": self.expires_at, + "urls": self.urls, + "message": self.message, + "_metadata": self.metadata, + "contact_count": self.contact_count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -54,15 +54,14 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactExport( - id=payload.get('id'), - status=payload.get('status'), - created_at=payload.get('created_at'), - updated_at=payload.get('updated_at'), - completed_at=payload.get('completed_at'), - expires_at=payload.get('expires_at'), - urls=payload.get('urls'), - message=payload.get('message'), - metadata=payload.get('_metadata'), - contact_count=payload.get('contact_count') - ) - + id=payload.get("id"), + status=payload.get("status"), + created_at=payload.get("created_at"), + updated_at=payload.get("updated_at"), + completed_at=payload.get("completed_at"), + expires_at=payload.get("expires_at"), + urls=payload.get("urls"), + message=payload.get("message"), + metadata=payload.get("_metadata"), + contact_count=payload.get("contact_count"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/contact_import.py b/sendgrid/rest/api/mc_contacts/v3/models/contact_import.py index 6ed4fbab..0d86f002 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/contact_import.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/contact_import.py @@ -1,38 +1,40 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_contacts.v3.models.contact_import_results import ContactImportResults - +from sendgrid.rest.api.mc_contacts.v3.models.contact_import_results import ( + ContactImportResults, +) class ContactImport: def __init__( - self, - id: Optional[str]=None, - status: Optional[str]=None, - job_type: Optional[str]=None, - results: Optional[ContactImportResults]=None, - started_at: Optional[str]=None, - finished_at: Optional[str]=None + self, + id: Optional[str] = None, + status: Optional[str] = None, + job_type: Optional[str] = None, + results: Optional[ContactImportResults] = None, + started_at: Optional[str] = None, + finished_at: Optional[str] = None, ): - self.id=id - self.status=status - self.job_type=job_type - self.results=results - self.started_at=started_at - self.finished_at=finished_at + self.id = id + self.status = status + self.job_type = job_type + self.results = results + self.started_at = started_at + self.finished_at = finished_at def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "status": self.status, - "job_type": self.job_type, - "results": self.results, - "started_at": self.started_at, - "finished_at": self.finished_at - }.items() if value is not None} + "id": self.id, + "status": self.status, + "job_type": self.job_type, + "results": self.results, + "started_at": self.started_at, + "finished_at": self.finished_at, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -41,11 +43,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactImport( - id=payload.get('id'), - status=payload.get('status'), - job_type=payload.get('job_type'), - results=payload.get('results'), - started_at=payload.get('started_at'), - finished_at=payload.get('finished_at') - ) - + id=payload.get("id"), + status=payload.get("status"), + job_type=payload.get("job_type"), + results=payload.get("results"), + started_at=payload.get("started_at"), + finished_at=payload.get("finished_at"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/contact_import_results.py b/sendgrid/rest/api/mc_contacts/v3/models/contact_import_results.py index dd455bfc..2cd17eb7 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/contact_import_results.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/contact_import_results.py @@ -1,37 +1,37 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ContactImportResults: def __init__( - self, - requested_count: Optional[float]=None, - created_count: Optional[float]=None, - updated_count: Optional[float]=None, - deleted_count: Optional[float]=None, - errored_count: Optional[float]=None, - errors_url: Optional[str]=None + self, + requested_count: Optional[float] = None, + created_count: Optional[float] = None, + updated_count: Optional[float] = None, + deleted_count: Optional[float] = None, + errored_count: Optional[float] = None, + errors_url: Optional[str] = None, ): - self.requested_count=requested_count - self.created_count=created_count - self.updated_count=updated_count - self.deleted_count=deleted_count - self.errored_count=errored_count - self.errors_url=errors_url + self.requested_count = requested_count + self.created_count = created_count + self.updated_count = updated_count + self.deleted_count = deleted_count + self.errored_count = errored_count + self.errors_url = errors_url def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "requested_count": self.requested_count, - "created_count": self.created_count, - "updated_count": self.updated_count, - "deleted_count": self.deleted_count, - "errored_count": self.errored_count, - "errors_url": self.errors_url - }.items() if value is not None} + "requested_count": self.requested_count, + "created_count": self.created_count, + "updated_count": self.updated_count, + "deleted_count": self.deleted_count, + "errored_count": self.errored_count, + "errors_url": self.errors_url, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -40,11 +40,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactImportResults( - requested_count=payload.get('requested_count'), - created_count=payload.get('created_count'), - updated_count=payload.get('updated_count'), - deleted_count=payload.get('deleted_count'), - errored_count=payload.get('errored_count'), - errors_url=payload.get('errors_url') - ) - + requested_count=payload.get("requested_count"), + created_count=payload.get("created_count"), + updated_count=payload.get("updated_count"), + deleted_count=payload.get("deleted_count"), + errored_count=payload.get("errored_count"), + errors_url=payload.get("errors_url"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/contact_request.py b/sendgrid/rest/api/mc_contacts/v3/models/contact_request.py index b8e47f92..578ce0ed 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/contact_request.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/contact_request.py @@ -1,62 +1,64 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_contacts.v3.models.contact_request_custom_fields import ContactRequestCustomFields - +from sendgrid.rest.api.mc_contacts.v3.models.contact_request_custom_fields import ( + ContactRequestCustomFields, +) class ContactRequest: def __init__( - self, - address_line_1: Optional[str]=None, - address_line_2: Optional[str]=None, - alternate_emails: Optional[List[str]]=None, - city: Optional[str]=None, - country: Optional[str]=None, - email: Optional[str]=None, - phone_number_id: Optional[str]=None, - external_id: Optional[str]=None, - anonymous_id: Optional[str]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - postal_code: Optional[str]=None, - state_province_region: Optional[str]=None, - custom_fields: Optional[ContactRequestCustomFields]=None + self, + address_line_1: Optional[str] = None, + address_line_2: Optional[str] = None, + alternate_emails: Optional[List[str]] = None, + city: Optional[str] = None, + country: Optional[str] = None, + email: Optional[str] = None, + phone_number_id: Optional[str] = None, + external_id: Optional[str] = None, + anonymous_id: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + postal_code: Optional[str] = None, + state_province_region: Optional[str] = None, + custom_fields: Optional[ContactRequestCustomFields] = None, ): - self.address_line_1=address_line_1 - self.address_line_2=address_line_2 - self.alternate_emails=alternate_emails - self.city=city - self.country=country - self.email=email - self.phone_number_id=phone_number_id - self.external_id=external_id - self.anonymous_id=anonymous_id - self.first_name=first_name - self.last_name=last_name - self.postal_code=postal_code - self.state_province_region=state_province_region - self.custom_fields=custom_fields + self.address_line_1 = address_line_1 + self.address_line_2 = address_line_2 + self.alternate_emails = alternate_emails + self.city = city + self.country = country + self.email = email + self.phone_number_id = phone_number_id + self.external_id = external_id + self.anonymous_id = anonymous_id + self.first_name = first_name + self.last_name = last_name + self.postal_code = postal_code + self.state_province_region = state_province_region + self.custom_fields = custom_fields def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "address_line_1": self.address_line_1, - "address_line_2": self.address_line_2, - "alternate_emails": self.alternate_emails, - "city": self.city, - "country": self.country, - "email": self.email, - "phone_number_id": self.phone_number_id, - "external_id": self.external_id, - "anonymous_id": self.anonymous_id, - "first_name": self.first_name, - "last_name": self.last_name, - "postal_code": self.postal_code, - "state_province_region": self.state_province_region, - "custom_fields": self.custom_fields - }.items() if value is not None} + "address_line_1": self.address_line_1, + "address_line_2": self.address_line_2, + "alternate_emails": self.alternate_emails, + "city": self.city, + "country": self.country, + "email": self.email, + "phone_number_id": self.phone_number_id, + "external_id": self.external_id, + "anonymous_id": self.anonymous_id, + "first_name": self.first_name, + "last_name": self.last_name, + "postal_code": self.postal_code, + "state_province_region": self.state_province_region, + "custom_fields": self.custom_fields, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -65,19 +67,18 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactRequest( - address_line_1=payload.get('address_line_1'), - address_line_2=payload.get('address_line_2'), - alternate_emails=payload.get('alternate_emails'), - city=payload.get('city'), - country=payload.get('country'), - email=payload.get('email'), - phone_number_id=payload.get('phone_number_id'), - external_id=payload.get('external_id'), - anonymous_id=payload.get('anonymous_id'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - postal_code=payload.get('postal_code'), - state_province_region=payload.get('state_province_region'), - custom_fields=payload.get('custom_fields') - ) - + address_line_1=payload.get("address_line_1"), + address_line_2=payload.get("address_line_2"), + alternate_emails=payload.get("alternate_emails"), + city=payload.get("city"), + country=payload.get("country"), + email=payload.get("email"), + phone_number_id=payload.get("phone_number_id"), + external_id=payload.get("external_id"), + anonymous_id=payload.get("anonymous_id"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + postal_code=payload.get("postal_code"), + state_province_region=payload.get("state_province_region"), + custom_fields=payload.get("custom_fields"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/contact_request_custom_fields.py b/sendgrid/rest/api/mc_contacts/v3/models/contact_request_custom_fields.py index d450bccd..346be04c 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/contact_request_custom_fields.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/contact_request_custom_fields.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ContactRequestCustomFields: - def __init__( - self, - w1: Optional[str]=None - ): - self.w1=w1 + def __init__(self, w1: Optional[str] = None): + self.w1 = w1 def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "w1": self.w1 - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"w1": self.w1}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ContactRequestCustomFields( - w1=payload.get('w1') - ) - + return ContactRequestCustomFields(w1=payload.get("w1")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/contacts_error.py b/sendgrid/rest/api/mc_contacts/v3/models/contacts_error.py index 24261d1a..9b4a9257 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/contacts_error.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/contacts_error.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ContactsError: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - error_id: Optional[str]=None, - parameter: Optional[str]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + error_id: Optional[str] = None, + parameter: Optional[str] = None, ): - self.message=message - self.field=field - self.error_id=error_id - self.parameter=parameter + self.message = message + self.field = field + self.error_id = error_id + self.parameter = parameter def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "error_id": self.error_id, - "parameter": self.parameter - }.items() if value is not None} + "message": self.message, + "field": self.field, + "error_id": self.error_id, + "parameter": self.parameter, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactsError( - message=payload.get('message'), - field=payload.get('field'), - error_id=payload.get('error_id'), - parameter=payload.get('parameter') - ) - + message=payload.get("message"), + field=payload.get("field"), + error_id=payload.get("error_id"), + parameter=payload.get("parameter"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/delete_contact202_response.py b/sendgrid/rest/api/mc_contacts/v3/models/delete_contact202_response.py index d988f446..fab99311 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/delete_contact202_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/delete_contact202_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DeleteContact202Response: - def __init__( - self, - job_id: Optional[object]=None - ): - self.job_id=job_id + def __init__(self, job_id: Optional[object] = None): + self.job_id = job_id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "job_id": self.job_id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"job_id": self.job_id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DeleteContact202Response( - job_id=payload.get('job_id') - ) - + return DeleteContact202Response(job_id=payload.get("job_id")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/delete_contact400_response.py b/sendgrid/rest/api/mc_contacts/v3/models/delete_contact400_response.py index 35fba447..064e486a 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/delete_contact400_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/delete_contact400_response.py @@ -1,22 +1,17 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DeleteContact400Response: - def __init__( - self, - errors: Optional[List[object]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[object]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DeleteContact400Response( - errors=payload.get('errors') - ) - + return DeleteContact400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/delete_contact_identifier202_response.py b/sendgrid/rest/api/mc_contacts/v3/models/delete_contact_identifier202_response.py index 2d10541c..d6d94228 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/delete_contact_identifier202_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/delete_contact_identifier202_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DeleteContactIdentifier202Response: - def __init__( - self, - job_id: Optional[object]=None - ): - self.job_id=job_id + def __init__(self, job_id: Optional[object] = None): + self.job_id = job_id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "job_id": self.job_id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"job_id": self.job_id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DeleteContactIdentifier202Response( - job_id=payload.get('job_id') - ) - + return DeleteContactIdentifier202Response(job_id=payload.get("job_id")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/delete_contact_identifier_request.py b/sendgrid/rest/api/mc_contacts/v3/models/delete_contact_identifier_request.py index 7fb6605a..b133abcb 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/delete_contact_identifier_request.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/delete_contact_identifier_request.py @@ -1,26 +1,26 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.identifier_type import IdentifierType - class DeleteContactIdentifierRequest: def __init__( - self, - identifier_type: Optional[IdentifierType]=None, - identifier_value: Optional[str]=None + self, + identifier_type: Optional[IdentifierType] = None, + identifier_value: Optional[str] = None, ): - self.identifier_type=identifier_type - self.identifier_value=identifier_value + self.identifier_type = identifier_type + self.identifier_value = identifier_value def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "identifier_type": self.identifier_type, - "identifier_value": self.identifier_value - }.items() if value is not None} + "identifier_type": self.identifier_type, + "identifier_value": self.identifier_value, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +29,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return DeleteContactIdentifierRequest( - identifier_type=payload.get('identifier_type'), - identifier_value=payload.get('identifier_value') - ) - + identifier_type=payload.get("identifier_type"), + identifier_value=payload.get("identifier_value"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/error_response.py b/sendgrid/rest/api/mc_contacts/v3/models/error_response.py index 279c2021..be9b472a 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/error_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_contacts.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.mc_contacts.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/mc_contacts/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/export_contact202_response.py b/sendgrid/rest/api/mc_contacts/v3/models/export_contact202_response.py index 474c769e..055f2b17 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/export_contact202_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/export_contact202_response.py @@ -1,26 +1,19 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.metadata import Metadata - class ExportContact202Response: - def __init__( - self, - metadata: Optional[Metadata]=None, - id: Optional[str]=None - ): - self.metadata=metadata - self.id=id + def __init__(self, metadata: Optional[Metadata] = None, id: Optional[str] = None): + self.metadata = metadata + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "_metadata": self.metadata, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"_metadata": self.metadata, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +22,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ExportContact202Response( - metadata=payload.get('_metadata'), - id=payload.get('id') - ) - + metadata=payload.get("_metadata"), id=payload.get("id") + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/export_contact_request.py b/sendgrid/rest/api/mc_contacts/v3/models/export_contact_request.py index 11b37fdc..e42be19e 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/export_contact_request.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/export_contact_request.py @@ -1,36 +1,38 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_contacts.v3.models.export_contact_request_notifications import ExportContactRequestNotifications +from sendgrid.rest.api.mc_contacts.v3.models.export_contact_request_notifications import ( + ExportContactRequestNotifications, +) from sendgrid.rest.api.mc_contacts.v3.models.file_type import FileType - class ExportContactRequest: def __init__( - self, - list_ids: Optional[List[str]]=None, - segment_ids: Optional[List[str]]=None, - notifications: Optional[ExportContactRequestNotifications]=None, - file_type: Optional[FileType]=None, - max_file_size: Optional[int]=None + self, + list_ids: Optional[List[str]] = None, + segment_ids: Optional[List[str]] = None, + notifications: Optional[ExportContactRequestNotifications] = None, + file_type: Optional[FileType] = None, + max_file_size: Optional[int] = None, ): - self.list_ids=list_ids - self.segment_ids=segment_ids - self.notifications=notifications - self.file_type=file_type - self.max_file_size=max_file_size + self.list_ids = list_ids + self.segment_ids = segment_ids + self.notifications = notifications + self.file_type = file_type + self.max_file_size = max_file_size def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "list_ids": self.list_ids, - "segment_ids": self.segment_ids, - "notifications": self.notifications, - "file_type": self.file_type, - "max_file_size": self.max_file_size - }.items() if value is not None} + "list_ids": self.list_ids, + "segment_ids": self.segment_ids, + "notifications": self.notifications, + "file_type": self.file_type, + "max_file_size": self.max_file_size, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -39,10 +41,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ExportContactRequest( - list_ids=payload.get('list_ids'), - segment_ids=payload.get('segment_ids'), - notifications=payload.get('notifications'), - file_type=payload.get('file_type'), - max_file_size=payload.get('max_file_size') - ) - + list_ids=payload.get("list_ids"), + segment_ids=payload.get("segment_ids"), + notifications=payload.get("notifications"), + file_type=payload.get("file_type"), + max_file_size=payload.get("max_file_size"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/export_contact_request_notifications.py b/sendgrid/rest/api/mc_contacts/v3/models/export_contact_request_notifications.py index 8e978bbe..5bc56609 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/export_contact_request_notifications.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/export_contact_request_notifications.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ExportContactRequestNotifications: - def __init__( - self, - email: Optional[bool]=None - ): - self.email=email + def __init__(self, email: Optional[bool] = None): + self.email = email def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ExportContactRequestNotifications( - email=payload.get('email') - ) - + return ExportContactRequestNotifications(email=payload.get("email")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/file_type.py b/sendgrid/rest/api/mc_contacts/v3/models/file_type.py index 55357ae2..d8c79ffb 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/file_type.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/file_type.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class FileType(Enum): - CSV='csv' - JSON='json' - + CSV = "csv" + JSON = "json" diff --git a/sendgrid/rest/api/mc_contacts/v3/models/file_type1.py b/sendgrid/rest/api/mc_contacts/v3/models/file_type1.py index 1f325fbf..c5815b1f 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/file_type1.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/file_type1.py @@ -1,10 +1,6 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class FileType1(Enum): - CSV='csv' - + CSV = "csv" diff --git a/sendgrid/rest/api/mc_contacts/v3/models/get_contact_by_identifiers200_response.py b/sendgrid/rest/api/mc_contacts/v3/models/get_contact_by_identifiers200_response.py index 6a7f2eaf..7faa958f 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/get_contact_by_identifiers200_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/get_contact_by_identifiers200_response.py @@ -1,23 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_contacts.v3.models.get_contact_by_identifiers200_response_result_value import GetContactByIdentifiers200ResponseResultValue - class GetContactByIdentifiers200Response: - def __init__( - self, - result: Optional[object]=None - ): - self.result=result + def __init__(self, result: Optional[object] = None): + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetContactByIdentifiers200Response( - result=payload.get('result') - ) - + return GetContactByIdentifiers200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/get_contact_by_identifiers200_response_result_value.py b/sendgrid/rest/api/mc_contacts/v3/models/get_contact_by_identifiers200_response_result_value.py index 8a8bf5e4..94431048 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/get_contact_by_identifiers200_response_result_value.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/get_contact_by_identifiers200_response_result_value.py @@ -1,26 +1,21 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.contact_details3 import ContactDetails3 - class GetContactByIdentifiers200ResponseResultValue: def __init__( - self, - contact: Optional[ContactDetails3]=None, - error: Optional[str]=None + self, contact: Optional[ContactDetails3] = None, error: Optional[str] = None ): - self.contact=contact - self.error=error + self.contact = contact + self.error = error def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "contact": self.contact, - "error": self.error - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"contact": self.contact, "error": self.error}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +24,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetContactByIdentifiers200ResponseResultValue( - contact=payload.get('contact'), - error=payload.get('error') - ) - + contact=payload.get("contact"), error=payload.get("error") + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/get_contact_by_identifiers_request.py b/sendgrid/rest/api/mc_contacts/v3/models/get_contact_by_identifiers_request.py index a93e0a5c..634f4e47 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/get_contact_by_identifiers_request.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/get_contact_by_identifiers_request.py @@ -1,22 +1,17 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GetContactByIdentifiersRequest: - def __init__( - self, - identifiers: Optional[List[str]]=None - ): - self.identifiers=identifiers + def __init__(self, identifiers: Optional[List[str]] = None): + self.identifiers = identifiers def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "identifiers": self.identifiers - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"identifiers": self.identifiers}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetContactByIdentifiersRequest( - identifiers=payload.get('identifiers') - ) - + return GetContactByIdentifiersRequest(identifiers=payload.get("identifiers")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/get_import_contact400_response.py b/sendgrid/rest/api/mc_contacts/v3/models/get_import_contact400_response.py index c0c71b5b..59d7ff81 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/get_import_contact400_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/get_import_contact400_response.py @@ -1,23 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.contacts_error import ContactsError - class GetImportContact400Response: - def __init__( - self, - errors: Optional[ContactsError]=None - ): - self.errors=errors + def __init__(self, errors: Optional[ContactsError] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetImportContact400Response( - errors=payload.get('errors') - ) - + return GetImportContact400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/identifier_type.py b/sendgrid/rest/api/mc_contacts/v3/models/identifier_type.py index 902f6608..075ab993 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/identifier_type.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/identifier_type.py @@ -1,13 +1,9 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class IdentifierType(Enum): - EMAIL='EMAIL' - PHONENUMBERID='PHONENUMBERID' - EXTERNALID='EXTERNALID' - ANONYMOUSID='ANONYMOUSID' - + EMAIL = "EMAIL" + PHONENUMBERID = "PHONENUMBERID" + EXTERNALID = "EXTERNALID" + ANONYMOUSID = "ANONYMOUSID" diff --git a/sendgrid/rest/api/mc_contacts/v3/models/identifier_type1.py b/sendgrid/rest/api/mc_contacts/v3/models/identifier_type1.py index 9feb5d69..dbd6aa9b 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/identifier_type1.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/identifier_type1.py @@ -1,13 +1,9 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class IdentifierType1(Enum): - EMAIL='email' - PHONE_NUMBER_ID='phone_number_id' - EXTERNAL_ID='external_id' - ANONYMOUS_ID='anonymous_id' - + EMAIL = "email" + PHONE_NUMBER_ID = "phone_number_id" + EXTERNAL_ID = "external_id" + ANONYMOUS_ID = "anonymous_id" diff --git a/sendgrid/rest/api/mc_contacts/v3/models/import_contact200_response.py b/sendgrid/rest/api/mc_contacts/v3/models/import_contact200_response.py index 01d2b7ee..7d0d63d1 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/import_contact200_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/import_contact200_response.py @@ -1,29 +1,33 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_contacts.v3.models.import_contact200_response_upload_headers_inner import ImportContact200ResponseUploadHeadersInner - +from sendgrid.rest.api.mc_contacts.v3.models.import_contact200_response_upload_headers_inner import ( + ImportContact200ResponseUploadHeadersInner, +) class ImportContact200Response: def __init__( - self, - job_id: Optional[str]=None, - upload_uri: Optional[str]=None, - upload_headers: Optional[List[ImportContact200ResponseUploadHeadersInner]]=None + self, + job_id: Optional[str] = None, + upload_uri: Optional[str] = None, + upload_headers: Optional[ + List[ImportContact200ResponseUploadHeadersInner] + ] = None, ): - self.job_id=job_id - self.upload_uri=upload_uri - self.upload_headers=upload_headers + self.job_id = job_id + self.upload_uri = upload_uri + self.upload_headers = upload_headers def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "job_id": self.job_id, - "upload_uri": self.upload_uri, - "upload_headers": self.upload_headers - }.items() if value is not None} + "job_id": self.job_id, + "upload_uri": self.upload_uri, + "upload_headers": self.upload_headers, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +36,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ImportContact200Response( - job_id=payload.get('job_id'), - upload_uri=payload.get('upload_uri'), - upload_headers=payload.get('upload_headers') - ) - + job_id=payload.get("job_id"), + upload_uri=payload.get("upload_uri"), + upload_headers=payload.get("upload_headers"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/import_contact200_response_upload_headers_inner.py b/sendgrid/rest/api/mc_contacts/v3/models/import_contact200_response_upload_headers_inner.py index 90e4e015..994b1852 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/import_contact200_response_upload_headers_inner.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/import_contact200_response_upload_headers_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ImportContact200ResponseUploadHeadersInner: - def __init__( - self, - header: Optional[str]=None, - value: Optional[str]=None - ): - self.header=header - self.value=value + def __init__(self, header: Optional[str] = None, value: Optional[str] = None): + self.header = header + self.value = value def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "header": self.header, - "value": self.value - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"header": self.header, "value": self.value}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ImportContact200ResponseUploadHeadersInner( - header=payload.get('header'), - value=payload.get('value') - ) - + header=payload.get("header"), value=payload.get("value") + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/import_contact400_response.py b/sendgrid/rest/api/mc_contacts/v3/models/import_contact400_response.py index 60dbe014..54a1670b 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/import_contact400_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/import_contact400_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.contacts_error import ContactsError - class ImportContact400Response: - def __init__( - self, - errors: Optional[List[ContactsError]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[ContactsError]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ImportContact400Response( - errors=payload.get('errors') - ) - + return ImportContact400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/import_contact404_response.py b/sendgrid/rest/api/mc_contacts/v3/models/import_contact404_response.py index 456daebe..9b2ce23e 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/import_contact404_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/import_contact404_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.contacts_error import ContactsError - class ImportContact404Response: - def __init__( - self, - errors: Optional[List[ContactsError]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[ContactsError]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ImportContact404Response( - errors=payload.get('errors') - ) - + return ImportContact404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/import_contact_request.py b/sendgrid/rest/api/mc_contacts/v3/models/import_contact_request.py index af57e0a3..3264c618 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/import_contact_request.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/import_contact_request.py @@ -1,29 +1,29 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.file_type1 import FileType1 - class ImportContactRequest: def __init__( - self, - list_ids: Optional[List[str]]=None, - file_type: Optional[FileType1]=None, - field_mappings: Optional[List[str]]=None + self, + list_ids: Optional[List[str]] = None, + file_type: Optional[FileType1] = None, + field_mappings: Optional[List[str]] = None, ): - self.list_ids=list_ids - self.file_type=file_type - self.field_mappings=field_mappings + self.list_ids = list_ids + self.file_type = file_type + self.field_mappings = field_mappings def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "list_ids": self.list_ids, - "file_type": self.file_type, - "field_mappings": self.field_mappings - }.items() if value is not None} + "list_ids": self.list_ids, + "file_type": self.file_type, + "field_mappings": self.field_mappings, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +32,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ImportContactRequest( - list_ids=payload.get('list_ids'), - file_type=payload.get('file_type'), - field_mappings=payload.get('field_mappings') - ) - + list_ids=payload.get("list_ids"), + file_type=payload.get("file_type"), + field_mappings=payload.get("field_mappings"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_batched_contact200_response.py b/sendgrid/rest/api/mc_contacts/v3/models/list_batched_contact200_response.py index df3fccbf..b52a33d0 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_batched_contact200_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_batched_contact200_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.contact_details3 import ContactDetails3 - class ListBatchedContact200Response: - def __init__( - self, - result: Optional[List[ContactDetails3]]=None - ): - self.result=result + def __init__(self, result: Optional[List[ContactDetails3]] = None): + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListBatchedContact200Response( - result=payload.get('result') - ) - + return ListBatchedContact200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_batched_contact_request.py b/sendgrid/rest/api/mc_contacts/v3/models/list_batched_contact_request.py index d12cdaea..44330319 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_batched_contact_request.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_batched_contact_request.py @@ -1,22 +1,17 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListBatchedContactRequest: - def __init__( - self, - ids: Optional[List[str]]=None - ): - self.ids=ids + def __init__(self, ids: Optional[List[str]] = None): + self.ids = ids def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ids": self.ids - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ids": self.ids}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListBatchedContactRequest( - ids=payload.get('ids') - ) - + return ListBatchedContactRequest(ids=payload.get("ids")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_contact200_response.py b/sendgrid/rest/api/mc_contacts/v3/models/list_contact200_response.py index bbf51495..65910dab 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_contact200_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_contact200_response.py @@ -1,30 +1,30 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.contact_details3 import ContactDetails3 from sendgrid.rest.api.mc_contacts.v3.models.self_metadata import SelfMetadata - class ListContact200Response: def __init__( - self, - result: Optional[List[ContactDetails3]]=None, - metadata: Optional[SelfMetadata]=None, - contact_count: Optional[int]=None + self, + result: Optional[List[ContactDetails3]] = None, + metadata: Optional[SelfMetadata] = None, + contact_count: Optional[int] = None, ): - self.result=result - self.metadata=metadata - self.contact_count=contact_count + self.result = result + self.metadata = metadata + self.contact_count = contact_count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "result": self.result, - "_metadata": self.metadata, - "contact_count": self.contact_count - }.items() if value is not None} + "result": self.result, + "_metadata": self.metadata, + "contact_count": self.contact_count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -33,8 +33,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListContact200Response( - result=payload.get('result'), - metadata=payload.get('_metadata'), - contact_count=payload.get('contact_count') - ) - + result=payload.get("result"), + metadata=payload.get("_metadata"), + contact_count=payload.get("contact_count"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_contact400_response.py b/sendgrid/rest/api/mc_contacts/v3/models/list_contact400_response.py index 1fcdb85b..2590d293 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_contact400_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_contact400_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.contacts_error import ContactsError - class ListContact400Response: - def __init__( - self, - errors: Optional[List[ContactsError]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[ContactsError]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListContact400Response( - errors=payload.get('errors') - ) - + return ListContact400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_contact_by_email200_response.py b/sendgrid/rest/api/mc_contacts/v3/models/list_contact_by_email200_response.py index 2be220f3..ad211e77 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_contact_by_email200_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_contact_by_email200_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListContactByEmail200Response: - def __init__( - self, - result: Optional[object]=None - ): - self.result=result + def __init__(self, result: Optional[object] = None): + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListContactByEmail200Response( - result=payload.get('result') - ) - + return ListContactByEmail200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_contact_by_email_request.py b/sendgrid/rest/api/mc_contacts/v3/models/list_contact_by_email_request.py index 8d6849f0..c9052a60 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_contact_by_email_request.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_contact_by_email_request.py @@ -1,31 +1,31 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListContactByEmailRequest: def __init__( - self, - emails: Optional[List[str]]=None, - phone_number_id: Optional[str]=None, - external_id: Optional[str]=None, - anonymous_id: Optional[str]=None + self, + emails: Optional[List[str]] = None, + phone_number_id: Optional[str] = None, + external_id: Optional[str] = None, + anonymous_id: Optional[str] = None, ): - self.emails=emails - self.phone_number_id=phone_number_id - self.external_id=external_id - self.anonymous_id=anonymous_id + self.emails = emails + self.phone_number_id = phone_number_id + self.external_id = external_id + self.anonymous_id = anonymous_id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "emails": self.emails, - "phone_number_id": self.phone_number_id, - "external_id": self.external_id, - "anonymous_id": self.anonymous_id - }.items() if value is not None} + "emails": self.emails, + "phone_number_id": self.phone_number_id, + "external_id": self.external_id, + "anonymous_id": self.anonymous_id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListContactByEmailRequest( - emails=payload.get('emails'), - phone_number_id=payload.get('phone_number_id'), - external_id=payload.get('external_id'), - anonymous_id=payload.get('anonymous_id') - ) - + emails=payload.get("emails"), + phone_number_id=payload.get("phone_number_id"), + external_id=payload.get("external_id"), + anonymous_id=payload.get("anonymous_id"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_contact_count200_response.py b/sendgrid/rest/api/mc_contacts/v3/models/list_contact_count200_response.py index 61b33470..916a8cba 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_contact_count200_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_contact_count200_response.py @@ -1,29 +1,33 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_contacts.v3.models.list_contact_count200_response_billable_breakdown import ListContactCount200ResponseBillableBreakdown - +from sendgrid.rest.api.mc_contacts.v3.models.list_contact_count200_response_billable_breakdown import ( + ListContactCount200ResponseBillableBreakdown, +) class ListContactCount200Response: def __init__( - self, - contact_count: Optional[int]=None, - billable_count: Optional[int]=None, - billable_breakdown: Optional[ListContactCount200ResponseBillableBreakdown]=None + self, + contact_count: Optional[int] = None, + billable_count: Optional[int] = None, + billable_breakdown: Optional[ + ListContactCount200ResponseBillableBreakdown + ] = None, ): - self.contact_count=contact_count - self.billable_count=billable_count - self.billable_breakdown=billable_breakdown + self.contact_count = contact_count + self.billable_count = billable_count + self.billable_breakdown = billable_breakdown def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "contact_count": self.contact_count, - "billable_count": self.billable_count, - "billable_breakdown": self.billable_breakdown - }.items() if value is not None} + "contact_count": self.contact_count, + "billable_count": self.billable_count, + "billable_breakdown": self.billable_breakdown, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +36,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListContactCount200Response( - contact_count=payload.get('contact_count'), - billable_count=payload.get('billable_count'), - billable_breakdown=payload.get('billable_breakdown') - ) - + contact_count=payload.get("contact_count"), + billable_count=payload.get("billable_count"), + billable_breakdown=payload.get("billable_breakdown"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_contact_count200_response_billable_breakdown.py b/sendgrid/rest/api/mc_contacts/v3/models/list_contact_count200_response_billable_breakdown.py index 6c711c08..e833110f 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_contact_count200_response_billable_breakdown.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_contact_count200_response_billable_breakdown.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListContactCount200ResponseBillableBreakdown: - def __init__( - self, - total: Optional[int]=None, - breakdown: Optional[object]=None - ): - self.total=total - self.breakdown=breakdown + def __init__(self, total: Optional[int] = None, breakdown: Optional[object] = None): + self.total = total + self.breakdown = breakdown def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "total": self.total, - "breakdown": self.breakdown - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"total": self.total, "breakdown": self.breakdown}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListContactCount200ResponseBillableBreakdown( - total=payload.get('total'), - breakdown=payload.get('breakdown') - ) - + total=payload.get("total"), breakdown=payload.get("breakdown") + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response.py b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response.py index 27ef3f2b..12a7c544 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response.py @@ -1,27 +1,31 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_metadata import ListExportContact200ResponseMetadata -from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_result_inner import ListExportContact200ResponseResultInner - +from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_metadata import ( + ListExportContact200ResponseMetadata, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_result_inner import ( + ListExportContact200ResponseResultInner, +) class ListExportContact200Response: def __init__( - self, - result: Optional[List[ListExportContact200ResponseResultInner]]=None, - metadata: Optional[ListExportContact200ResponseMetadata]=None + self, + result: Optional[List[ListExportContact200ResponseResultInner]] = None, + metadata: Optional[ListExportContact200ResponseMetadata] = None, ): - self.result=result - self.metadata=metadata + self.result = result + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "result": self.result, - "_metadata": self.metadata - }.items() if value is not None} + "result": self.result, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -30,7 +34,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListExportContact200Response( - result=payload.get('result'), - metadata=payload.get('_metadata') - ) - + result=payload.get("result"), metadata=payload.get("_metadata") + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_metadata.py b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_metadata.py index ea3610fe..a3f9d643 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_metadata.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_metadata.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListExportContact200ResponseMetadata: def __init__( - self, - prev: Optional[str]=None, - var_self: Optional[str]=None, - next: Optional[str]=None + self, + prev: Optional[str] = None, + var_self: Optional[str] = None, + next: Optional[str] = None, ): - self.prev=prev - self.var_self=var_self - self.next=next + self.prev = prev + self.var_self = var_self + self.next = next def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "prev": self.prev, - "self": self.var_self, - "next": self.next - }.items() if value is not None} + "prev": self.prev, + "self": self.var_self, + "next": self.next, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListExportContact200ResponseMetadata( - prev=payload.get('prev'), - var_self=payload.get('self'), - next=payload.get('next') - ) - + prev=payload.get("prev"), + var_self=payload.get("self"), + next=payload.get("next"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_result_inner.py b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_result_inner.py index 64f28250..e6faab30 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_result_inner.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_result_inner.py @@ -1,54 +1,62 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_result_inner_metadata import ListExportContact200ResponseResultInnerMetadata -from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_result_inner_segments_inner import ListExportContact200ResponseResultInnerSegmentsInner - +from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_result_inner_metadata import ( + ListExportContact200ResponseResultInnerMetadata, +) +from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact200_response_result_inner_segments_inner import ( + ListExportContact200ResponseResultInnerSegmentsInner, +) class ListExportContact200ResponseResultInner: def __init__( - self, - id: Optional[str]=None, - status: Optional[str]=None, - created_at: Optional[str]=None, - completed_at: Optional[str]=None, - expires_at: Optional[str]=None, - urls: Optional[List[str]]=None, - user_id: Optional[str]=None, - export_type: Optional[str]=None, - segments: Optional[List[ListExportContact200ResponseResultInnerSegmentsInner]]=None, - lists: Optional[List[ListExportContact200ResponseResultInnerSegmentsInner]]=None, - metadata: Optional[ListExportContact200ResponseResultInnerMetadata]=None + self, + id: Optional[str] = None, + status: Optional[str] = None, + created_at: Optional[str] = None, + completed_at: Optional[str] = None, + expires_at: Optional[str] = None, + urls: Optional[List[str]] = None, + user_id: Optional[str] = None, + export_type: Optional[str] = None, + segments: Optional[ + List[ListExportContact200ResponseResultInnerSegmentsInner] + ] = None, + lists: Optional[ + List[ListExportContact200ResponseResultInnerSegmentsInner] + ] = None, + metadata: Optional[ListExportContact200ResponseResultInnerMetadata] = None, ): - self.id=id - self.status=status - self.created_at=created_at - self.completed_at=completed_at - self.expires_at=expires_at - self.urls=urls - self.user_id=user_id - self.export_type=export_type - self.segments=segments - self.lists=lists - self.metadata=metadata + self.id = id + self.status = status + self.created_at = created_at + self.completed_at = completed_at + self.expires_at = expires_at + self.urls = urls + self.user_id = user_id + self.export_type = export_type + self.segments = segments + self.lists = lists + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "status": self.status, - "created_at": self.created_at, - "completed_at": self.completed_at, - "expires_at": self.expires_at, - "urls": self.urls, - "user_id": self.user_id, - "export_type": self.export_type, - "segments": self.segments, - "lists": self.lists, - "_metadata": self.metadata - }.items() if value is not None} + "id": self.id, + "status": self.status, + "created_at": self.created_at, + "completed_at": self.completed_at, + "expires_at": self.expires_at, + "urls": self.urls, + "user_id": self.user_id, + "export_type": self.export_type, + "segments": self.segments, + "lists": self.lists, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -57,16 +65,15 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListExportContact200ResponseResultInner( - id=payload.get('id'), - status=payload.get('status'), - created_at=payload.get('created_at'), - completed_at=payload.get('completed_at'), - expires_at=payload.get('expires_at'), - urls=payload.get('urls'), - user_id=payload.get('user_id'), - export_type=payload.get('export_type'), - segments=payload.get('segments'), - lists=payload.get('lists'), - metadata=payload.get('_metadata') - ) - + id=payload.get("id"), + status=payload.get("status"), + created_at=payload.get("created_at"), + completed_at=payload.get("completed_at"), + expires_at=payload.get("expires_at"), + urls=payload.get("urls"), + user_id=payload.get("user_id"), + export_type=payload.get("export_type"), + segments=payload.get("segments"), + lists=payload.get("lists"), + metadata=payload.get("_metadata"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_result_inner_metadata.py b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_result_inner_metadata.py index 8434815b..d2b4fd6d 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_result_inner_metadata.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_result_inner_metadata.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListExportContact200ResponseResultInnerMetadata: def __init__( - self, - prev: Optional[str]=None, - var_self: Optional[str]=None, - next: Optional[str]=None + self, + prev: Optional[str] = None, + var_self: Optional[str] = None, + next: Optional[str] = None, ): - self.prev=prev - self.var_self=var_self - self.next=next + self.prev = prev + self.var_self = var_self + self.next = next def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "prev": self.prev, - "self": self.var_self, - "next": self.next - }.items() if value is not None} + "prev": self.prev, + "self": self.var_self, + "next": self.next, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListExportContact200ResponseResultInnerMetadata( - prev=payload.get('prev'), - var_self=payload.get('self'), - next=payload.get('next') - ) - + prev=payload.get("prev"), + var_self=payload.get("self"), + next=payload.get("next"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_result_inner_segments_inner.py b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_result_inner_segments_inner.py index 68bfcc04..17673d3a 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_result_inner_segments_inner.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact200_response_result_inner_segments_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListExportContact200ResponseResultInnerSegmentsInner: - def __init__( - self, - id: Optional[str]=None, - name: Optional[str]=None - ): - self.id=id - self.name=name + def __init__(self, id: Optional[str] = None, name: Optional[str] = None): + self.id = id + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ID": self.id, - "Name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ID": self.id, "Name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListExportContact200ResponseResultInnerSegmentsInner( - id=payload.get('ID'), - name=payload.get('Name') - ) - + id=payload.get("ID"), name=payload.get("Name") + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact400_response.py b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact400_response.py index 71cb9709..14e651b7 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact400_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact400_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact400_response_errors_inner import ListExportContact400ResponseErrorsInner - +from sendgrid.rest.api.mc_contacts.v3.models.list_export_contact400_response_errors_inner import ( + ListExportContact400ResponseErrorsInner, +) class ListExportContact400Response: def __init__( - self, - errors: Optional[List[ListExportContact400ResponseErrorsInner]]=None + self, errors: Optional[List[ListExportContact400ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListExportContact400Response( - errors=payload.get('errors') - ) - + return ListExportContact400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact400_response_errors_inner.py b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact400_response_errors_inner.py index ac8d93f1..a5fb1d1c 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact400_response_errors_inner.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/list_export_contact400_response_errors_inner.py @@ -1,25 +1,21 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListExportContact400ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None, - error_id: Optional[str]=None - ): - self.message=message - self.error_id=error_id + def __init__(self, message: Optional[str] = None, error_id: Optional[str] = None): + self.message = message + self.error_id = error_id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "error_id": self.error_id - }.items() if value is not None} + "message": self.message, + "error_id": self.error_id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +24,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListExportContact400ResponseErrorsInner( - message=payload.get('message'), - error_id=payload.get('error_id') - ) - + message=payload.get("message"), error_id=payload.get("error_id") + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/metadata.py b/sendgrid/rest/api/mc_contacts/v3/models/metadata.py index 1e8e145e..2d7bf72c 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/metadata.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/metadata.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class Metadata: def __init__( - self, - prev: Optional[str]=None, - var_self: Optional[str]=None, - next: Optional[str]=None, - count: Optional[float]=None + self, + prev: Optional[str] = None, + var_self: Optional[str] = None, + next: Optional[str] = None, + count: Optional[float] = None, ): - self.prev=prev - self.var_self=var_self - self.next=next - self.count=count + self.prev = prev + self.var_self = var_self + self.next = next + self.count = count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "prev": self.prev, - "self": self.var_self, - "next": self.next, - "count": self.count - }.items() if value is not None} + "prev": self.prev, + "self": self.var_self, + "next": self.next, + "count": self.count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Metadata( - prev=payload.get('prev'), - var_self=payload.get('self'), - next=payload.get('next'), - count=payload.get('count') - ) - + prev=payload.get("prev"), + var_self=payload.get("self"), + next=payload.get("next"), + count=payload.get("count"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/search_contact200_response.py b/sendgrid/rest/api/mc_contacts/v3/models/search_contact200_response.py index 98b352c0..e33009d8 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/search_contact200_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/search_contact200_response.py @@ -1,30 +1,30 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.contact_details3 import ContactDetails3 from sendgrid.rest.api.mc_contacts.v3.models.self_metadata import SelfMetadata - class SearchContact200Response: def __init__( - self, - result: Optional[List[ContactDetails3]]=None, - metadata: Optional[SelfMetadata]=None, - contact_count: Optional[float]=None + self, + result: Optional[List[ContactDetails3]] = None, + metadata: Optional[SelfMetadata] = None, + contact_count: Optional[float] = None, ): - self.result=result - self.metadata=metadata - self.contact_count=contact_count + self.result = result + self.metadata = metadata + self.contact_count = contact_count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "result": self.result, - "_metadata": self.metadata, - "contact_count": self.contact_count - }.items() if value is not None} + "result": self.result, + "_metadata": self.metadata, + "contact_count": self.contact_count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -33,8 +33,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SearchContact200Response( - result=payload.get('result'), - metadata=payload.get('_metadata'), - contact_count=payload.get('contact_count') - ) - + result=payload.get("result"), + metadata=payload.get("_metadata"), + contact_count=payload.get("contact_count"), + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/search_contact400_response.py b/sendgrid/rest/api/mc_contacts/v3/models/search_contact400_response.py index 59a38ac4..dd5bf381 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/search_contact400_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/search_contact400_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_contacts.v3.models.search_contact400_response_errors_inner import SearchContact400ResponseErrorsInner - +from sendgrid.rest.api.mc_contacts.v3.models.search_contact400_response_errors_inner import ( + SearchContact400ResponseErrorsInner, +) class SearchContact400Response: def __init__( - self, - errors: Optional[List[SearchContact400ResponseErrorsInner]]=None + self, errors: Optional[List[SearchContact400ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SearchContact400Response( - errors=payload.get('errors') - ) - + return SearchContact400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/search_contact400_response_errors_inner.py b/sendgrid/rest/api/mc_contacts/v3/models/search_contact400_response_errors_inner.py index baddce15..1b92d18e 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/search_contact400_response_errors_inner.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/search_contact400_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SearchContact400ResponseErrorsInner: - def __init__( - self, - field: Optional[str]=None, - message: Optional[str]=None - ): - self.field=field - self.message=message + def __init__(self, field: Optional[str] = None, message: Optional[str] = None): + self.field = field + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "field": self.field, - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"field": self.field, "message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SearchContact400ResponseErrorsInner( - field=payload.get('field'), - message=payload.get('message') - ) - + field=payload.get("field"), message=payload.get("message") + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/search_contact500_response.py b/sendgrid/rest/api/mc_contacts/v3/models/search_contact500_response.py index 0c0cadcd..c0457c7f 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/search_contact500_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/search_contact500_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_contacts.v3.models.search_contact500_response_errors_inner import SearchContact500ResponseErrorsInner - +from sendgrid.rest.api.mc_contacts.v3.models.search_contact500_response_errors_inner import ( + SearchContact500ResponseErrorsInner, +) class SearchContact500Response: def __init__( - self, - errors: Optional[List[SearchContact500ResponseErrorsInner]]=None + self, errors: Optional[List[SearchContact500ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SearchContact500Response( - errors=payload.get('errors') - ) - + return SearchContact500Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/search_contact500_response_errors_inner.py b/sendgrid/rest/api/mc_contacts/v3/models/search_contact500_response_errors_inner.py index 1e552ce1..b666e6fe 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/search_contact500_response_errors_inner.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/search_contact500_response_errors_inner.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SearchContact500ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SearchContact500ResponseErrorsInner( - message=payload.get('message') - ) - + return SearchContact500ResponseErrorsInner(message=payload.get("message")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/search_contact_request.py b/sendgrid/rest/api/mc_contacts/v3/models/search_contact_request.py index c91d213e..c37a109c 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/search_contact_request.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/search_contact_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SearchContactRequest: - def __init__( - self, - query: Optional[str]=None - ): - self.query=query + def __init__(self, query: Optional[str] = None): + self.query = query def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "query": self.query - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"query": self.query}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SearchContactRequest( - query=payload.get('query') - ) - + return SearchContactRequest(query=payload.get("query")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/self_metadata.py b/sendgrid/rest/api/mc_contacts/v3/models/self_metadata.py index 30c459f5..448cb9b0 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/self_metadata.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/self_metadata.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SelfMetadata: - def __init__( - self, - var_self: Optional[str]=None - ): - self.var_self=var_self + def __init__(self, var_self: Optional[str] = None): + self.var_self = var_self def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "self": self.var_self - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"self": self.var_self}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SelfMetadata( - var_self=payload.get('self') - ) - + return SelfMetadata(var_self=payload.get("self")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/status.py b/sendgrid/rest/api/mc_contacts/v3/models/status.py index 31b3653b..e1193c69 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/status.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/status.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Status(Enum): - PENDING='pending' - READY='ready' - FAILURE='failure' - + PENDING = "pending" + READY = "ready" + FAILURE = "failure" diff --git a/sendgrid/rest/api/mc_contacts/v3/models/update_contact202_response.py b/sendgrid/rest/api/mc_contacts/v3/models/update_contact202_response.py index a3b277bf..a392f652 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/update_contact202_response.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/update_contact202_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateContact202Response: - def __init__( - self, - job_id: Optional[str]=None - ): - self.job_id=job_id + def __init__(self, job_id: Optional[str] = None): + self.job_id = job_id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "job_id": self.job_id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"job_id": self.job_id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateContact202Response( - job_id=payload.get('job_id') - ) - + return UpdateContact202Response(job_id=payload.get("job_id")) diff --git a/sendgrid/rest/api/mc_contacts/v3/models/update_contact_request.py b/sendgrid/rest/api/mc_contacts/v3/models/update_contact_request.py index d88e7f24..af79a275 100644 --- a/sendgrid/rest/api/mc_contacts/v3/models/update_contact_request.py +++ b/sendgrid/rest/api/mc_contacts/v3/models/update_contact_request.py @@ -1,26 +1,26 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_contacts.v3.models.contact_request import ContactRequest - class UpdateContactRequest: def __init__( - self, - list_ids: Optional[List[str]]=None, - contacts: Optional[List[ContactRequest]]=None + self, + list_ids: Optional[List[str]] = None, + contacts: Optional[List[ContactRequest]] = None, ): - self.list_ids=list_ids - self.contacts=contacts + self.list_ids = list_ids + self.contacts = contacts def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "list_ids": self.list_ids, - "contacts": self.contacts - }.items() if value is not None} + "list_ids": self.list_ids, + "contacts": self.contacts, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +29,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateContactRequest( - list_ids=payload.get('list_ids'), - contacts=payload.get('contacts') - ) - + list_ids=payload.get("list_ids"), contacts=payload.get("contacts") + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/search_contact.py b/sendgrid/rest/api/mc_contacts/v3/search_contact.py index 8f6087ca..935501ac 100644 --- a/sendgrid/rest/api/mc_contacts/v3/search_contact.py +++ b/sendgrid/rest/api/mc_contacts/v3/search_contact.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.mc_contacts.v3.models.search_contact200_response import SearchContact200Response -from sendgrid.rest.api.mc_contacts.v3.models.search_contact_request import SearchContactRequest +from sendgrid.rest.api.mc_contacts.v3.models.search_contact_request import ( + SearchContactRequest, +) + class SearchContact: def __init__(self, client) -> None: self.client = client - + def send( self, - search_contact_request: Optional[SearchContactRequest] = None, - + search_contact_request: Optional[SearchContactRequest] = None, ): - path='/v3/marketing/contacts/search' + path = "/v3/marketing/contacts/search" data = None if search_contact_request: data = search_contact_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_contacts/v3/update_contact.py b/sendgrid/rest/api/mc_contacts/v3/update_contact.py index 2294556c..a08e2662 100644 --- a/sendgrid/rest/api/mc_contacts/v3/update_contact.py +++ b/sendgrid/rest/api/mc_contacts/v3/update_contact.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.mc_contacts.v3.models.update_contact202_response import UpdateContact202Response -from sendgrid.rest.api.mc_contacts.v3.models.update_contact_request import UpdateContactRequest +from sendgrid.rest.api.mc_contacts.v3.models.update_contact_request import ( + UpdateContactRequest, +) + class UpdateContact: def __init__(self, client) -> None: self.client = client - + def send( self, - update_contact_request: Optional[UpdateContactRequest] = None, - + update_contact_request: Optional[UpdateContactRequest] = None, ): - path='/v3/marketing/contacts' + path = "/v3/marketing/contacts" data = None if update_contact_request: data = update_contact_request.to_dict() - request = Request( - method='PUT', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_custom_fields/v3/__init__.py b/sendgrid/rest/api/mc_custom_fields/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/__init__.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/mc_custom_fields/v3/create_field_definition.py b/sendgrid/rest/api/mc_custom_fields/v3/create_field_definition.py index 3abe971f..6e8d0eda 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/create_field_definition.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/create_field_definition.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.mc_custom_fields.v3.models.create_field_definition200_response import CreateFieldDefinition200Response -from sendgrid.rest.api.mc_custom_fields.v3.models.create_field_definition_request import CreateFieldDefinitionRequest +from sendgrid.rest.api.mc_custom_fields.v3.models.create_field_definition_request import ( + CreateFieldDefinitionRequest, +) + class CreateFieldDefinition: def __init__(self, client) -> None: self.client = client - + def send( self, - create_field_definition_request: Optional[CreateFieldDefinitionRequest] = None, - + create_field_definition_request: Optional[CreateFieldDefinitionRequest] = None, ): - path='/v3/marketing/field_definitions' + path = "/v3/marketing/field_definitions" data = None if create_field_definition_request: data = create_field_definition_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_custom_fields/v3/delete_field_definition.py b/sendgrid/rest/api/mc_custom_fields/v3/delete_field_definition.py index f57e61a4..f1fb9d60 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/delete_field_definition.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/delete_field_definition.py @@ -12,46 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr class DeleteFieldDefinition: def __init__(self, client) -> None: self.client = client - + def send( self, - custom_field_id: str, - + custom_field_id: str, ): - path='/v3/marketing/field_definitions/{custom_field_id}' + path = "/v3/marketing/field_definitions/{custom_field_id}" path = path.format( - custom_field_id=custom_field_id, + custom_field_id=custom_field_id, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_custom_fields/v3/list_field_definition.py b/sendgrid/rest/api/mc_custom_fields/v3/list_field_definition.py index a7364de4..a508ec8e 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/list_field_definition.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/list_field_definition.py @@ -12,42 +12,37 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from sendgrid.rest.api.mc_custom_fields.v3.models.list_field_definition200_response import ListFieldDefinition200Response class ListFieldDefinition: def __init__(self, client) -> None: self.client = client - + def send( self, - ): - path='/v3/marketing/field_definitions' + path = "/v3/marketing/field_definitions" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_custom_fields/v3/models/__init__.py b/sendgrid/rest/api/mc_custom_fields/v3/models/__init__.py index 96263e49..59e30de7 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/models/__init__.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/models/__init__.py @@ -11,19 +11,48 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.mc_custom_fields.v3.models.create_field_definition200_response import CreateFieldDefinition200Response -from sendgrid.rest.api.mc_custom_fields.v3.models.create_field_definition400_response import CreateFieldDefinition400Response -from sendgrid.rest.api.mc_custom_fields.v3.models.create_field_definition_request import CreateFieldDefinitionRequest -from sendgrid.rest.api.mc_custom_fields.v3.models.custom_field_definitions_response import CustomFieldDefinitionsResponse -from sendgrid.rest.api.mc_custom_fields.v3.models.custom_fields_error import CustomFieldsError +from sendgrid.rest.api.mc_custom_fields.v3.models.create_field_definition200_response import ( + CreateFieldDefinition200Response, +) +from sendgrid.rest.api.mc_custom_fields.v3.models.create_field_definition400_response import ( + CreateFieldDefinition400Response, +) +from sendgrid.rest.api.mc_custom_fields.v3.models.create_field_definition_request import ( + CreateFieldDefinitionRequest, +) +from sendgrid.rest.api.mc_custom_fields.v3.models.custom_field_definitions_response import ( + CustomFieldDefinitionsResponse, +) +from sendgrid.rest.api.mc_custom_fields.v3.models.custom_fields_error import ( + CustomFieldsError, +) from sendgrid.rest.api.mc_custom_fields.v3.models.field_type import FieldType from sendgrid.rest.api.mc_custom_fields.v3.models.field_type1 import FieldType1 from sendgrid.rest.api.mc_custom_fields.v3.models.field_type2 import FieldType2 -from sendgrid.rest.api.mc_custom_fields.v3.models.list_field_definition200_response import ListFieldDefinition200Response +from sendgrid.rest.api.mc_custom_fields.v3.models.list_field_definition200_response import ( + ListFieldDefinition200Response, +) from sendgrid.rest.api.mc_custom_fields.v3.models.metadata import Metadata -from sendgrid.rest.api.mc_custom_fields.v3.models.reserved_field_definitions_response_inner import ReservedFieldDefinitionsResponseInner -from sendgrid.rest.api.mc_custom_fields.v3.models.update_field_definition_request import UpdateFieldDefinitionRequest -__all__ = [ 'CreateFieldDefinition200Response', 'CreateFieldDefinition400Response', 'CreateFieldDefinitionRequest', 'CustomFieldDefinitionsResponse', 'CustomFieldsError', 'FieldType', 'FieldType1', 'FieldType2', 'ListFieldDefinition200Response', 'Metadata', 'ReservedFieldDefinitionsResponseInner', 'UpdateFieldDefinitionRequest' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.mc_custom_fields.v3.models.reserved_field_definitions_response_inner import ( + ReservedFieldDefinitionsResponseInner, +) +from sendgrid.rest.api.mc_custom_fields.v3.models.update_field_definition_request import ( + UpdateFieldDefinitionRequest, +) + +__all__ = [ + "CreateFieldDefinition200Response", + "CreateFieldDefinition400Response", + "CreateFieldDefinitionRequest", + "CustomFieldDefinitionsResponse", + "CustomFieldsError", + "FieldType", + "FieldType1", + "FieldType2", + "ListFieldDefinition200Response", + "Metadata", + "ReservedFieldDefinitionsResponseInner", + "UpdateFieldDefinitionRequest", +] +# Testing code diff --git a/sendgrid/rest/api/mc_custom_fields/v3/models/create_field_definition200_response.py b/sendgrid/rest/api/mc_custom_fields/v3/models/create_field_definition200_response.py index 1897e7ec..d37d801c 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/models/create_field_definition200_response.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/models/create_field_definition200_response.py @@ -1,33 +1,33 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_custom_fields.v3.models.field_type2 import FieldType2 from sendgrid.rest.api.mc_custom_fields.v3.models.metadata import Metadata - class CreateFieldDefinition200Response: def __init__( - self, - id: Optional[str]=None, - name: Optional[str]=None, - field_type: Optional[FieldType2]=None, - metadata: Optional[Metadata]=None + self, + id: Optional[str] = None, + name: Optional[str] = None, + field_type: Optional[FieldType2] = None, + metadata: Optional[Metadata] = None, ): - self.id=id - self.name=name - self.field_type=field_type - self.metadata=metadata + self.id = id + self.name = name + self.field_type = field_type + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "name": self.name, - "field_type": self.field_type, - "_metadata": self.metadata - }.items() if value is not None} + "id": self.id, + "name": self.name, + "field_type": self.field_type, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -36,9 +36,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateFieldDefinition200Response( - id=payload.get('id'), - name=payload.get('name'), - field_type=payload.get('field_type'), - metadata=payload.get('_metadata') - ) - + id=payload.get("id"), + name=payload.get("name"), + field_type=payload.get("field_type"), + metadata=payload.get("_metadata"), + ) diff --git a/sendgrid/rest/api/mc_custom_fields/v3/models/create_field_definition400_response.py b/sendgrid/rest/api/mc_custom_fields/v3/models/create_field_definition400_response.py index d63d3803..53a9f178 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/models/create_field_definition400_response.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/models/create_field_definition400_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_custom_fields.v3.models.custom_fields_error import CustomFieldsError - +from sendgrid.rest.api.mc_custom_fields.v3.models.custom_fields_error import ( + CustomFieldsError, +) class CreateFieldDefinition400Response: - def __init__( - self, - errors: Optional[List[CustomFieldsError]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[CustomFieldsError]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return CreateFieldDefinition400Response( - errors=payload.get('errors') - ) - + return CreateFieldDefinition400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_custom_fields/v3/models/create_field_definition_request.py b/sendgrid/rest/api/mc_custom_fields/v3/models/create_field_definition_request.py index cc2d3e5d..7a2df6be 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/models/create_field_definition_request.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/models/create_field_definition_request.py @@ -1,26 +1,21 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_custom_fields.v3.models.field_type import FieldType - class CreateFieldDefinitionRequest: def __init__( - self, - name: Optional[str]=None, - field_type: Optional[FieldType]=None + self, name: Optional[str] = None, field_type: Optional[FieldType] = None ): - self.name=name - self.field_type=field_type + self.name = name + self.field_type = field_type def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name, - "field_type": self.field_type - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name, "field_type": self.field_type}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +24,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateFieldDefinitionRequest( - name=payload.get('name'), - field_type=payload.get('field_type') - ) - + name=payload.get("name"), field_type=payload.get("field_type") + ) diff --git a/sendgrid/rest/api/mc_custom_fields/v3/models/custom_field_definitions_response.py b/sendgrid/rest/api/mc_custom_fields/v3/models/custom_field_definitions_response.py index 2bc84d3b..d0cce70c 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/models/custom_field_definitions_response.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/models/custom_field_definitions_response.py @@ -1,29 +1,29 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_custom_fields.v3.models.field_type2 import FieldType2 - class CustomFieldDefinitionsResponse: def __init__( - self, - id: Optional[str]=None, - name: Optional[str]=None, - field_type: Optional[FieldType2]=None + self, + id: Optional[str] = None, + name: Optional[str] = None, + field_type: Optional[FieldType2] = None, ): - self.id=id - self.name=name - self.field_type=field_type + self.id = id + self.name = name + self.field_type = field_type def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "name": self.name, - "field_type": self.field_type - }.items() if value is not None} + "id": self.id, + "name": self.name, + "field_type": self.field_type, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +32,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CustomFieldDefinitionsResponse( - id=payload.get('id'), - name=payload.get('name'), - field_type=payload.get('field_type') - ) - + id=payload.get("id"), + name=payload.get("name"), + field_type=payload.get("field_type"), + ) diff --git a/sendgrid/rest/api/mc_custom_fields/v3/models/custom_fields_error.py b/sendgrid/rest/api/mc_custom_fields/v3/models/custom_fields_error.py index 2ef72adf..2954035d 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/models/custom_fields_error.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/models/custom_fields_error.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CustomFieldsError: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - error_id: Optional[str]=None, - parameter: Optional[str]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + error_id: Optional[str] = None, + parameter: Optional[str] = None, ): - self.message=message - self.field=field - self.error_id=error_id - self.parameter=parameter + self.message = message + self.field = field + self.error_id = error_id + self.parameter = parameter def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "error_id": self.error_id, - "parameter": self.parameter - }.items() if value is not None} + "message": self.message, + "field": self.field, + "error_id": self.error_id, + "parameter": self.parameter, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CustomFieldsError( - message=payload.get('message'), - field=payload.get('field'), - error_id=payload.get('error_id'), - parameter=payload.get('parameter') - ) - + message=payload.get("message"), + field=payload.get("field"), + error_id=payload.get("error_id"), + parameter=payload.get("parameter"), + ) diff --git a/sendgrid/rest/api/mc_custom_fields/v3/models/field_type.py b/sendgrid/rest/api/mc_custom_fields/v3/models/field_type.py index 13d8d757..dbd0d3b4 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/models/field_type.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/models/field_type.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class FieldType(Enum): - TEXT='Text' - NUMBER='Number' - DATE='Date' - + TEXT = "Text" + NUMBER = "Number" + DATE = "Date" diff --git a/sendgrid/rest/api/mc_custom_fields/v3/models/field_type1.py b/sendgrid/rest/api/mc_custom_fields/v3/models/field_type1.py index 1860ea13..3c64bc3f 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/models/field_type1.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/models/field_type1.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class FieldType1(Enum): - TEXT='Text' - NUMBER='Number' - DATE='Date' - + TEXT = "Text" + NUMBER = "Number" + DATE = "Date" diff --git a/sendgrid/rest/api/mc_custom_fields/v3/models/field_type2.py b/sendgrid/rest/api/mc_custom_fields/v3/models/field_type2.py index cb9adc0a..8adabf27 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/models/field_type2.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/models/field_type2.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class FieldType2(Enum): - TEXT='Text' - NUMBER='Number' - DATE='Date' - + TEXT = "Text" + NUMBER = "Number" + DATE = "Date" diff --git a/sendgrid/rest/api/mc_custom_fields/v3/models/list_field_definition200_response.py b/sendgrid/rest/api/mc_custom_fields/v3/models/list_field_definition200_response.py index 726ce52b..56f85677 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/models/list_field_definition200_response.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/models/list_field_definition200_response.py @@ -1,31 +1,35 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_custom_fields.v3.models.custom_field_definitions_response import CustomFieldDefinitionsResponse +from sendgrid.rest.api.mc_custom_fields.v3.models.custom_field_definitions_response import ( + CustomFieldDefinitionsResponse, +) from sendgrid.rest.api.mc_custom_fields.v3.models.metadata import Metadata -from sendgrid.rest.api.mc_custom_fields.v3.models.reserved_field_definitions_response_inner import ReservedFieldDefinitionsResponseInner - +from sendgrid.rest.api.mc_custom_fields.v3.models.reserved_field_definitions_response_inner import ( + ReservedFieldDefinitionsResponseInner, +) class ListFieldDefinition200Response: def __init__( - self, - custom_fields: Optional[List[CustomFieldDefinitionsResponse]]=None, - reserved_fields: Optional[List[ReservedFieldDefinitionsResponseInner]]=None, - metadata: Optional[Metadata]=None + self, + custom_fields: Optional[List[CustomFieldDefinitionsResponse]] = None, + reserved_fields: Optional[List[ReservedFieldDefinitionsResponseInner]] = None, + metadata: Optional[Metadata] = None, ): - self.custom_fields=custom_fields - self.reserved_fields=reserved_fields - self.metadata=metadata + self.custom_fields = custom_fields + self.reserved_fields = reserved_fields + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "custom_fields": self.custom_fields, - "reserved_fields": self.reserved_fields, - "_metadata": self.metadata - }.items() if value is not None} + "custom_fields": self.custom_fields, + "reserved_fields": self.reserved_fields, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,8 +38,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListFieldDefinition200Response( - custom_fields=payload.get('custom_fields'), - reserved_fields=payload.get('reserved_fields'), - metadata=payload.get('_metadata') - ) - + custom_fields=payload.get("custom_fields"), + reserved_fields=payload.get("reserved_fields"), + metadata=payload.get("_metadata"), + ) diff --git a/sendgrid/rest/api/mc_custom_fields/v3/models/metadata.py b/sendgrid/rest/api/mc_custom_fields/v3/models/metadata.py index 88263186..3281a432 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/models/metadata.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/models/metadata.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class Metadata: def __init__( - self, - prev: Optional[str]=None, - var_self: Optional[str]=None, - next: Optional[str]=None, - count: Optional[int]=None + self, + prev: Optional[str] = None, + var_self: Optional[str] = None, + next: Optional[str] = None, + count: Optional[int] = None, ): - self.prev=prev - self.var_self=var_self - self.next=next - self.count=count + self.prev = prev + self.var_self = var_self + self.next = next + self.count = count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "prev": self.prev, - "self": self.var_self, - "next": self.next, - "count": self.count - }.items() if value is not None} + "prev": self.prev, + "self": self.var_self, + "next": self.next, + "count": self.count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Metadata( - prev=payload.get('prev'), - var_self=payload.get('self'), - next=payload.get('next'), - count=payload.get('count') - ) - + prev=payload.get("prev"), + var_self=payload.get("self"), + next=payload.get("next"), + count=payload.get("count"), + ) diff --git a/sendgrid/rest/api/mc_custom_fields/v3/models/reserved_field_definitions_response_inner.py b/sendgrid/rest/api/mc_custom_fields/v3/models/reserved_field_definitions_response_inner.py index ba73a700..6cfe5e39 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/models/reserved_field_definitions_response_inner.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/models/reserved_field_definitions_response_inner.py @@ -1,29 +1,29 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_custom_fields.v3.models.field_type1 import FieldType1 - class ReservedFieldDefinitionsResponseInner: def __init__( - self, - name: Optional[str]=None, - field_type: Optional[FieldType1]=None, - read_only: Optional[bool]=None + self, + name: Optional[str] = None, + field_type: Optional[FieldType1] = None, + read_only: Optional[bool] = None, ): - self.name=name - self.field_type=field_type - self.read_only=read_only + self.name = name + self.field_type = field_type + self.read_only = read_only def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "field_type": self.field_type, - "read_only": self.read_only - }.items() if value is not None} + "name": self.name, + "field_type": self.field_type, + "read_only": self.read_only, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +32,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ReservedFieldDefinitionsResponseInner( - name=payload.get('name'), - field_type=payload.get('field_type'), - read_only=payload.get('read_only') - ) - + name=payload.get("name"), + field_type=payload.get("field_type"), + read_only=payload.get("read_only"), + ) diff --git a/sendgrid/rest/api/mc_custom_fields/v3/models/update_field_definition_request.py b/sendgrid/rest/api/mc_custom_fields/v3/models/update_field_definition_request.py index 1c70652b..b70abe5f 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/models/update_field_definition_request.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/models/update_field_definition_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateFieldDefinitionRequest: - def __init__( - self, - name: Optional[str]=None - ): - self.name=name + def __init__(self, name: Optional[str] = None): + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateFieldDefinitionRequest( - name=payload.get('name') - ) - + return UpdateFieldDefinitionRequest(name=payload.get("name")) diff --git a/sendgrid/rest/api/mc_custom_fields/v3/update_field_definition.py b/sendgrid/rest/api/mc_custom_fields/v3/update_field_definition.py index 1ff38a45..166c7a07 100644 --- a/sendgrid/rest/api/mc_custom_fields/v3/update_field_definition.py +++ b/sendgrid/rest/api/mc_custom_fields/v3/update_field_definition.py @@ -12,52 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr from typing import Optional -from sendgrid.rest.api.mc_custom_fields.v3.models.create_field_definition200_response import CreateFieldDefinition200Response -from sendgrid.rest.api.mc_custom_fields.v3.models.update_field_definition_request import UpdateFieldDefinitionRequest +from sendgrid.rest.api.mc_custom_fields.v3.models.update_field_definition_request import ( + UpdateFieldDefinitionRequest, +) + class UpdateFieldDefinition: def __init__(self, client) -> None: self.client = client - + def send( self, - custom_field_id: str, - update_field_definition_request: Optional[UpdateFieldDefinitionRequest] = None, - + custom_field_id: str, + update_field_definition_request: Optional[UpdateFieldDefinitionRequest] = None, ): - path='/v3/marketing/field_definitions/{custom_field_id}' + path = "/v3/marketing/field_definitions/{custom_field_id}" path = path.format( - custom_field_id=custom_field_id, + custom_field_id=custom_field_id, ) data = None if update_field_definition_request: data = update_field_definition_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_designs/v3/__init__.py b/sendgrid/rest/api/mc_designs/v3/__init__.py new file mode 100644 index 00000000..46409041 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/__init__.py @@ -0,0 +1 @@ +# TODO diff --git a/sendgrid/rest/api/mc_designs/v3/create_design.py b/sendgrid/rest/api/mc_designs/v3/create_design.py new file mode 100644 index 00000000..fd629778 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/create_design.py @@ -0,0 +1,55 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Designs + The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.mc_designs.v3.models.design_input import DesignInput + + +class CreateDesign: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + design_input: Optional[DesignInput] = None, + ): + path = "/v3/designs" + + data = None + if design_input: + data = design_input.to_dict() + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_designs/v3/delete_design.py b/sendgrid/rest/api/mc_designs/v3/delete_design.py new file mode 100644 index 00000000..13aae9ce --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/delete_design.py @@ -0,0 +1,52 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Designs + The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + + +class DeleteDesign: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + ): + path = "/v3/designs/{id}" + path = path.format( + id=id, + ) + + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_designs/v3/duplicate_design.py b/sendgrid/rest/api/mc_designs/v3/duplicate_design.py new file mode 100644 index 00000000..7e9b1632 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/duplicate_design.py @@ -0,0 +1,61 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Designs + The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.mc_designs.v3.models.design_duplicate_input import ( + DesignDuplicateInput, +) + + +class DuplicateDesign: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + design_duplicate_input: Optional[DesignDuplicateInput] = None, + ): + path = "/v3/designs/{id}" + path = path.format( + id=id, + ) + + data = None + if design_duplicate_input: + data = design_duplicate_input.to_dict() + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_designs/v3/duplicate_pre_built_design.py b/sendgrid/rest/api/mc_designs/v3/duplicate_pre_built_design.py new file mode 100644 index 00000000..2fa8c9c4 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/duplicate_pre_built_design.py @@ -0,0 +1,61 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Designs + The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.mc_designs.v3.models.design_duplicate_input import ( + DesignDuplicateInput, +) + + +class DuplicatePreBuiltDesign: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + design_duplicate_input: Optional[DesignDuplicateInput] = None, + ): + path = "/v3/designs/pre-builts/{id}" + path = path.format( + id=id, + ) + + data = None + if design_duplicate_input: + data = design_duplicate_input.to_dict() + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_designs/v3/get_design.py b/sendgrid/rest/api/mc_designs/v3/get_design.py new file mode 100644 index 00000000..ce4f947e --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/get_design.py @@ -0,0 +1,52 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Designs + The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + + +class GetDesign: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + ): + path = "/v3/designs/{id}" + path = path.format( + id=id, + ) + + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_designs/v3/get_pre_built_design.py b/sendgrid/rest/api/mc_designs/v3/get_pre_built_design.py new file mode 100644 index 00000000..0c3acb24 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/get_pre_built_design.py @@ -0,0 +1,52 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Designs + The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + + +class GetPreBuiltDesign: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + ): + path = "/v3/designs/pre-builts/{id}" + path = path.format( + id=id, + ) + + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_designs/v3/list_design.py b/sendgrid/rest/api/mc_designs/v3/list_design.py new file mode 100644 index 00000000..964f5686 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/list_design.py @@ -0,0 +1,54 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Designs + The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class ListDesign: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + summary: Optional[bool] = None, + ): + path = "/v3/designs" + + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_designs/v3/list_pre_built_design.py b/sendgrid/rest/api/mc_designs/v3/list_pre_built_design.py new file mode 100644 index 00000000..c95e93ae --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/list_pre_built_design.py @@ -0,0 +1,54 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Designs + The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class ListPreBuiltDesign: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + summary: Optional[bool] = None, + ): + path = "/v3/designs/pre-builts" + + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_designs/v3/models/__init__.py b/sendgrid/rest/api/mc_designs/v3/models/__init__.py new file mode 100644 index 00000000..f2296d61 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/models/__init__.py @@ -0,0 +1,50 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Designs + The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +# import models into model package +from sendgrid.rest.api.mc_designs.v3.models.api_error import ApiError +from sendgrid.rest.api.mc_designs.v3.models.api_errors import ApiErrors +from sendgrid.rest.api.mc_designs.v3.models.design_common_properties import ( + DesignCommonProperties, +) +from sendgrid.rest.api.mc_designs.v3.models.design_duplicate_input import ( + DesignDuplicateInput, +) +from sendgrid.rest.api.mc_designs.v3.models.design_input import DesignInput +from sendgrid.rest.api.mc_designs.v3.models.design_output import DesignOutput +from sendgrid.rest.api.mc_designs.v3.models.design_output_summary import ( + DesignOutputSummary, +) +from sendgrid.rest.api.mc_designs.v3.models.editor import Editor +from sendgrid.rest.api.mc_designs.v3.models.list_design200_response import ( + ListDesign200Response, +) +from sendgrid.rest.api.mc_designs.v3.models.metadata import Metadata +from sendgrid.rest.api.mc_designs.v3.models.update_design_request import ( + UpdateDesignRequest, +) + +__all__ = [ + "ApiError", + "ApiErrors", + "DesignCommonProperties", + "DesignDuplicateInput", + "DesignInput", + "DesignOutput", + "DesignOutputSummary", + "Editor", + "ListDesign200Response", + "Metadata", + "UpdateDesignRequest", +] +# Testing code diff --git a/sendgrid/rest/api/mc_designs/v3/models/api_error.py b/sendgrid/rest/api/mc_designs/v3/models/api_error.py new file mode 100644 index 00000000..a2700a9f --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/models/api_error.py @@ -0,0 +1,37 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class ApiError: + def __init__( + self, + message: Optional[str] = None, + field: Optional[str] = None, + error_id: Optional[str] = None, + ): + self.message = message + self.field = field + self.error_id = error_id + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "message": self.message, + "field": self.field, + "error_id": self.error_id, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ApiError( + message=payload.get("message"), + field=payload.get("field"), + error_id=payload.get("error_id"), + ) diff --git a/sendgrid/rest/api/mc_designs/v3/models/api_errors.py b/sendgrid/rest/api/mc_designs/v3/models/api_errors.py new file mode 100644 index 00000000..ba00ac23 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/models/api_errors.py @@ -0,0 +1,23 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_designs.v3.models.api_error import ApiError + + +class ApiErrors: + def __init__(self, errors: Optional[List[ApiError]] = None): + self.errors = errors + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ApiErrors(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_designs/v3/models/design_common_properties.py b/sendgrid/rest/api/mc_designs/v3/models/design_common_properties.py new file mode 100644 index 00000000..dd5a15e7 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/models/design_common_properties.py @@ -0,0 +1,46 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_designs.v3.models.editor import Editor + + +class DesignCommonProperties: + def __init__( + self, + name: Optional[str] = None, + editor: Optional[Editor] = None, + generate_plain_content: Optional[bool] = None, + subject: Optional[str] = None, + categories: Optional[List[str]] = None, + ): + self.name = name + self.editor = editor + self.generate_plain_content = generate_plain_content + self.subject = subject + self.categories = categories + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "name": self.name, + "editor": self.editor, + "generate_plain_content": self.generate_plain_content, + "subject": self.subject, + "categories": self.categories, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return DesignCommonProperties( + name=payload.get("name"), + editor=payload.get("editor"), + generate_plain_content=payload.get("generate_plain_content"), + subject=payload.get("subject"), + categories=payload.get("categories"), + ) diff --git a/sendgrid/rest/api/mc_designs/v3/models/design_duplicate_input.py b/sendgrid/rest/api/mc_designs/v3/models/design_duplicate_input.py new file mode 100644 index 00000000..422c7bf6 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/models/design_duplicate_input.py @@ -0,0 +1,26 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_designs.v3.models.editor import Editor + + +class DesignDuplicateInput: + def __init__(self, name: Optional[str] = None, editor: Optional[Editor] = None): + self.name = name + self.editor = editor + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"name": self.name, "editor": self.editor}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return DesignDuplicateInput( + name=payload.get("name"), editor=payload.get("editor") + ) diff --git a/sendgrid/rest/api/mc_designs/v3/models/design_input.py b/sendgrid/rest/api/mc_designs/v3/models/design_input.py new file mode 100644 index 00000000..6c020f8e --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/models/design_input.py @@ -0,0 +1,42 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_designs.v3.models.editor import Editor + + +class DesignInput: + def __init__( + self, + name: Optional[str] = None, + editor: Optional[Editor] = None, + html_content: Optional[str] = None, + plain_content: Optional[str] = None, + ): + self.name = name + self.editor = editor + self.html_content = html_content + self.plain_content = plain_content + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "name": self.name, + "editor": self.editor, + "html_content": self.html_content, + "plain_content": self.plain_content, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return DesignInput( + name=payload.get("name"), + editor=payload.get("editor"), + html_content=payload.get("html_content"), + plain_content=payload.get("plain_content"), + ) diff --git a/sendgrid/rest/api/mc_designs/v3/models/design_output.py b/sendgrid/rest/api/mc_designs/v3/models/design_output.py new file mode 100644 index 00000000..962b3e97 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/models/design_output.py @@ -0,0 +1,42 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_designs.v3.models.editor import Editor + + +class DesignOutput: + def __init__( + self, + name: Optional[str] = None, + editor: Optional[Editor] = None, + html_content: Optional[str] = None, + plain_content: Optional[str] = None, + ): + self.name = name + self.editor = editor + self.html_content = html_content + self.plain_content = plain_content + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "name": self.name, + "editor": self.editor, + "html_content": self.html_content, + "plain_content": self.plain_content, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return DesignOutput( + name=payload.get("name"), + editor=payload.get("editor"), + html_content=payload.get("html_content"), + plain_content=payload.get("plain_content"), + ) diff --git a/sendgrid/rest/api/mc_designs/v3/models/design_output_summary.py b/sendgrid/rest/api/mc_designs/v3/models/design_output_summary.py new file mode 100644 index 00000000..25cec530 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/models/design_output_summary.py @@ -0,0 +1,50 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_designs.v3.models.editor import Editor + + +class DesignOutputSummary: + def __init__( + self, + id: Optional[str] = None, + updated_at: Optional[str] = None, + created_at: Optional[str] = None, + thumbnail_url: Optional[str] = None, + name: Optional[str] = None, + editor: Optional[Editor] = None, + ): + self.id = id + self.updated_at = updated_at + self.created_at = created_at + self.thumbnail_url = thumbnail_url + self.name = name + self.editor = editor + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "id": self.id, + "updated_at": self.updated_at, + "created_at": self.created_at, + "thumbnail_url": self.thumbnail_url, + "name": self.name, + "editor": self.editor, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return DesignOutputSummary( + id=payload.get("id"), + updated_at=payload.get("updated_at"), + created_at=payload.get("created_at"), + thumbnail_url=payload.get("thumbnail_url"), + name=payload.get("name"), + editor=payload.get("editor"), + ) diff --git a/sendgrid/rest/api/mc_designs/v3/models/editor.py b/sendgrid/rest/api/mc_designs/v3/models/editor.py new file mode 100644 index 00000000..47b41f47 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/models/editor.py @@ -0,0 +1,7 @@ +from enum import Enum +from enum import Enum + + +class Editor(Enum): + CODE = "code" + DESIGN = "design" diff --git a/sendgrid/rest/api/mc_designs/v3/models/list_design200_response.py b/sendgrid/rest/api/mc_designs/v3/models/list_design200_response.py new file mode 100644 index 00000000..a419d02e --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/models/list_design200_response.py @@ -0,0 +1,36 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_designs.v3.models.design_output_summary import ( + DesignOutputSummary, +) +from sendgrid.rest.api.mc_designs.v3.models.metadata import Metadata + + +class ListDesign200Response: + def __init__( + self, + result: Optional[List[DesignOutputSummary]] = None, + metadata: Optional[Metadata] = None, + ): + self.result = result + self.metadata = metadata + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "result": self.result, + "_metadata": self.metadata, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListDesign200Response( + result=payload.get("result"), metadata=payload.get("_metadata") + ) diff --git a/sendgrid/rest/api/mc_designs/v3/models/metadata.py b/sendgrid/rest/api/mc_designs/v3/models/metadata.py new file mode 100644 index 00000000..3281a432 --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/models/metadata.py @@ -0,0 +1,41 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class Metadata: + def __init__( + self, + prev: Optional[str] = None, + var_self: Optional[str] = None, + next: Optional[str] = None, + count: Optional[int] = None, + ): + self.prev = prev + self.var_self = var_self + self.next = next + self.count = count + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "prev": self.prev, + "self": self.var_self, + "next": self.next, + "count": self.count, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return Metadata( + prev=payload.get("prev"), + var_self=payload.get("self"), + next=payload.get("next"), + count=payload.get("count"), + ) diff --git a/sendgrid/rest/api/mc_designs/v3/models/update_design_request.py b/sendgrid/rest/api/mc_designs/v3/models/update_design_request.py new file mode 100644 index 00000000..4e21e94f --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/models/update_design_request.py @@ -0,0 +1,49 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class UpdateDesignRequest: + def __init__( + self, + name: Optional[str] = None, + html_content: Optional[str] = None, + plain_content: Optional[str] = None, + generate_plain_content: Optional[bool] = None, + subject: Optional[str] = None, + categories: Optional[List[str]] = None, + ): + self.name = name + self.html_content = html_content + self.plain_content = plain_content + self.generate_plain_content = generate_plain_content + self.subject = subject + self.categories = categories + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "name": self.name, + "html_content": self.html_content, + "plain_content": self.plain_content, + "generate_plain_content": self.generate_plain_content, + "subject": self.subject, + "categories": self.categories, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return UpdateDesignRequest( + name=payload.get("name"), + html_content=payload.get("html_content"), + plain_content=payload.get("plain_content"), + generate_plain_content=payload.get("generate_plain_content"), + subject=payload.get("subject"), + categories=payload.get("categories"), + ) diff --git a/sendgrid/rest/api/mc_designs/v3/update_design.py b/sendgrid/rest/api/mc_designs/v3/update_design.py new file mode 100644 index 00000000..24ba35cf --- /dev/null +++ b/sendgrid/rest/api/mc_designs/v3/update_design.py @@ -0,0 +1,61 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Designs + The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.mc_designs.v3.models.update_design_request import ( + UpdateDesignRequest, +) + + +class UpdateDesign: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + update_design_request: Optional[UpdateDesignRequest] = None, + ): + path = "/v3/designs/{id}" + path = path.format( + id=id, + ) + + data = None + if update_design_request: + data = update_design_request.to_dict() + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_lists/v3/__init__.py b/sendgrid/rest/api/mc_lists/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/mc_lists/v3/__init__.py +++ b/sendgrid/rest/api/mc_lists/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/mc_lists/v3/create_marketing_list.py b/sendgrid/rest/api/mc_lists/v3/create_marketing_list.py index 1fcb1214..bbc1f792 100644 --- a/sendgrid/rest/api/mc_lists/v3/create_marketing_list.py +++ b/sendgrid/rest/api/mc_lists/v3/create_marketing_list.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.mc_lists.v3.models.create_marketing_list_request import CreateMarketingListRequest -from sendgrid.rest.api.mc_lists.v3.models.list import List +from sendgrid.rest.api.mc_lists.v3.models.create_marketing_list_request import ( + CreateMarketingListRequest, +) + class CreateMarketingList: def __init__(self, client) -> None: self.client = client - + def send( self, - create_marketing_list_request: Optional[CreateMarketingListRequest] = None, - + create_marketing_list_request: Optional[CreateMarketingListRequest] = None, ): - path='/v3/marketing/lists' + path = "/v3/marketing/lists" data = None if create_marketing_list_request: data = create_marketing_list_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_lists/v3/delete_contact.py b/sendgrid/rest/api/mc_lists/v3/delete_contact.py index 80558447..a627063d 100644 --- a/sendgrid/rest/api/mc_lists/v3/delete_contact.py +++ b/sendgrid/rest/api/mc_lists/v3/delete_contact.py @@ -12,49 +12,43 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.mc_lists.v3.models.delete_contact202_response import DeleteContact202Response class DeleteContact: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - contact_ids: Optional[str] = None, - + id: str, + contact_ids: Optional[str] = None, ): - path='/v3/marketing/lists/{id}/contacts' + path = "/v3/marketing/lists/{id}/contacts" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_lists/v3/delete_marketing_list.py b/sendgrid/rest/api/mc_lists/v3/delete_marketing_list.py index bb9bcc8d..1c1ff3bd 100644 --- a/sendgrid/rest/api/mc_lists/v3/delete_marketing_list.py +++ b/sendgrid/rest/api/mc_lists/v3/delete_marketing_list.py @@ -12,50 +12,45 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_lists.v3.models.delete_marketing_list200_response import DeleteMarketingList200Response + class DeleteMarketingList: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - delete_contacts: Optional[bool] = None, - + id: str, + delete_contacts: Optional[bool] = None, ): - path='/v3/marketing/lists/{id}' + path = "/v3/marketing/lists/{id}" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_lists/v3/get_marketing_list.py b/sendgrid/rest/api/mc_lists/v3/get_marketing_list.py index cebed213..c6f8c9ee 100644 --- a/sendgrid/rest/api/mc_lists/v3/get_marketing_list.py +++ b/sendgrid/rest/api/mc_lists/v3/get_marketing_list.py @@ -12,50 +12,45 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_lists.v3.models.get_marketing_list200_response import GetMarketingList200Response + class GetMarketingList: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - contact_sample: Optional[bool] = None, - + id: str, + contact_sample: Optional[bool] = None, ): - path='/v3/marketing/lists/{id}' + path = "/v3/marketing/lists/{id}" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_lists/v3/list_contact_count.py b/sendgrid/rest/api/mc_lists/v3/list_contact_count.py index d3e227c6..c42ca449 100644 --- a/sendgrid/rest/api/mc_lists/v3/list_contact_count.py +++ b/sendgrid/rest/api/mc_lists/v3/list_contact_count.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr -from sendgrid.rest.api.mc_lists.v3.models.list_contact_count200_response import ListContactCount200Response class ListContactCount: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - + id: str, ): - path='/v3/marketing/lists/{id}/contacts/count' + path = "/v3/marketing/lists/{id}/contacts/count" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_lists/v3/list_marketing_list.py b/sendgrid/rest/api/mc_lists/v3/list_marketing_list.py index 2e630e02..7b2232b1 100644 --- a/sendgrid/rest/api/mc_lists/v3/list_marketing_list.py +++ b/sendgrid/rest/api/mc_lists/v3/list_marketing_list.py @@ -12,47 +12,42 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing import Optional, Union -from typing_extensions import Annotated -from sendgrid.rest.api.mc_lists.v3.models.list_marketing_list200_response import ListMarketingList200Response +from typing import Optional + class ListMarketingList: def __init__(self, client) -> None: self.client = client - + def send( self, - page_size: Optional[float] = None, - page_token: Optional[str] = None, - + page_size: Optional[float] = None, + page_token: Optional[str] = None, ): - path='/v3/marketing/lists' + path = "/v3/marketing/lists" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_lists/v3/models/__init__.py b/sendgrid/rest/api/mc_lists/v3/models/__init__.py index f03d1924..3d56217c 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/__init__.py +++ b/sendgrid/rest/api/mc_lists/v3/models/__init__.py @@ -11,21 +11,54 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.mc_lists.v3.models.contact_details import ContactDetails -from sendgrid.rest.api.mc_lists.v3.models.create_marketing_list400_response import CreateMarketingList400Response -from sendgrid.rest.api.mc_lists.v3.models.create_marketing_list_request import CreateMarketingListRequest -from sendgrid.rest.api.mc_lists.v3.models.delete_contact202_response import DeleteContact202Response -from sendgrid.rest.api.mc_lists.v3.models.delete_marketing_list200_response import DeleteMarketingList200Response -from sendgrid.rest.api.mc_lists.v3.models.delete_marketing_list404_response import DeleteMarketingList404Response +from sendgrid.rest.api.mc_lists.v3.models.create_marketing_list400_response import ( + CreateMarketingList400Response, +) +from sendgrid.rest.api.mc_lists.v3.models.create_marketing_list_request import ( + CreateMarketingListRequest, +) +from sendgrid.rest.api.mc_lists.v3.models.delete_contact202_response import ( + DeleteContact202Response, +) +from sendgrid.rest.api.mc_lists.v3.models.delete_marketing_list200_response import ( + DeleteMarketingList200Response, +) +from sendgrid.rest.api.mc_lists.v3.models.delete_marketing_list404_response import ( + DeleteMarketingList404Response, +) from sendgrid.rest.api.mc_lists.v3.models.error import Error -from sendgrid.rest.api.mc_lists.v3.models.get_marketing_list200_response import GetMarketingList200Response +from sendgrid.rest.api.mc_lists.v3.models.get_marketing_list200_response import ( + GetMarketingList200Response, +) from sendgrid.rest.api.mc_lists.v3.models.list import List -from sendgrid.rest.api.mc_lists.v3.models.list_contact_count200_response import ListContactCount200Response -from sendgrid.rest.api.mc_lists.v3.models.list_marketing_list200_response import ListMarketingList200Response +from sendgrid.rest.api.mc_lists.v3.models.list_contact_count200_response import ( + ListContactCount200Response, +) +from sendgrid.rest.api.mc_lists.v3.models.list_marketing_list200_response import ( + ListMarketingList200Response, +) from sendgrid.rest.api.mc_lists.v3.models.metadata import Metadata from sendgrid.rest.api.mc_lists.v3.models.self_metadata import SelfMetadata -from sendgrid.rest.api.mc_lists.v3.models.update_marketing_list_request import UpdateMarketingListRequest -__all__ = [ 'ContactDetails', 'CreateMarketingList400Response', 'CreateMarketingListRequest', 'DeleteContact202Response', 'DeleteMarketingList200Response', 'DeleteMarketingList404Response', 'Error', 'GetMarketingList200Response', 'List', 'ListContactCount200Response', 'ListMarketingList200Response', 'Metadata', 'SelfMetadata', 'UpdateMarketingListRequest' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.mc_lists.v3.models.update_marketing_list_request import ( + UpdateMarketingListRequest, +) + +__all__ = [ + "ContactDetails", + "CreateMarketingList400Response", + "CreateMarketingListRequest", + "DeleteContact202Response", + "DeleteMarketingList200Response", + "DeleteMarketingList404Response", + "Error", + "GetMarketingList200Response", + "List", + "ListContactCount200Response", + "ListMarketingList200Response", + "Metadata", + "SelfMetadata", + "UpdateMarketingListRequest", +] +# Testing code diff --git a/sendgrid/rest/api/mc_lists/v3/models/contact_details.py b/sendgrid/rest/api/mc_lists/v3/models/contact_details.py index b97696c1..7ee28daf 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/contact_details.py +++ b/sendgrid/rest/api/mc_lists/v3/models/contact_details.py @@ -1,95 +1,95 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_lists.v3.models.self_metadata import SelfMetadata - class ContactDetails: def __init__( - self, - id: Optional[str]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - unique_name: Optional[str]=None, - email: Optional[str]=None, - phone_number_id: Optional[str]=None, - external_id: Optional[str]=None, - anonymous_id: Optional[str]=None, - alternate_emails: Optional[List[str]]=None, - address_line_1: Optional[str]=None, - address_line_2: Optional[str]=None, - city: Optional[str]=None, - state_province_region: Optional[str]=None, - country: Optional[str]=None, - postal_code: Optional[str]=None, - phone_number: Optional[str]=None, - whatsapp: Optional[str]=None, - line: Optional[str]=None, - facebook: Optional[str]=None, - list_ids: Optional[List[str]]=None, - segment_ids: Optional[List[str]]=None, - custom_fields: Optional[object]=None, - created_at: Optional[datetime]=None, - updated_at: Optional[datetime]=None, - metadata: Optional[SelfMetadata]=None + self, + id: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + unique_name: Optional[str] = None, + email: Optional[str] = None, + phone_number_id: Optional[str] = None, + external_id: Optional[str] = None, + anonymous_id: Optional[str] = None, + alternate_emails: Optional[List[str]] = None, + address_line_1: Optional[str] = None, + address_line_2: Optional[str] = None, + city: Optional[str] = None, + state_province_region: Optional[str] = None, + country: Optional[str] = None, + postal_code: Optional[str] = None, + phone_number: Optional[str] = None, + whatsapp: Optional[str] = None, + line: Optional[str] = None, + facebook: Optional[str] = None, + list_ids: Optional[List[str]] = None, + segment_ids: Optional[List[str]] = None, + custom_fields: Optional[object] = None, + created_at: Optional[datetime] = None, + updated_at: Optional[datetime] = None, + metadata: Optional[SelfMetadata] = None, ): - self.id=id - self.first_name=first_name - self.last_name=last_name - self.unique_name=unique_name - self.email=email - self.phone_number_id=phone_number_id - self.external_id=external_id - self.anonymous_id=anonymous_id - self.alternate_emails=alternate_emails - self.address_line_1=address_line_1 - self.address_line_2=address_line_2 - self.city=city - self.state_province_region=state_province_region - self.country=country - self.postal_code=postal_code - self.phone_number=phone_number - self.whatsapp=whatsapp - self.line=line - self.facebook=facebook - self.list_ids=list_ids - self.segment_ids=segment_ids - self.custom_fields=custom_fields - self.created_at=created_at - self.updated_at=updated_at - self.metadata=metadata + self.id = id + self.first_name = first_name + self.last_name = last_name + self.unique_name = unique_name + self.email = email + self.phone_number_id = phone_number_id + self.external_id = external_id + self.anonymous_id = anonymous_id + self.alternate_emails = alternate_emails + self.address_line_1 = address_line_1 + self.address_line_2 = address_line_2 + self.city = city + self.state_province_region = state_province_region + self.country = country + self.postal_code = postal_code + self.phone_number = phone_number + self.whatsapp = whatsapp + self.line = line + self.facebook = facebook + self.list_ids = list_ids + self.segment_ids = segment_ids + self.custom_fields = custom_fields + self.created_at = created_at + self.updated_at = updated_at + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "first_name": self.first_name, - "last_name": self.last_name, - "unique_name": self.unique_name, - "email": self.email, - "phone_number_id": self.phone_number_id, - "external_id": self.external_id, - "anonymous_id": self.anonymous_id, - "alternate_emails": self.alternate_emails, - "address_line_1": self.address_line_1, - "address_line_2": self.address_line_2, - "city": self.city, - "state_province_region": self.state_province_region, - "country": self.country, - "postal_code": self.postal_code, - "phone_number": self.phone_number, - "whatsapp": self.whatsapp, - "line": self.line, - "facebook": self.facebook, - "list_ids": self.list_ids, - "segment_ids": self.segment_ids, - "custom_fields": self.custom_fields, - "created_at": self.created_at, - "updated_at": self.updated_at, - "_metadata": self.metadata - }.items() if value is not None} + "id": self.id, + "first_name": self.first_name, + "last_name": self.last_name, + "unique_name": self.unique_name, + "email": self.email, + "phone_number_id": self.phone_number_id, + "external_id": self.external_id, + "anonymous_id": self.anonymous_id, + "alternate_emails": self.alternate_emails, + "address_line_1": self.address_line_1, + "address_line_2": self.address_line_2, + "city": self.city, + "state_province_region": self.state_province_region, + "country": self.country, + "postal_code": self.postal_code, + "phone_number": self.phone_number, + "whatsapp": self.whatsapp, + "line": self.line, + "facebook": self.facebook, + "list_ids": self.list_ids, + "segment_ids": self.segment_ids, + "custom_fields": self.custom_fields, + "created_at": self.created_at, + "updated_at": self.updated_at, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -98,30 +98,29 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactDetails( - id=payload.get('id'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - unique_name=payload.get('unique_name'), - email=payload.get('email'), - phone_number_id=payload.get('phone_number_id'), - external_id=payload.get('external_id'), - anonymous_id=payload.get('anonymous_id'), - alternate_emails=payload.get('alternate_emails'), - address_line_1=payload.get('address_line_1'), - address_line_2=payload.get('address_line_2'), - city=payload.get('city'), - state_province_region=payload.get('state_province_region'), - country=payload.get('country'), - postal_code=payload.get('postal_code'), - phone_number=payload.get('phone_number'), - whatsapp=payload.get('whatsapp'), - line=payload.get('line'), - facebook=payload.get('facebook'), - list_ids=payload.get('list_ids'), - segment_ids=payload.get('segment_ids'), - custom_fields=payload.get('custom_fields'), - created_at=payload.get('created_at'), - updated_at=payload.get('updated_at'), - metadata=payload.get('_metadata') - ) - + id=payload.get("id"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + unique_name=payload.get("unique_name"), + email=payload.get("email"), + phone_number_id=payload.get("phone_number_id"), + external_id=payload.get("external_id"), + anonymous_id=payload.get("anonymous_id"), + alternate_emails=payload.get("alternate_emails"), + address_line_1=payload.get("address_line_1"), + address_line_2=payload.get("address_line_2"), + city=payload.get("city"), + state_province_region=payload.get("state_province_region"), + country=payload.get("country"), + postal_code=payload.get("postal_code"), + phone_number=payload.get("phone_number"), + whatsapp=payload.get("whatsapp"), + line=payload.get("line"), + facebook=payload.get("facebook"), + list_ids=payload.get("list_ids"), + segment_ids=payload.get("segment_ids"), + custom_fields=payload.get("custom_fields"), + created_at=payload.get("created_at"), + updated_at=payload.get("updated_at"), + metadata=payload.get("_metadata"), + ) diff --git a/sendgrid/rest/api/mc_lists/v3/models/create_marketing_list400_response.py b/sendgrid/rest/api/mc_lists/v3/models/create_marketing_list400_response.py index 5135ad35..dd97f4a7 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/create_marketing_list400_response.py +++ b/sendgrid/rest/api/mc_lists/v3/models/create_marketing_list400_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_lists.v3.models.error import Error - class CreateMarketingList400Response: - def __init__( - self, - errors: Optional[List[Error]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[Error]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return CreateMarketingList400Response( - errors=payload.get('errors') - ) - + return CreateMarketingList400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_lists/v3/models/create_marketing_list_request.py b/sendgrid/rest/api/mc_lists/v3/models/create_marketing_list_request.py index c63f1785..e25ac033 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/create_marketing_list_request.py +++ b/sendgrid/rest/api/mc_lists/v3/models/create_marketing_list_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateMarketingListRequest: - def __init__( - self, - name: Optional[str]=None - ): - self.name=name + def __init__(self, name: Optional[str] = None): + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return CreateMarketingListRequest( - name=payload.get('name') - ) - + return CreateMarketingListRequest(name=payload.get("name")) diff --git a/sendgrid/rest/api/mc_lists/v3/models/delete_contact202_response.py b/sendgrid/rest/api/mc_lists/v3/models/delete_contact202_response.py index 5f460f88..fd792d1c 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/delete_contact202_response.py +++ b/sendgrid/rest/api/mc_lists/v3/models/delete_contact202_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DeleteContact202Response: - def __init__( - self, - job_id: Optional[str]=None - ): - self.job_id=job_id + def __init__(self, job_id: Optional[str] = None): + self.job_id = job_id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "job_id": self.job_id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"job_id": self.job_id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DeleteContact202Response( - job_id=payload.get('job_id') - ) - + return DeleteContact202Response(job_id=payload.get("job_id")) diff --git a/sendgrid/rest/api/mc_lists/v3/models/delete_marketing_list200_response.py b/sendgrid/rest/api/mc_lists/v3/models/delete_marketing_list200_response.py index 7be4d994..78cc1582 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/delete_marketing_list200_response.py +++ b/sendgrid/rest/api/mc_lists/v3/models/delete_marketing_list200_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DeleteMarketingList200Response: - def __init__( - self, - job_id: Optional[str]=None - ): - self.job_id=job_id + def __init__(self, job_id: Optional[str] = None): + self.job_id = job_id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "job_id": self.job_id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"job_id": self.job_id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DeleteMarketingList200Response( - job_id=payload.get('job_id') - ) - + return DeleteMarketingList200Response(job_id=payload.get("job_id")) diff --git a/sendgrid/rest/api/mc_lists/v3/models/delete_marketing_list404_response.py b/sendgrid/rest/api/mc_lists/v3/models/delete_marketing_list404_response.py index 8012cd64..1010c35a 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/delete_marketing_list404_response.py +++ b/sendgrid/rest/api/mc_lists/v3/models/delete_marketing_list404_response.py @@ -1,22 +1,17 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DeleteMarketingList404Response: - def __init__( - self, - errors: Optional[List[object]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[object]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DeleteMarketingList404Response( - errors=payload.get('errors') - ) - + return DeleteMarketingList404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_lists/v3/models/error.py b/sendgrid/rest/api/mc_lists/v3/models/error.py index 80ea0405..2601be0c 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/error.py +++ b/sendgrid/rest/api/mc_lists/v3/models/error.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class Error: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - error_id: Optional[str]=None, - parameter: Optional[str]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + error_id: Optional[str] = None, + parameter: Optional[str] = None, ): - self.message=message - self.field=field - self.error_id=error_id - self.parameter=parameter + self.message = message + self.field = field + self.error_id = error_id + self.parameter = parameter def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "error_id": self.error_id, - "parameter": self.parameter - }.items() if value is not None} + "message": self.message, + "field": self.field, + "error_id": self.error_id, + "parameter": self.parameter, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Error( - message=payload.get('message'), - field=payload.get('field'), - error_id=payload.get('error_id'), - parameter=payload.get('parameter') - ) - + message=payload.get("message"), + field=payload.get("field"), + error_id=payload.get("error_id"), + parameter=payload.get("parameter"), + ) diff --git a/sendgrid/rest/api/mc_lists/v3/models/get_marketing_list200_response.py b/sendgrid/rest/api/mc_lists/v3/models/get_marketing_list200_response.py index a5bbcddf..9a5c97d4 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/get_marketing_list200_response.py +++ b/sendgrid/rest/api/mc_lists/v3/models/get_marketing_list200_response.py @@ -1,36 +1,36 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_lists.v3.models.contact_details import ContactDetails from sendgrid.rest.api.mc_lists.v3.models.self_metadata import SelfMetadata - class GetMarketingList200Response: def __init__( - self, - id: Optional[str]=None, - name: Optional[str]=None, - contact_count: Optional[int]=None, - metadata: Optional[SelfMetadata]=None, - contact_sample: Optional[ContactDetails]=None + self, + id: Optional[str] = None, + name: Optional[str] = None, + contact_count: Optional[int] = None, + metadata: Optional[SelfMetadata] = None, + contact_sample: Optional[ContactDetails] = None, ): - self.id=id - self.name=name - self.contact_count=contact_count - self.metadata=metadata - self.contact_sample=contact_sample + self.id = id + self.name = name + self.contact_count = contact_count + self.metadata = metadata + self.contact_sample = contact_sample def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "name": self.name, - "contact_count": self.contact_count, - "_metadata": self.metadata, - "contact_sample": self.contact_sample - }.items() if value is not None} + "id": self.id, + "name": self.name, + "contact_count": self.contact_count, + "_metadata": self.metadata, + "contact_sample": self.contact_sample, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -39,10 +39,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetMarketingList200Response( - id=payload.get('id'), - name=payload.get('name'), - contact_count=payload.get('contact_count'), - metadata=payload.get('_metadata'), - contact_sample=payload.get('contact_sample') - ) - + id=payload.get("id"), + name=payload.get("name"), + contact_count=payload.get("contact_count"), + metadata=payload.get("_metadata"), + contact_sample=payload.get("contact_sample"), + ) diff --git a/sendgrid/rest/api/mc_lists/v3/models/list.py b/sendgrid/rest/api/mc_lists/v3/models/list.py index b0237f5a..78259244 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/list.py +++ b/sendgrid/rest/api/mc_lists/v3/models/list.py @@ -1,32 +1,32 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_lists.v3.models.self_metadata import SelfMetadata - class List: def __init__( - self, - id: Optional[str]=None, - name: Optional[str]=None, - contact_count: Optional[int]=None, - metadata: Optional[SelfMetadata]=None + self, + id: Optional[str] = None, + name: Optional[str] = None, + contact_count: Optional[int] = None, + metadata: Optional[SelfMetadata] = None, ): - self.id=id - self.name=name - self.contact_count=contact_count - self.metadata=metadata + self.id = id + self.name = name + self.contact_count = contact_count + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "name": self.name, - "contact_count": self.contact_count, - "_metadata": self.metadata - }.items() if value is not None} + "id": self.id, + "name": self.name, + "contact_count": self.contact_count, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -35,9 +35,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return List( - id=payload.get('id'), - name=payload.get('name'), - contact_count=payload.get('contact_count'), - metadata=payload.get('_metadata') - ) - + id=payload.get("id"), + name=payload.get("name"), + contact_count=payload.get("contact_count"), + metadata=payload.get("_metadata"), + ) diff --git a/sendgrid/rest/api/mc_lists/v3/models/list_contact_count200_response.py b/sendgrid/rest/api/mc_lists/v3/models/list_contact_count200_response.py index abe4947b..b7bb2a00 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/list_contact_count200_response.py +++ b/sendgrid/rest/api/mc_lists/v3/models/list_contact_count200_response.py @@ -1,25 +1,23 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListContactCount200Response: def __init__( - self, - contact_count: Optional[int]=None, - billable_count: Optional[int]=None + self, contact_count: Optional[int] = None, billable_count: Optional[int] = None ): - self.contact_count=contact_count - self.billable_count=billable_count + self.contact_count = contact_count + self.billable_count = billable_count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "contact_count": self.contact_count, - "billable_count": self.billable_count - }.items() if value is not None} + "contact_count": self.contact_count, + "billable_count": self.billable_count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +26,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListContactCount200Response( - contact_count=payload.get('contact_count'), - billable_count=payload.get('billable_count') - ) - + contact_count=payload.get("contact_count"), + billable_count=payload.get("billable_count"), + ) diff --git a/sendgrid/rest/api/mc_lists/v3/models/list_marketing_list200_response.py b/sendgrid/rest/api/mc_lists/v3/models/list_marketing_list200_response.py index 152f74df..6d6c9dbf 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/list_marketing_list200_response.py +++ b/sendgrid/rest/api/mc_lists/v3/models/list_marketing_list200_response.py @@ -1,26 +1,24 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_lists.v3.models.metadata import Metadata - class ListMarketingList200Response: def __init__( - self, - result: Optional[List[List]]=None, - metadata: Optional[Metadata]=None + self, result: Optional[List[List]] = None, metadata: Optional[Metadata] = None ): - self.result=result - self.metadata=metadata + self.result = result + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "result": self.result, - "_metadata": self.metadata - }.items() if value is not None} + "result": self.result, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +27,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListMarketingList200Response( - result=payload.get('result'), - metadata=payload.get('_metadata') - ) - + result=payload.get("result"), metadata=payload.get("_metadata") + ) diff --git a/sendgrid/rest/api/mc_lists/v3/models/metadata.py b/sendgrid/rest/api/mc_lists/v3/models/metadata.py index 1e8e145e..2d7bf72c 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/metadata.py +++ b/sendgrid/rest/api/mc_lists/v3/models/metadata.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class Metadata: def __init__( - self, - prev: Optional[str]=None, - var_self: Optional[str]=None, - next: Optional[str]=None, - count: Optional[float]=None + self, + prev: Optional[str] = None, + var_self: Optional[str] = None, + next: Optional[str] = None, + count: Optional[float] = None, ): - self.prev=prev - self.var_self=var_self - self.next=next - self.count=count + self.prev = prev + self.var_self = var_self + self.next = next + self.count = count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "prev": self.prev, - "self": self.var_self, - "next": self.next, - "count": self.count - }.items() if value is not None} + "prev": self.prev, + "self": self.var_self, + "next": self.next, + "count": self.count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Metadata( - prev=payload.get('prev'), - var_self=payload.get('self'), - next=payload.get('next'), - count=payload.get('count') - ) - + prev=payload.get("prev"), + var_self=payload.get("self"), + next=payload.get("next"), + count=payload.get("count"), + ) diff --git a/sendgrid/rest/api/mc_lists/v3/models/self_metadata.py b/sendgrid/rest/api/mc_lists/v3/models/self_metadata.py index 30c459f5..448cb9b0 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/self_metadata.py +++ b/sendgrid/rest/api/mc_lists/v3/models/self_metadata.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SelfMetadata: - def __init__( - self, - var_self: Optional[str]=None - ): - self.var_self=var_self + def __init__(self, var_self: Optional[str] = None): + self.var_self = var_self def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "self": self.var_self - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"self": self.var_self}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SelfMetadata( - var_self=payload.get('self') - ) - + return SelfMetadata(var_self=payload.get("self")) diff --git a/sendgrid/rest/api/mc_lists/v3/models/update_marketing_list_request.py b/sendgrid/rest/api/mc_lists/v3/models/update_marketing_list_request.py index 6ac63c6f..91e940b0 100644 --- a/sendgrid/rest/api/mc_lists/v3/models/update_marketing_list_request.py +++ b/sendgrid/rest/api/mc_lists/v3/models/update_marketing_list_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateMarketingListRequest: - def __init__( - self, - name: Optional[str]=None - ): - self.name=name + def __init__(self, name: Optional[str] = None): + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateMarketingListRequest( - name=payload.get('name') - ) - + return UpdateMarketingListRequest(name=payload.get("name")) diff --git a/sendgrid/rest/api/mc_lists/v3/update_marketing_list.py b/sendgrid/rest/api/mc_lists/v3/update_marketing_list.py index 5e221ba2..5fcc29e0 100644 --- a/sendgrid/rest/api/mc_lists/v3/update_marketing_list.py +++ b/sendgrid/rest/api/mc_lists/v3/update_marketing_list.py @@ -12,53 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_lists.v3.models.list import List -from sendgrid.rest.api.mc_lists.v3.models.update_marketing_list_request import UpdateMarketingListRequest +from sendgrid.rest.api.mc_lists.v3.models.update_marketing_list_request import ( + UpdateMarketingListRequest, +) + class UpdateMarketingList: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - update_marketing_list_request: Optional[UpdateMarketingListRequest] = None, - + id: str, + update_marketing_list_request: Optional[UpdateMarketingListRequest] = None, ): - path='/v3/marketing/lists/{id}' + path = "/v3/marketing/lists/{id}" path = path.format( - id=id, + id=id, ) data = None if update_marketing_list_request: data = update_marketing_list_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_segments/v3/__init__.py b/sendgrid/rest/api/mc_segments/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/mc_segments/v3/__init__.py +++ b/sendgrid/rest/api/mc_segments/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/mc_segments/v3/delete_segment.py b/sendgrid/rest/api/mc_segments/v3/delete_segment.py index 3a7a78a3..63a8afd9 100644 --- a/sendgrid/rest/api/mc_segments/v3/delete_segment.py +++ b/sendgrid/rest/api/mc_segments/v3/delete_segment.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field -from typing_extensions import Annotated class DeleteSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - segment_id: str, - + segment_id: str, ): - path='/v3/marketing/segments/{segment_id}' + path = "/v3/marketing/segments/{segment_id}" path = path.format( - segment_id=segment_id, + segment_id=segment_id, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_segments/v3/get_segment.py b/sendgrid/rest/api/mc_segments/v3/get_segment.py index 8be5729e..37dd261f 100644 --- a/sendgrid/rest/api/mc_segments/v3/get_segment.py +++ b/sendgrid/rest/api/mc_segments/v3/get_segment.py @@ -12,50 +12,45 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_segments.v3.models.full_segment import FullSegment + class GetSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - segment_id: str, - query_json: Optional[bool] = None, - + segment_id: str, + query_json: Optional[bool] = None, ): - path='/v3/marketing/segments/{segment_id}' + path = "/v3/marketing/segments/{segment_id}" path = path.format( - segment_id=segment_id, + segment_id=segment_id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_segments/v3/list_segment.py b/sendgrid/rest/api/mc_segments/v3/list_segment.py index c7bc59cb..f2f7b124 100644 --- a/sendgrid/rest/api/mc_segments/v3/list_segment.py +++ b/sendgrid/rest/api/mc_segments/v3/list_segment.py @@ -12,48 +12,43 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import List, Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictStr from typing import List, Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_segments.v3.models.list_segment200_response import ListSegment200Response + class ListSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - ids: Optional[List[str]] = None, - parent_list_ids: Optional[str] = None, - no_parent_list_id: Optional[bool] = None, - + ids: Optional[List[str]] = None, + parent_list_ids: Optional[str] = None, + no_parent_list_id: Optional[bool] = None, ): - path='/v3/marketing/segments' + path = "/v3/marketing/segments" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_segments/v3/models/__init__.py b/sendgrid/rest/api/mc_segments/v3/models/__init__.py index 45bb3976..34462b2f 100644 --- a/sendgrid/rest/api/mc_segments/v3/models/__init__.py +++ b/sendgrid/rest/api/mc_segments/v3/models/__init__.py @@ -11,19 +11,46 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.mc_segments.v3.models.contact_response import ContactResponse -from sendgrid.rest.api.mc_segments.v3.models.contact_response_custom_fields import ContactResponseCustomFields +from sendgrid.rest.api.mc_segments.v3.models.contact_response_custom_fields import ( + ContactResponseCustomFields, +) from sendgrid.rest.api.mc_segments.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.mc_segments.v3.models.error_response_errors_inner import ErrorResponseErrorsInner +from sendgrid.rest.api.mc_segments.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) from sendgrid.rest.api.mc_segments.v3.models.full_segment import FullSegment -from sendgrid.rest.api.mc_segments.v3.models.get_segment404_response import GetSegment404Response -from sendgrid.rest.api.mc_segments.v3.models.get_segment404_response_errors_inner import GetSegment404ResponseErrorsInner -from sendgrid.rest.api.mc_segments.v3.models.list_segment200_response import ListSegment200Response -from sendgrid.rest.api.mc_segments.v3.models.list_segment500_response import ListSegment500Response -from sendgrid.rest.api.mc_segments.v3.models.list_segment500_response_errors_inner import ListSegment500ResponseErrorsInner +from sendgrid.rest.api.mc_segments.v3.models.get_segment404_response import ( + GetSegment404Response, +) +from sendgrid.rest.api.mc_segments.v3.models.get_segment404_response_errors_inner import ( + GetSegment404ResponseErrorsInner, +) +from sendgrid.rest.api.mc_segments.v3.models.list_segment200_response import ( + ListSegment200Response, +) +from sendgrid.rest.api.mc_segments.v3.models.list_segment500_response import ( + ListSegment500Response, +) +from sendgrid.rest.api.mc_segments.v3.models.list_segment500_response_errors_inner import ( + ListSegment500ResponseErrorsInner, +) from sendgrid.rest.api.mc_segments.v3.models.segment_summary import SegmentSummary from sendgrid.rest.api.mc_segments.v3.models.segment_write_v2 import SegmentWriteV2 -__all__ = [ 'ContactResponse', 'ContactResponseCustomFields', 'ErrorResponse', 'ErrorResponseErrorsInner', 'FullSegment', 'GetSegment404Response', 'GetSegment404ResponseErrorsInner', 'ListSegment200Response', 'ListSegment500Response', 'ListSegment500ResponseErrorsInner', 'SegmentSummary', 'SegmentWriteV2' ] -# Testing code \ No newline at end of file + +__all__ = [ + "ContactResponse", + "ContactResponseCustomFields", + "ErrorResponse", + "ErrorResponseErrorsInner", + "FullSegment", + "GetSegment404Response", + "GetSegment404ResponseErrorsInner", + "ListSegment200Response", + "ListSegment500Response", + "ListSegment500ResponseErrorsInner", + "SegmentSummary", + "SegmentWriteV2", +] +# Testing code diff --git a/sendgrid/rest/api/mc_segments/v3/models/contact_response.py b/sendgrid/rest/api/mc_segments/v3/models/contact_response.py index f4949883..6de8877f 100644 --- a/sendgrid/rest/api/mc_segments/v3/models/contact_response.py +++ b/sendgrid/rest/api/mc_segments/v3/models/contact_response.py @@ -1,71 +1,73 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_segments.v3.models.contact_response_custom_fields import ContactResponseCustomFields - +from sendgrid.rest.api.mc_segments.v3.models.contact_response_custom_fields import ( + ContactResponseCustomFields, +) class ContactResponse: def __init__( - self, - id: Optional[str]=None, - email: Optional[str]=None, - phone_number_id: Optional[str]=None, - external_id: Optional[str]=None, - anonymous_id: Optional[str]=None, - alternate_emails: Optional[List[str]]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - address_line_1: Optional[str]=None, - address_line_2: Optional[str]=None, - city: Optional[str]=None, - state_province_region: Optional[str]=None, - postal_code: Optional[int]=None, - country: Optional[str]=None, - list_ids: Optional[List[str]]=None, - custom_fields: Optional[ContactResponseCustomFields]=None, - segment_ids: Optional[List[str]]=None + self, + id: Optional[str] = None, + email: Optional[str] = None, + phone_number_id: Optional[str] = None, + external_id: Optional[str] = None, + anonymous_id: Optional[str] = None, + alternate_emails: Optional[List[str]] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + address_line_1: Optional[str] = None, + address_line_2: Optional[str] = None, + city: Optional[str] = None, + state_province_region: Optional[str] = None, + postal_code: Optional[int] = None, + country: Optional[str] = None, + list_ids: Optional[List[str]] = None, + custom_fields: Optional[ContactResponseCustomFields] = None, + segment_ids: Optional[List[str]] = None, ): - self.id=id - self.email=email - self.phone_number_id=phone_number_id - self.external_id=external_id - self.anonymous_id=anonymous_id - self.alternate_emails=alternate_emails - self.first_name=first_name - self.last_name=last_name - self.address_line_1=address_line_1 - self.address_line_2=address_line_2 - self.city=city - self.state_province_region=state_province_region - self.postal_code=postal_code - self.country=country - self.list_ids=list_ids - self.custom_fields=custom_fields - self.segment_ids=segment_ids + self.id = id + self.email = email + self.phone_number_id = phone_number_id + self.external_id = external_id + self.anonymous_id = anonymous_id + self.alternate_emails = alternate_emails + self.first_name = first_name + self.last_name = last_name + self.address_line_1 = address_line_1 + self.address_line_2 = address_line_2 + self.city = city + self.state_province_region = state_province_region + self.postal_code = postal_code + self.country = country + self.list_ids = list_ids + self.custom_fields = custom_fields + self.segment_ids = segment_ids def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "email": self.email, - "phone_number_id": self.phone_number_id, - "external_id": self.external_id, - "anonymous_id": self.anonymous_id, - "alternate_emails": self.alternate_emails, - "first_name": self.first_name, - "last_name": self.last_name, - "address_line_1": self.address_line_1, - "address_line_2": self.address_line_2, - "city": self.city, - "state_province_region": self.state_province_region, - "postal_code": self.postal_code, - "country": self.country, - "list_ids": self.list_ids, - "custom_fields": self.custom_fields, - "segment_ids": self.segment_ids - }.items() if value is not None} + "id": self.id, + "email": self.email, + "phone_number_id": self.phone_number_id, + "external_id": self.external_id, + "anonymous_id": self.anonymous_id, + "alternate_emails": self.alternate_emails, + "first_name": self.first_name, + "last_name": self.last_name, + "address_line_1": self.address_line_1, + "address_line_2": self.address_line_2, + "city": self.city, + "state_province_region": self.state_province_region, + "postal_code": self.postal_code, + "country": self.country, + "list_ids": self.list_ids, + "custom_fields": self.custom_fields, + "segment_ids": self.segment_ids, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -74,22 +76,21 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactResponse( - id=payload.get('id'), - email=payload.get('email'), - phone_number_id=payload.get('phone_number_id'), - external_id=payload.get('external_id'), - anonymous_id=payload.get('anonymous_id'), - alternate_emails=payload.get('alternate_emails'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - address_line_1=payload.get('address_line_1'), - address_line_2=payload.get('address_line_2'), - city=payload.get('city'), - state_province_region=payload.get('state_province_region'), - postal_code=payload.get('postal_code'), - country=payload.get('country'), - list_ids=payload.get('list_ids'), - custom_fields=payload.get('custom_fields'), - segment_ids=payload.get('segment_ids') - ) - + id=payload.get("id"), + email=payload.get("email"), + phone_number_id=payload.get("phone_number_id"), + external_id=payload.get("external_id"), + anonymous_id=payload.get("anonymous_id"), + alternate_emails=payload.get("alternate_emails"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + address_line_1=payload.get("address_line_1"), + address_line_2=payload.get("address_line_2"), + city=payload.get("city"), + state_province_region=payload.get("state_province_region"), + postal_code=payload.get("postal_code"), + country=payload.get("country"), + list_ids=payload.get("list_ids"), + custom_fields=payload.get("custom_fields"), + segment_ids=payload.get("segment_ids"), + ) diff --git a/sendgrid/rest/api/mc_segments/v3/models/contact_response_custom_fields.py b/sendgrid/rest/api/mc_segments/v3/models/contact_response_custom_fields.py index bd954a85..bd130acd 100644 --- a/sendgrid/rest/api/mc_segments/v3/models/contact_response_custom_fields.py +++ b/sendgrid/rest/api/mc_segments/v3/models/contact_response_custom_fields.py @@ -1,25 +1,25 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ContactResponseCustomFields: def __init__( - self, - custom_field_name1: Optional[str]=None, - custom_field_name2: Optional[str]=None + self, + custom_field_name1: Optional[str] = None, + custom_field_name2: Optional[str] = None, ): - self.custom_field_name1=custom_field_name1 - self.custom_field_name2=custom_field_name2 + self.custom_field_name1 = custom_field_name1 + self.custom_field_name2 = custom_field_name2 def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "custom_field_name1": self.custom_field_name1, - "custom_field_name2": self.custom_field_name2 - }.items() if value is not None} + "custom_field_name1": self.custom_field_name1, + "custom_field_name2": self.custom_field_name2, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +28,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactResponseCustomFields( - custom_field_name1=payload.get('custom_field_name1'), - custom_field_name2=payload.get('custom_field_name2') - ) - + custom_field_name1=payload.get("custom_field_name1"), + custom_field_name2=payload.get("custom_field_name2"), + ) diff --git a/sendgrid/rest/api/mc_segments/v3/models/error_response.py b/sendgrid/rest/api/mc_segments/v3/models/error_response.py index 8b299c65..23acd507 100644 --- a/sendgrid/rest/api/mc_segments/v3/models/error_response.py +++ b/sendgrid/rest/api/mc_segments/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_segments.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.mc_segments.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/mc_segments/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/mc_segments/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/mc_segments/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/mc_segments/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/mc_segments/v3/models/full_segment.py b/sendgrid/rest/api/mc_segments/v3/models/full_segment.py index 161716ce..95d6aec0 100644 --- a/sendgrid/rest/api/mc_segments/v3/models/full_segment.py +++ b/sendgrid/rest/api/mc_segments/v3/models/full_segment.py @@ -1,56 +1,56 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_segments.v3.models.contact_response import ContactResponse - class FullSegment: def __init__( - self, - id: Optional[str]=None, - contacts_count: Optional[int]=None, - created_at: Optional[datetime]=None, - name: Optional[str]=None, - parent_list_id: Optional[str]=None, - sample_updated_at: Optional[datetime]=None, - updated_at: Optional[datetime]=None, - next_sample_update: Optional[str]=None, - contacts_sample: Optional[List[ContactResponse]]=None, - query_json: Optional[object]=None, - parent_list_ids: Optional[List[str]]=None, - query_dsl: Optional[str]=None + self, + id: Optional[str] = None, + contacts_count: Optional[int] = None, + created_at: Optional[datetime] = None, + name: Optional[str] = None, + parent_list_id: Optional[str] = None, + sample_updated_at: Optional[datetime] = None, + updated_at: Optional[datetime] = None, + next_sample_update: Optional[str] = None, + contacts_sample: Optional[List[ContactResponse]] = None, + query_json: Optional[object] = None, + parent_list_ids: Optional[List[str]] = None, + query_dsl: Optional[str] = None, ): - self.id=id - self.contacts_count=contacts_count - self.created_at=created_at - self.name=name - self.parent_list_id=parent_list_id - self.sample_updated_at=sample_updated_at - self.updated_at=updated_at - self.next_sample_update=next_sample_update - self.contacts_sample=contacts_sample - self.query_json=query_json - self.parent_list_ids=parent_list_ids - self.query_dsl=query_dsl + self.id = id + self.contacts_count = contacts_count + self.created_at = created_at + self.name = name + self.parent_list_id = parent_list_id + self.sample_updated_at = sample_updated_at + self.updated_at = updated_at + self.next_sample_update = next_sample_update + self.contacts_sample = contacts_sample + self.query_json = query_json + self.parent_list_ids = parent_list_ids + self.query_dsl = query_dsl def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "contacts_count": self.contacts_count, - "created_at": self.created_at, - "name": self.name, - "parent_list_id": self.parent_list_id, - "sample_updated_at": self.sample_updated_at, - "updated_at": self.updated_at, - "next_sample_update": self.next_sample_update, - "contacts_sample": self.contacts_sample, - "query_json": self.query_json, - "parent_list_ids": self.parent_list_ids, - "query_dsl": self.query_dsl - }.items() if value is not None} + "id": self.id, + "contacts_count": self.contacts_count, + "created_at": self.created_at, + "name": self.name, + "parent_list_id": self.parent_list_id, + "sample_updated_at": self.sample_updated_at, + "updated_at": self.updated_at, + "next_sample_update": self.next_sample_update, + "contacts_sample": self.contacts_sample, + "query_json": self.query_json, + "parent_list_ids": self.parent_list_ids, + "query_dsl": self.query_dsl, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -59,17 +59,16 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return FullSegment( - id=payload.get('id'), - contacts_count=payload.get('contacts_count'), - created_at=payload.get('created_at'), - name=payload.get('name'), - parent_list_id=payload.get('parent_list_id'), - sample_updated_at=payload.get('sample_updated_at'), - updated_at=payload.get('updated_at'), - next_sample_update=payload.get('next_sample_update'), - contacts_sample=payload.get('contacts_sample'), - query_json=payload.get('query_json'), - parent_list_ids=payload.get('parent_list_ids'), - query_dsl=payload.get('query_dsl') - ) - + id=payload.get("id"), + contacts_count=payload.get("contacts_count"), + created_at=payload.get("created_at"), + name=payload.get("name"), + parent_list_id=payload.get("parent_list_id"), + sample_updated_at=payload.get("sample_updated_at"), + updated_at=payload.get("updated_at"), + next_sample_update=payload.get("next_sample_update"), + contacts_sample=payload.get("contacts_sample"), + query_json=payload.get("query_json"), + parent_list_ids=payload.get("parent_list_ids"), + query_dsl=payload.get("query_dsl"), + ) diff --git a/sendgrid/rest/api/mc_segments/v3/models/get_segment404_response.py b/sendgrid/rest/api/mc_segments/v3/models/get_segment404_response.py index 14fd856e..10e2435c 100644 --- a/sendgrid/rest/api/mc_segments/v3/models/get_segment404_response.py +++ b/sendgrid/rest/api/mc_segments/v3/models/get_segment404_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_segments.v3.models.get_segment404_response_errors_inner import GetSegment404ResponseErrorsInner - +from sendgrid.rest.api.mc_segments.v3.models.get_segment404_response_errors_inner import ( + GetSegment404ResponseErrorsInner, +) class GetSegment404Response: - def __init__( - self, - errors: Optional[List[GetSegment404ResponseErrorsInner]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[GetSegment404ResponseErrorsInner]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetSegment404Response( - errors=payload.get('errors') - ) - + return GetSegment404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_segments/v3/models/get_segment404_response_errors_inner.py b/sendgrid/rest/api/mc_segments/v3/models/get_segment404_response_errors_inner.py index 44cc1db3..4a27e1a0 100644 --- a/sendgrid/rest/api/mc_segments/v3/models/get_segment404_response_errors_inner.py +++ b/sendgrid/rest/api/mc_segments/v3/models/get_segment404_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GetSegment404ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None - ): - self.message=message - self.field=field + def __init__(self, message: Optional[str] = None, field: Optional[str] = None): + self.message = message + self.field = field def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message, - "field": self.field - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message, "field": self.field}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetSegment404ResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field') - ) - + message=payload.get("message"), field=payload.get("field") + ) diff --git a/sendgrid/rest/api/mc_segments/v3/models/list_segment200_response.py b/sendgrid/rest/api/mc_segments/v3/models/list_segment200_response.py index 8c4a7af6..33a8c24a 100644 --- a/sendgrid/rest/api/mc_segments/v3/models/list_segment200_response.py +++ b/sendgrid/rest/api/mc_segments/v3/models/list_segment200_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_segments.v3.models.segment_summary import SegmentSummary - class ListSegment200Response: - def __init__( - self, - results: Optional[List[SegmentSummary]]=None - ): - self.results=results + def __init__(self, results: Optional[List[SegmentSummary]] = None): + self.results = results def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "results": self.results - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"results": self.results}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListSegment200Response( - results=payload.get('results') - ) - + return ListSegment200Response(results=payload.get("results")) diff --git a/sendgrid/rest/api/mc_segments/v3/models/list_segment500_response.py b/sendgrid/rest/api/mc_segments/v3/models/list_segment500_response.py index ac83f54d..c4b07c8e 100644 --- a/sendgrid/rest/api/mc_segments/v3/models/list_segment500_response.py +++ b/sendgrid/rest/api/mc_segments/v3/models/list_segment500_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_segments.v3.models.list_segment500_response_errors_inner import ListSegment500ResponseErrorsInner - +from sendgrid.rest.api.mc_segments.v3.models.list_segment500_response_errors_inner import ( + ListSegment500ResponseErrorsInner, +) class ListSegment500Response: def __init__( - self, - errors: Optional[List[ListSegment500ResponseErrorsInner]]=None + self, errors: Optional[List[ListSegment500ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListSegment500Response( - errors=payload.get('errors') - ) - + return ListSegment500Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_segments/v3/models/list_segment500_response_errors_inner.py b/sendgrid/rest/api/mc_segments/v3/models/list_segment500_response_errors_inner.py index 6f5d3113..293478ac 100644 --- a/sendgrid/rest/api/mc_segments/v3/models/list_segment500_response_errors_inner.py +++ b/sendgrid/rest/api/mc_segments/v3/models/list_segment500_response_errors_inner.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListSegment500ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListSegment500ResponseErrorsInner( - message=payload.get('message') - ) - + return ListSegment500ResponseErrorsInner(message=payload.get("message")) diff --git a/sendgrid/rest/api/mc_segments/v3/models/segment_summary.py b/sendgrid/rest/api/mc_segments/v3/models/segment_summary.py index a145bf8e..b531df80 100644 --- a/sendgrid/rest/api/mc_segments/v3/models/segment_summary.py +++ b/sendgrid/rest/api/mc_segments/v3/models/segment_summary.py @@ -1,43 +1,43 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SegmentSummary: def __init__( - self, - id: Optional[str]=None, - contacts_count: Optional[int]=None, - created_at: Optional[datetime]=None, - name: Optional[str]=None, - parent_list_id: Optional[str]=None, - sample_updated_at: Optional[datetime]=None, - updated_at: Optional[datetime]=None, - next_sample_update: Optional[str]=None + self, + id: Optional[str] = None, + contacts_count: Optional[int] = None, + created_at: Optional[datetime] = None, + name: Optional[str] = None, + parent_list_id: Optional[str] = None, + sample_updated_at: Optional[datetime] = None, + updated_at: Optional[datetime] = None, + next_sample_update: Optional[str] = None, ): - self.id=id - self.contacts_count=contacts_count - self.created_at=created_at - self.name=name - self.parent_list_id=parent_list_id - self.sample_updated_at=sample_updated_at - self.updated_at=updated_at - self.next_sample_update=next_sample_update + self.id = id + self.contacts_count = contacts_count + self.created_at = created_at + self.name = name + self.parent_list_id = parent_list_id + self.sample_updated_at = sample_updated_at + self.updated_at = updated_at + self.next_sample_update = next_sample_update def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "contacts_count": self.contacts_count, - "created_at": self.created_at, - "name": self.name, - "parent_list_id": self.parent_list_id, - "sample_updated_at": self.sample_updated_at, - "updated_at": self.updated_at, - "next_sample_update": self.next_sample_update - }.items() if value is not None} + "id": self.id, + "contacts_count": self.contacts_count, + "created_at": self.created_at, + "name": self.name, + "parent_list_id": self.parent_list_id, + "sample_updated_at": self.sample_updated_at, + "updated_at": self.updated_at, + "next_sample_update": self.next_sample_update, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -46,13 +46,12 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SegmentSummary( - id=payload.get('id'), - contacts_count=payload.get('contacts_count'), - created_at=payload.get('created_at'), - name=payload.get('name'), - parent_list_id=payload.get('parent_list_id'), - sample_updated_at=payload.get('sample_updated_at'), - updated_at=payload.get('updated_at'), - next_sample_update=payload.get('next_sample_update') - ) - + id=payload.get("id"), + contacts_count=payload.get("contacts_count"), + created_at=payload.get("created_at"), + name=payload.get("name"), + parent_list_id=payload.get("parent_list_id"), + sample_updated_at=payload.get("sample_updated_at"), + updated_at=payload.get("updated_at"), + next_sample_update=payload.get("next_sample_update"), + ) diff --git a/sendgrid/rest/api/mc_segments/v3/models/segment_write_v2.py b/sendgrid/rest/api/mc_segments/v3/models/segment_write_v2.py index fcfc7d6c..1faaa3cd 100644 --- a/sendgrid/rest/api/mc_segments/v3/models/segment_write_v2.py +++ b/sendgrid/rest/api/mc_segments/v3/models/segment_write_v2.py @@ -1,28 +1,28 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SegmentWriteV2: def __init__( - self, - name: Optional[str]=None, - parent_list_ids: Optional[List[str]]=None, - query_dsl: Optional[str]=None + self, + name: Optional[str] = None, + parent_list_ids: Optional[List[str]] = None, + query_dsl: Optional[str] = None, ): - self.name=name - self.parent_list_ids=parent_list_ids - self.query_dsl=query_dsl + self.name = name + self.parent_list_ids = parent_list_ids + self.query_dsl = query_dsl def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "parent_list_ids": self.parent_list_ids, - "query_dsl": self.query_dsl - }.items() if value is not None} + "name": self.name, + "parent_list_ids": self.parent_list_ids, + "query_dsl": self.query_dsl, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SegmentWriteV2( - name=payload.get('name'), - parent_list_ids=payload.get('parent_list_ids'), - query_dsl=payload.get('query_dsl') - ) - + name=payload.get("name"), + parent_list_ids=payload.get("parent_list_ids"), + query_dsl=payload.get("query_dsl"), + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/__init__.py b/sendgrid/rest/api/mc_segments_2/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/__init__.py +++ b/sendgrid/rest/api/mc_segments_2/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/mc_segments_2/v3/create_segment.py b/sendgrid/rest/api/mc_segments_2/v3/create_segment.py index 72b630dd..ea8b3561 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/create_segment.py +++ b/sendgrid/rest/api/mc_segments_2/v3/create_segment.py @@ -12,47 +12,44 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.mc_segments_2.v3.models.segment2xx import Segment2xx from sendgrid.rest.api.mc_segments_2.v3.models.segment_write_v2 import SegmentWriteV2 + class CreateSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - segment_write_v2: Optional[SegmentWriteV2] = None, - + segment_write_v2: Optional[SegmentWriteV2] = None, ): - path='/v3/marketing/segments/2.0' + path = "/v3/marketing/segments/2.0" data = None if segment_write_v2: data = segment_write_v2.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/delete_segment.py b/sendgrid/rest/api/mc_segments_2/v3/delete_segment.py index fe6cb5e9..02a548b6 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/delete_segment.py +++ b/sendgrid/rest/api/mc_segments_2/v3/delete_segment.py @@ -12,46 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr class DeleteSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - segment_id: str, - + segment_id: str, ): - path='/v3/marketing/segments/2.0/{segment_id}' + path = "/v3/marketing/segments/2.0/{segment_id}" path = path.format( - segment_id=segment_id, + segment_id=segment_id, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/get_segment.py b/sendgrid/rest/api/mc_segments_2/v3/get_segment.py index 588ac5c5..6a831682 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/get_segment.py +++ b/sendgrid/rest/api/mc_segments_2/v3/get_segment.py @@ -12,50 +12,45 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_segments_2.v3.models.segment2xx import Segment2xx + class GetSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - segment_id: str, - contacts_sample: Optional[bool] = None, - + segment_id: str, + contacts_sample: Optional[bool] = None, ): - path='/v3/marketing/segments/2.0/{segment_id}' + path = "/v3/marketing/segments/2.0/{segment_id}" path = path.format( - segment_id=segment_id, + segment_id=segment_id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/list_segment.py b/sendgrid/rest/api/mc_segments_2/v3/list_segment.py index 03a1842a..10a1b15d 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/list_segment.py +++ b/sendgrid/rest/api/mc_segments_2/v3/list_segment.py @@ -12,48 +12,43 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import List, Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictStr from typing import List, Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_segments_2.v3.models.all_segments200 import AllSegments200 + class ListSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - ids: Optional[List[str]] = None, - parent_list_ids: Optional[str] = None, - no_parent_list_id: Optional[bool] = None, - + ids: Optional[List[str]] = None, + parent_list_ids: Optional[str] = None, + no_parent_list_id: Optional[bool] = None, ): - path='/v3/marketing/segments/2.0' + path = "/v3/marketing/segments/2.0" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/__init__.py b/sendgrid/rest/api/mc_segments_2/v3/models/__init__.py index cb46311d..800b8bbf 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/__init__.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/__init__.py @@ -11,20 +11,44 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.mc_segments_2.v3.models.all_segments200 import AllSegments200 from sendgrid.rest.api.mc_segments_2.v3.models.contact_response import ContactResponse -from sendgrid.rest.api.mc_segments_2.v3.models.contact_response_custom_fields import ContactResponseCustomFields +from sendgrid.rest.api.mc_segments_2.v3.models.contact_response_custom_fields import ( + ContactResponseCustomFields, +) from sendgrid.rest.api.mc_segments_2.v3.models.errors_segment_v2 import ErrorsSegmentV2 -from sendgrid.rest.api.mc_segments_2.v3.models.errors_segment_v2_errors_inner import ErrorsSegmentV2ErrorsInner +from sendgrid.rest.api.mc_segments_2.v3.models.errors_segment_v2_errors_inner import ( + ErrorsSegmentV2ErrorsInner, +) from sendgrid.rest.api.mc_segments_2.v3.models.metadata import Metadata from sendgrid.rest.api.mc_segments_2.v3.models.segment2xx import Segment2xx from sendgrid.rest.api.mc_segments_2.v3.models.segment_error import SegmentError -from sendgrid.rest.api.mc_segments_2.v3.models.segment_refresh202 import SegmentRefresh202 -from sendgrid.rest.api.mc_segments_2.v3.models.segment_refresh_request import SegmentRefreshRequest -from sendgrid.rest.api.mc_segments_2.v3.models.segment_status_response import SegmentStatusResponse +from sendgrid.rest.api.mc_segments_2.v3.models.segment_refresh202 import ( + SegmentRefresh202, +) +from sendgrid.rest.api.mc_segments_2.v3.models.segment_refresh_request import ( + SegmentRefreshRequest, +) +from sendgrid.rest.api.mc_segments_2.v3.models.segment_status_response import ( + SegmentStatusResponse, +) from sendgrid.rest.api.mc_segments_2.v3.models.segment_update import SegmentUpdate from sendgrid.rest.api.mc_segments_2.v3.models.segment_write_v2 import SegmentWriteV2 -__all__ = [ 'AllSegments200', 'ContactResponse', 'ContactResponseCustomFields', 'ErrorsSegmentV2', 'ErrorsSegmentV2ErrorsInner', 'Metadata', 'Segment2xx', 'SegmentError', 'SegmentRefresh202', 'SegmentRefreshRequest', 'SegmentStatusResponse', 'SegmentUpdate', 'SegmentWriteV2' ] -# Testing code \ No newline at end of file + +__all__ = [ + "AllSegments200", + "ContactResponse", + "ContactResponseCustomFields", + "ErrorsSegmentV2", + "ErrorsSegmentV2ErrorsInner", + "Metadata", + "Segment2xx", + "SegmentError", + "SegmentRefresh202", + "SegmentRefreshRequest", + "SegmentStatusResponse", + "SegmentUpdate", + "SegmentWriteV2", +] +# Testing code diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/all_segments200.py b/sendgrid/rest/api/mc_segments_2/v3/models/all_segments200.py index 983062ad..d2d859e6 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/all_segments200.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/all_segments200.py @@ -1,54 +1,56 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_segments_2.v3.models.metadata import Metadata -from sendgrid.rest.api.mc_segments_2.v3.models.segment_status_response import SegmentStatusResponse - +from sendgrid.rest.api.mc_segments_2.v3.models.segment_status_response import ( + SegmentStatusResponse, +) class AllSegments200: def __init__( - self, - id: Optional[str]=None, - name: Optional[str]=None, - contacts_count: Optional[int]=None, - created_at: Optional[str]=None, - updated_at: Optional[str]=None, - sample_updated_at: Optional[str]=None, - next_sample_update: Optional[str]=None, - parent_list_ids: Optional[List[str]]=None, - query_version: Optional[str]=None, - metadata: Optional[Metadata]=None, - status: Optional[SegmentStatusResponse]=None + self, + id: Optional[str] = None, + name: Optional[str] = None, + contacts_count: Optional[int] = None, + created_at: Optional[str] = None, + updated_at: Optional[str] = None, + sample_updated_at: Optional[str] = None, + next_sample_update: Optional[str] = None, + parent_list_ids: Optional[List[str]] = None, + query_version: Optional[str] = None, + metadata: Optional[Metadata] = None, + status: Optional[SegmentStatusResponse] = None, ): - self.id=id - self.name=name - self.contacts_count=contacts_count - self.created_at=created_at - self.updated_at=updated_at - self.sample_updated_at=sample_updated_at - self.next_sample_update=next_sample_update - self.parent_list_ids=parent_list_ids - self.query_version=query_version - self.metadata=metadata - self.status=status + self.id = id + self.name = name + self.contacts_count = contacts_count + self.created_at = created_at + self.updated_at = updated_at + self.sample_updated_at = sample_updated_at + self.next_sample_update = next_sample_update + self.parent_list_ids = parent_list_ids + self.query_version = query_version + self.metadata = metadata + self.status = status def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "name": self.name, - "contacts_count": self.contacts_count, - "created_at": self.created_at, - "updated_at": self.updated_at, - "sample_updated_at": self.sample_updated_at, - "next_sample_update": self.next_sample_update, - "parent_list_ids": self.parent_list_ids, - "query_version": self.query_version, - "_metadata": self.metadata, - "status": self.status - }.items() if value is not None} + "id": self.id, + "name": self.name, + "contacts_count": self.contacts_count, + "created_at": self.created_at, + "updated_at": self.updated_at, + "sample_updated_at": self.sample_updated_at, + "next_sample_update": self.next_sample_update, + "parent_list_ids": self.parent_list_ids, + "query_version": self.query_version, + "_metadata": self.metadata, + "status": self.status, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -57,16 +59,15 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AllSegments200( - id=payload.get('id'), - name=payload.get('name'), - contacts_count=payload.get('contacts_count'), - created_at=payload.get('created_at'), - updated_at=payload.get('updated_at'), - sample_updated_at=payload.get('sample_updated_at'), - next_sample_update=payload.get('next_sample_update'), - parent_list_ids=payload.get('parent_list_ids'), - query_version=payload.get('query_version'), - metadata=payload.get('_metadata'), - status=payload.get('status') - ) - + id=payload.get("id"), + name=payload.get("name"), + contacts_count=payload.get("contacts_count"), + created_at=payload.get("created_at"), + updated_at=payload.get("updated_at"), + sample_updated_at=payload.get("sample_updated_at"), + next_sample_update=payload.get("next_sample_update"), + parent_list_ids=payload.get("parent_list_ids"), + query_version=payload.get("query_version"), + metadata=payload.get("_metadata"), + status=payload.get("status"), + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/contact_response.py b/sendgrid/rest/api/mc_segments_2/v3/models/contact_response.py index 2a8d3d67..58158afc 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/contact_response.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/contact_response.py @@ -1,71 +1,73 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_segments_2.v3.models.contact_response_custom_fields import ContactResponseCustomFields - +from sendgrid.rest.api.mc_segments_2.v3.models.contact_response_custom_fields import ( + ContactResponseCustomFields, +) class ContactResponse: def __init__( - self, - id: Optional[str]=None, - email: Optional[str]=None, - phone_number_id: Optional[str]=None, - external_id: Optional[str]=None, - anonymous_id: Optional[str]=None, - alternate_emails: Optional[List[str]]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - address_line_1: Optional[str]=None, - address_line_2: Optional[str]=None, - city: Optional[str]=None, - state_province_region: Optional[str]=None, - postal_code: Optional[int]=None, - country: Optional[str]=None, - list_ids: Optional[List[str]]=None, - custom_fields: Optional[ContactResponseCustomFields]=None, - segment_ids: Optional[List[str]]=None + self, + id: Optional[str] = None, + email: Optional[str] = None, + phone_number_id: Optional[str] = None, + external_id: Optional[str] = None, + anonymous_id: Optional[str] = None, + alternate_emails: Optional[List[str]] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + address_line_1: Optional[str] = None, + address_line_2: Optional[str] = None, + city: Optional[str] = None, + state_province_region: Optional[str] = None, + postal_code: Optional[int] = None, + country: Optional[str] = None, + list_ids: Optional[List[str]] = None, + custom_fields: Optional[ContactResponseCustomFields] = None, + segment_ids: Optional[List[str]] = None, ): - self.id=id - self.email=email - self.phone_number_id=phone_number_id - self.external_id=external_id - self.anonymous_id=anonymous_id - self.alternate_emails=alternate_emails - self.first_name=first_name - self.last_name=last_name - self.address_line_1=address_line_1 - self.address_line_2=address_line_2 - self.city=city - self.state_province_region=state_province_region - self.postal_code=postal_code - self.country=country - self.list_ids=list_ids - self.custom_fields=custom_fields - self.segment_ids=segment_ids + self.id = id + self.email = email + self.phone_number_id = phone_number_id + self.external_id = external_id + self.anonymous_id = anonymous_id + self.alternate_emails = alternate_emails + self.first_name = first_name + self.last_name = last_name + self.address_line_1 = address_line_1 + self.address_line_2 = address_line_2 + self.city = city + self.state_province_region = state_province_region + self.postal_code = postal_code + self.country = country + self.list_ids = list_ids + self.custom_fields = custom_fields + self.segment_ids = segment_ids def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "email": self.email, - "phone_number_id": self.phone_number_id, - "external_id": self.external_id, - "anonymous_id": self.anonymous_id, - "alternate_emails": self.alternate_emails, - "first_name": self.first_name, - "last_name": self.last_name, - "address_line_1": self.address_line_1, - "address_line_2": self.address_line_2, - "city": self.city, - "state_province_region": self.state_province_region, - "postal_code": self.postal_code, - "country": self.country, - "list_ids": self.list_ids, - "custom_fields": self.custom_fields, - "segment_ids": self.segment_ids - }.items() if value is not None} + "id": self.id, + "email": self.email, + "phone_number_id": self.phone_number_id, + "external_id": self.external_id, + "anonymous_id": self.anonymous_id, + "alternate_emails": self.alternate_emails, + "first_name": self.first_name, + "last_name": self.last_name, + "address_line_1": self.address_line_1, + "address_line_2": self.address_line_2, + "city": self.city, + "state_province_region": self.state_province_region, + "postal_code": self.postal_code, + "country": self.country, + "list_ids": self.list_ids, + "custom_fields": self.custom_fields, + "segment_ids": self.segment_ids, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -74,22 +76,21 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactResponse( - id=payload.get('id'), - email=payload.get('email'), - phone_number_id=payload.get('phone_number_id'), - external_id=payload.get('external_id'), - anonymous_id=payload.get('anonymous_id'), - alternate_emails=payload.get('alternate_emails'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - address_line_1=payload.get('address_line_1'), - address_line_2=payload.get('address_line_2'), - city=payload.get('city'), - state_province_region=payload.get('state_province_region'), - postal_code=payload.get('postal_code'), - country=payload.get('country'), - list_ids=payload.get('list_ids'), - custom_fields=payload.get('custom_fields'), - segment_ids=payload.get('segment_ids') - ) - + id=payload.get("id"), + email=payload.get("email"), + phone_number_id=payload.get("phone_number_id"), + external_id=payload.get("external_id"), + anonymous_id=payload.get("anonymous_id"), + alternate_emails=payload.get("alternate_emails"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + address_line_1=payload.get("address_line_1"), + address_line_2=payload.get("address_line_2"), + city=payload.get("city"), + state_province_region=payload.get("state_province_region"), + postal_code=payload.get("postal_code"), + country=payload.get("country"), + list_ids=payload.get("list_ids"), + custom_fields=payload.get("custom_fields"), + segment_ids=payload.get("segment_ids"), + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/contact_response_custom_fields.py b/sendgrid/rest/api/mc_segments_2/v3/models/contact_response_custom_fields.py index bd954a85..bd130acd 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/contact_response_custom_fields.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/contact_response_custom_fields.py @@ -1,25 +1,25 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ContactResponseCustomFields: def __init__( - self, - custom_field_name1: Optional[str]=None, - custom_field_name2: Optional[str]=None + self, + custom_field_name1: Optional[str] = None, + custom_field_name2: Optional[str] = None, ): - self.custom_field_name1=custom_field_name1 - self.custom_field_name2=custom_field_name2 + self.custom_field_name1 = custom_field_name1 + self.custom_field_name2 = custom_field_name2 def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "custom_field_name1": self.custom_field_name1, - "custom_field_name2": self.custom_field_name2 - }.items() if value is not None} + "custom_field_name1": self.custom_field_name1, + "custom_field_name2": self.custom_field_name2, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +28,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ContactResponseCustomFields( - custom_field_name1=payload.get('custom_field_name1'), - custom_field_name2=payload.get('custom_field_name2') - ) - + custom_field_name1=payload.get("custom_field_name1"), + custom_field_name2=payload.get("custom_field_name2"), + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/errors_segment_v2.py b/sendgrid/rest/api/mc_segments_2/v3/models/errors_segment_v2.py index bb8cf28a..d71c9acf 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/errors_segment_v2.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/errors_segment_v2.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_segments_2.v3.models.errors_segment_v2_errors_inner import ErrorsSegmentV2ErrorsInner - +from sendgrid.rest.api.mc_segments_2.v3.models.errors_segment_v2_errors_inner import ( + ErrorsSegmentV2ErrorsInner, +) class ErrorsSegmentV2: - def __init__( - self, - errors: Optional[List[ErrorsSegmentV2ErrorsInner]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[ErrorsSegmentV2ErrorsInner]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorsSegmentV2( - errors=payload.get('errors') - ) - + return ErrorsSegmentV2(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/errors_segment_v2_errors_inner.py b/sendgrid/rest/api/mc_segments_2/v3/models/errors_segment_v2_errors_inner.py index 11502dcd..685306b0 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/errors_segment_v2_errors_inner.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/errors_segment_v2_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorsSegmentV2ErrorsInner: - def __init__( - self, - field: Optional[str]=None, - message: Optional[str]=None - ): - self.field=field - self.message=message + def __init__(self, field: Optional[str] = None, message: Optional[str] = None): + self.field = field + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "field": self.field, - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"field": self.field, "message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorsSegmentV2ErrorsInner( - field=payload.get('field'), - message=payload.get('message') - ) - + field=payload.get("field"), message=payload.get("message") + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/metadata.py b/sendgrid/rest/api/mc_segments_2/v3/models/metadata.py index 88263186..3281a432 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/metadata.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/metadata.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class Metadata: def __init__( - self, - prev: Optional[str]=None, - var_self: Optional[str]=None, - next: Optional[str]=None, - count: Optional[int]=None + self, + prev: Optional[str] = None, + var_self: Optional[str] = None, + next: Optional[str] = None, + count: Optional[int] = None, ): - self.prev=prev - self.var_self=var_self - self.next=next - self.count=count + self.prev = prev + self.var_self = var_self + self.next = next + self.count = count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "prev": self.prev, - "self": self.var_self, - "next": self.next, - "count": self.count - }.items() if value is not None} + "prev": self.prev, + "self": self.var_self, + "next": self.next, + "count": self.count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Metadata( - prev=payload.get('prev'), - var_self=payload.get('self'), - next=payload.get('next'), - count=payload.get('count') - ) - + prev=payload.get("prev"), + var_self=payload.get("self"), + next=payload.get("next"), + count=payload.get("count"), + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/segment2xx.py b/sendgrid/rest/api/mc_segments_2/v3/models/segment2xx.py index 677c3793..549068c5 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/segment2xx.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/segment2xx.py @@ -1,66 +1,68 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_segments_2.v3.models.contact_response import ContactResponse -from sendgrid.rest.api.mc_segments_2.v3.models.segment_status_response import SegmentStatusResponse - +from sendgrid.rest.api.mc_segments_2.v3.models.segment_status_response import ( + SegmentStatusResponse, +) class Segment2xx: def __init__( - self, - id: Optional[str]=None, - name: Optional[str]=None, - query_dsl: Optional[str]=None, - contacts_count: Optional[int]=None, - contacts_sample: Optional[List[ContactResponse]]=None, - created_at: Optional[str]=None, - updated_at: Optional[str]=None, - sample_updated_at: Optional[str]=None, - next_sample_update: Optional[str]=None, - parent_list_ids: Optional[List[str]]=None, - query_version: Optional[str]=None, - status: Optional[SegmentStatusResponse]=None, - refreshes_used: Optional[int]=None, - max_refreshes: Optional[int]=None, - last_refreshed_at: Optional[str]=None + self, + id: Optional[str] = None, + name: Optional[str] = None, + query_dsl: Optional[str] = None, + contacts_count: Optional[int] = None, + contacts_sample: Optional[List[ContactResponse]] = None, + created_at: Optional[str] = None, + updated_at: Optional[str] = None, + sample_updated_at: Optional[str] = None, + next_sample_update: Optional[str] = None, + parent_list_ids: Optional[List[str]] = None, + query_version: Optional[str] = None, + status: Optional[SegmentStatusResponse] = None, + refreshes_used: Optional[int] = None, + max_refreshes: Optional[int] = None, + last_refreshed_at: Optional[str] = None, ): - self.id=id - self.name=name - self.query_dsl=query_dsl - self.contacts_count=contacts_count - self.contacts_sample=contacts_sample - self.created_at=created_at - self.updated_at=updated_at - self.sample_updated_at=sample_updated_at - self.next_sample_update=next_sample_update - self.parent_list_ids=parent_list_ids - self.query_version=query_version - self.status=status - self.refreshes_used=refreshes_used - self.max_refreshes=max_refreshes - self.last_refreshed_at=last_refreshed_at + self.id = id + self.name = name + self.query_dsl = query_dsl + self.contacts_count = contacts_count + self.contacts_sample = contacts_sample + self.created_at = created_at + self.updated_at = updated_at + self.sample_updated_at = sample_updated_at + self.next_sample_update = next_sample_update + self.parent_list_ids = parent_list_ids + self.query_version = query_version + self.status = status + self.refreshes_used = refreshes_used + self.max_refreshes = max_refreshes + self.last_refreshed_at = last_refreshed_at def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "name": self.name, - "query_dsl": self.query_dsl, - "contacts_count": self.contacts_count, - "contacts_sample": self.contacts_sample, - "created_at": self.created_at, - "updated_at": self.updated_at, - "sample_updated_at": self.sample_updated_at, - "next_sample_update": self.next_sample_update, - "parent_list_ids": self.parent_list_ids, - "query_version": self.query_version, - "status": self.status, - "refreshes_used": self.refreshes_used, - "max_refreshes": self.max_refreshes, - "last_refreshed_at": self.last_refreshed_at - }.items() if value is not None} + "id": self.id, + "name": self.name, + "query_dsl": self.query_dsl, + "contacts_count": self.contacts_count, + "contacts_sample": self.contacts_sample, + "created_at": self.created_at, + "updated_at": self.updated_at, + "sample_updated_at": self.sample_updated_at, + "next_sample_update": self.next_sample_update, + "parent_list_ids": self.parent_list_ids, + "query_version": self.query_version, + "status": self.status, + "refreshes_used": self.refreshes_used, + "max_refreshes": self.max_refreshes, + "last_refreshed_at": self.last_refreshed_at, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -69,20 +71,19 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Segment2xx( - id=payload.get('id'), - name=payload.get('name'), - query_dsl=payload.get('query_dsl'), - contacts_count=payload.get('contacts_count'), - contacts_sample=payload.get('contacts_sample'), - created_at=payload.get('created_at'), - updated_at=payload.get('updated_at'), - sample_updated_at=payload.get('sample_updated_at'), - next_sample_update=payload.get('next_sample_update'), - parent_list_ids=payload.get('parent_list_ids'), - query_version=payload.get('query_version'), - status=payload.get('status'), - refreshes_used=payload.get('refreshes_used'), - max_refreshes=payload.get('max_refreshes'), - last_refreshed_at=payload.get('last_refreshed_at') - ) - + id=payload.get("id"), + name=payload.get("name"), + query_dsl=payload.get("query_dsl"), + contacts_count=payload.get("contacts_count"), + contacts_sample=payload.get("contacts_sample"), + created_at=payload.get("created_at"), + updated_at=payload.get("updated_at"), + sample_updated_at=payload.get("sample_updated_at"), + next_sample_update=payload.get("next_sample_update"), + parent_list_ids=payload.get("parent_list_ids"), + query_version=payload.get("query_version"), + status=payload.get("status"), + refreshes_used=payload.get("refreshes_used"), + max_refreshes=payload.get("max_refreshes"), + last_refreshed_at=payload.get("last_refreshed_at"), + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/segment_error.py b/sendgrid/rest/api/mc_segments_2/v3/models/segment_error.py index 92b0ba6f..8243f2bf 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/segment_error.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/segment_error.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SegmentError: - def __init__( - self, - error: Optional[str]=None - ): - self.error=error + def __init__(self, error: Optional[str] = None): + self.error = error def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "error": self.error - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"error": self.error}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SegmentError( - error=payload.get('error') - ) - + return SegmentError(error=payload.get("error")) diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/segment_refresh202.py b/sendgrid/rest/api/mc_segments_2/v3/models/segment_refresh202.py index a956bd9f..7922c8f2 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/segment_refresh202.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/segment_refresh202.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SegmentRefresh202: - def __init__( - self, - job_id: Optional[str]=None - ): - self.job_id=job_id + def __init__(self, job_id: Optional[str] = None): + self.job_id = job_id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "job_id": self.job_id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"job_id": self.job_id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SegmentRefresh202( - job_id=payload.get('job_id') - ) - + return SegmentRefresh202(job_id=payload.get("job_id")) diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/segment_refresh_request.py b/sendgrid/rest/api/mc_segments_2/v3/models/segment_refresh_request.py index ca65a8be..13d600a6 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/segment_refresh_request.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/segment_refresh_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SegmentRefreshRequest: - def __init__( - self, - user_time_zone: Optional[str]=None - ): - self.user_time_zone=user_time_zone + def __init__(self, user_time_zone: Optional[str] = None): + self.user_time_zone = user_time_zone def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "user_time_zone": self.user_time_zone - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"user_time_zone": self.user_time_zone}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SegmentRefreshRequest( - user_time_zone=payload.get('user_time_zone') - ) - + return SegmentRefreshRequest(user_time_zone=payload.get("user_time_zone")) diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/segment_status_response.py b/sendgrid/rest/api/mc_segments_2/v3/models/segment_status_response.py index 69e5cfe7..8cd149ee 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/segment_status_response.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/segment_status_response.py @@ -1,25 +1,25 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SegmentStatusResponse: def __init__( - self, - query_validation: Optional[str]=None, - error_message: Optional[str]=None + self, + query_validation: Optional[str] = None, + error_message: Optional[str] = None, ): - self.query_validation=query_validation - self.error_message=error_message + self.query_validation = query_validation + self.error_message = error_message def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "query_validation": self.query_validation, - "error_message": self.error_message - }.items() if value is not None} + "query_validation": self.query_validation, + "error_message": self.error_message, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +28,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SegmentStatusResponse( - query_validation=payload.get('query_validation'), - error_message=payload.get('error_message') - ) - + query_validation=payload.get("query_validation"), + error_message=payload.get("error_message"), + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/segment_update.py b/sendgrid/rest/api/mc_segments_2/v3/models/segment_update.py index 53cb031a..2ce4a38b 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/segment_update.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/segment_update.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SegmentUpdate: - def __init__( - self, - name: Optional[str]=None, - query_dsl: Optional[str]=None - ): - self.name=name - self.query_dsl=query_dsl + def __init__(self, name: Optional[str] = None, query_dsl: Optional[str] = None): + self.name = name + self.query_dsl = query_dsl def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name, - "query_dsl": self.query_dsl - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name, "query_dsl": self.query_dsl}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SegmentUpdate( - name=payload.get('name'), - query_dsl=payload.get('query_dsl') - ) - + name=payload.get("name"), query_dsl=payload.get("query_dsl") + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/models/segment_write_v2.py b/sendgrid/rest/api/mc_segments_2/v3/models/segment_write_v2.py index fcfc7d6c..1faaa3cd 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/models/segment_write_v2.py +++ b/sendgrid/rest/api/mc_segments_2/v3/models/segment_write_v2.py @@ -1,28 +1,28 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SegmentWriteV2: def __init__( - self, - name: Optional[str]=None, - parent_list_ids: Optional[List[str]]=None, - query_dsl: Optional[str]=None + self, + name: Optional[str] = None, + parent_list_ids: Optional[List[str]] = None, + query_dsl: Optional[str] = None, ): - self.name=name - self.parent_list_ids=parent_list_ids - self.query_dsl=query_dsl + self.name = name + self.parent_list_ids = parent_list_ids + self.query_dsl = query_dsl def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "parent_list_ids": self.parent_list_ids, - "query_dsl": self.query_dsl - }.items() if value is not None} + "name": self.name, + "parent_list_ids": self.parent_list_ids, + "query_dsl": self.query_dsl, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SegmentWriteV2( - name=payload.get('name'), - parent_list_ids=payload.get('parent_list_ids'), - query_dsl=payload.get('query_dsl') - ) - + name=payload.get("name"), + parent_list_ids=payload.get("parent_list_ids"), + query_dsl=payload.get("query_dsl"), + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/refresh_segment.py b/sendgrid/rest/api/mc_segments_2/v3/refresh_segment.py index 295c28e8..435c698f 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/refresh_segment.py +++ b/sendgrid/rest/api/mc_segments_2/v3/refresh_segment.py @@ -12,52 +12,49 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field -from typing_extensions import Annotated -from sendgrid.rest.api.mc_segments_2.v3.models.segment_refresh202 import SegmentRefresh202 -from sendgrid.rest.api.mc_segments_2.v3.models.segment_refresh_request import SegmentRefreshRequest +from sendgrid.rest.api.mc_segments_2.v3.models.segment_refresh_request import ( + SegmentRefreshRequest, +) + class RefreshSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - segment_id: str, - segment_refresh_request: Optional[SegmentRefreshRequest] = None, - + segment_id: str, + segment_refresh_request: Optional[SegmentRefreshRequest] = None, ): - path='/v3/marketing/segments/2.0/refresh/{segment_id}' + path = "/v3/marketing/segments/2.0/refresh/{segment_id}" path = path.format( - segment_id=segment_id, + segment_id=segment_id, ) data = None if segment_refresh_request: data = segment_refresh_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_segments_2/v3/update_segment.py b/sendgrid/rest/api/mc_segments_2/v3/update_segment.py index f9435516..bf3ec0ce 100644 --- a/sendgrid/rest/api/mc_segments_2/v3/update_segment.py +++ b/sendgrid/rest/api/mc_segments_2/v3/update_segment.py @@ -12,52 +12,48 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr from typing import Optional -from sendgrid.rest.api.mc_segments_2.v3.models.segment2xx import Segment2xx from sendgrid.rest.api.mc_segments_2.v3.models.segment_update import SegmentUpdate + class UpdateSegment: def __init__(self, client) -> None: self.client = client - + def send( self, - segment_id: str, - segment_update: Optional[SegmentUpdate] = None, - + segment_id: str, + segment_update: Optional[SegmentUpdate] = None, ): - path='/v3/marketing/segments/2.0/{segment_id}' + path = "/v3/marketing/segments/2.0/{segment_id}" path = path.format( - segment_id=segment_id, + segment_id=segment_id, ) data = None if segment_update: data = segment_update.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_senders/v3/__init__.py b/sendgrid/rest/api/mc_senders/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/mc_senders/v3/__init__.py +++ b/sendgrid/rest/api/mc_senders/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/mc_senders/v3/create_sender.py b/sendgrid/rest/api/mc_senders/v3/create_sender.py index 77bc4415..a937648c 100644 --- a/sendgrid/rest/api/mc_senders/v3/create_sender.py +++ b/sendgrid/rest/api/mc_senders/v3/create_sender.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_senders.v3.models.create_sender_request import CreateSenderRequest -from sendgrid.rest.api.mc_senders.v3.models.sender import Sender +from sendgrid.rest.api.mc_senders.v3.models.create_sender_request import ( + CreateSenderRequest, +) + class CreateSender: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - create_sender_request: Optional[CreateSenderRequest] = None, - + on_behalf_of: Optional[str] = None, + create_sender_request: Optional[CreateSenderRequest] = None, ): - path='/v3/marketing/senders' + path = "/v3/marketing/senders" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if create_sender_request: data = create_sender_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_senders/v3/delete_sender.py b/sendgrid/rest/api/mc_senders/v3/delete_sender.py index b8d23dc8..9343a8af 100644 --- a/sendgrid/rest/api/mc_senders/v3/delete_sender.py +++ b/sendgrid/rest/api/mc_senders/v3/delete_sender.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteSender: def __init__(self, client) -> None: self.client = client - + def send( self, - id: int, - on_behalf_of: Optional[str] = None, - + id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/marketing/senders/{id}' + path = "/v3/marketing/senders/{id}" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_senders/v3/get_sender.py b/sendgrid/rest/api/mc_senders/v3/get_sender.py index 0069dd75..0df2bd6f 100644 --- a/sendgrid/rest/api/mc_senders/v3/get_sender.py +++ b/sendgrid/rest/api/mc_senders/v3/get_sender.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_senders.v3.models.sender import Sender + class GetSender: def __init__(self, client) -> None: self.client = client - + def send( self, - id: int, - on_behalf_of: Optional[str] = None, - + id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/marketing/senders/{id}' + path = "/v3/marketing/senders/{id}" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_senders/v3/list_sender.py b/sendgrid/rest/api/mc_senders/v3/list_sender.py index e541c08d..12fd0548 100644 --- a/sendgrid/rest/api/mc_senders/v3/list_sender.py +++ b/sendgrid/rest/api/mc_senders/v3/list_sender.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_senders.v3.models.list_sender200_response import ListSender200Response + class ListSender: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/marketing/senders' + path = "/v3/marketing/senders" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_senders/v3/models/__init__.py b/sendgrid/rest/api/mc_senders/v3/models/__init__.py index c70eec95..02d56189 100644 --- a/sendgrid/rest/api/mc_senders/v3/models/__init__.py +++ b/sendgrid/rest/api/mc_senders/v3/models/__init__.py @@ -11,17 +11,40 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.mc_senders.v3.models.create_sender_request import CreateSenderRequest -from sendgrid.rest.api.mc_senders.v3.models.create_sender_request_from import CreateSenderRequestFrom -from sendgrid.rest.api.mc_senders.v3.models.create_sender_request_reply_to import CreateSenderRequestReplyTo +from sendgrid.rest.api.mc_senders.v3.models.create_sender_request import ( + CreateSenderRequest, +) +from sendgrid.rest.api.mc_senders.v3.models.create_sender_request_from import ( + CreateSenderRequestFrom, +) +from sendgrid.rest.api.mc_senders.v3.models.create_sender_request_reply_to import ( + CreateSenderRequestReplyTo, +) from sendgrid.rest.api.mc_senders.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.mc_senders.v3.models.error_response_errors_inner import ErrorResponseErrorsInner -from sendgrid.rest.api.mc_senders.v3.models.list_sender200_response import ListSender200Response +from sendgrid.rest.api.mc_senders.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) +from sendgrid.rest.api.mc_senders.v3.models.list_sender200_response import ( + ListSender200Response, +) from sendgrid.rest.api.mc_senders.v3.models.sender import Sender from sendgrid.rest.api.mc_senders.v3.models.sender_request import SenderRequest from sendgrid.rest.api.mc_senders.v3.models.sender_request_from import SenderRequestFrom -from sendgrid.rest.api.mc_senders.v3.models.sender_request_reply_to import SenderRequestReplyTo -__all__ = [ 'CreateSenderRequest', 'CreateSenderRequestFrom', 'CreateSenderRequestReplyTo', 'ErrorResponse', 'ErrorResponseErrorsInner', 'ListSender200Response', 'Sender', 'SenderRequest', 'SenderRequestFrom', 'SenderRequestReplyTo' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.mc_senders.v3.models.sender_request_reply_to import ( + SenderRequestReplyTo, +) + +__all__ = [ + "CreateSenderRequest", + "CreateSenderRequestFrom", + "CreateSenderRequestReplyTo", + "ErrorResponse", + "ErrorResponseErrorsInner", + "ListSender200Response", + "Sender", + "SenderRequest", + "SenderRequestFrom", + "SenderRequestReplyTo", +] +# Testing code diff --git a/sendgrid/rest/api/mc_senders/v3/models/create_sender_request.py b/sendgrid/rest/api/mc_senders/v3/models/create_sender_request.py index 0ae5aaf7..47b08cdc 100644 --- a/sendgrid/rest/api/mc_senders/v3/models/create_sender_request.py +++ b/sendgrid/rest/api/mc_senders/v3/models/create_sender_request.py @@ -1,48 +1,52 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_senders.v3.models.create_sender_request_from import CreateSenderRequestFrom -from sendgrid.rest.api.mc_senders.v3.models.create_sender_request_reply_to import CreateSenderRequestReplyTo - +from sendgrid.rest.api.mc_senders.v3.models.create_sender_request_from import ( + CreateSenderRequestFrom, +) +from sendgrid.rest.api.mc_senders.v3.models.create_sender_request_reply_to import ( + CreateSenderRequestReplyTo, +) class CreateSenderRequest: def __init__( - self, - nickname: Optional[str]=None, - var_from: Optional[CreateSenderRequestFrom]=None, - reply_to: Optional[CreateSenderRequestReplyTo]=None, - address: Optional[str]=None, - address_2: Optional[str]=None, - city: Optional[str]=None, - state: Optional[str]=None, - zip: Optional[str]=None, - country: Optional[str]=None + self, + nickname: Optional[str] = None, + var_from: Optional[CreateSenderRequestFrom] = None, + reply_to: Optional[CreateSenderRequestReplyTo] = None, + address: Optional[str] = None, + address_2: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + zip: Optional[str] = None, + country: Optional[str] = None, ): - self.nickname=nickname - self.var_from=var_from - self.reply_to=reply_to - self.address=address - self.address_2=address_2 - self.city=city - self.state=state - self.zip=zip - self.country=country + self.nickname = nickname + self.var_from = var_from + self.reply_to = reply_to + self.address = address + self.address_2 = address_2 + self.city = city + self.state = state + self.zip = zip + self.country = country def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "nickname": self.nickname, - "from": self.var_from, - "reply_to": self.reply_to, - "address": self.address, - "address_2": self.address_2, - "city": self.city, - "state": self.state, - "zip": self.zip, - "country": self.country - }.items() if value is not None} + "nickname": self.nickname, + "from": self.var_from, + "reply_to": self.reply_to, + "address": self.address, + "address_2": self.address_2, + "city": self.city, + "state": self.state, + "zip": self.zip, + "country": self.country, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -51,14 +55,13 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateSenderRequest( - nickname=payload.get('nickname'), - var_from=payload.get('from'), - reply_to=payload.get('reply_to'), - address=payload.get('address'), - address_2=payload.get('address_2'), - city=payload.get('city'), - state=payload.get('state'), - zip=payload.get('zip'), - country=payload.get('country') - ) - + nickname=payload.get("nickname"), + var_from=payload.get("from"), + reply_to=payload.get("reply_to"), + address=payload.get("address"), + address_2=payload.get("address_2"), + city=payload.get("city"), + state=payload.get("state"), + zip=payload.get("zip"), + country=payload.get("country"), + ) diff --git a/sendgrid/rest/api/mc_senders/v3/models/create_sender_request_from.py b/sendgrid/rest/api/mc_senders/v3/models/create_sender_request_from.py index b0bde5bc..f5216e8b 100644 --- a/sendgrid/rest/api/mc_senders/v3/models/create_sender_request_from.py +++ b/sendgrid/rest/api/mc_senders/v3/models/create_sender_request_from.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateSenderRequestFrom: - def __init__( - self, - email: Optional[str]=None, - name: Optional[str]=None - ): - self.email=email - self.name=name + def __init__(self, email: Optional[str] = None, name: Optional[str] = None): + self.email = email + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email, - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email, "name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateSenderRequestFrom( - email=payload.get('email'), - name=payload.get('name') - ) - + email=payload.get("email"), name=payload.get("name") + ) diff --git a/sendgrid/rest/api/mc_senders/v3/models/create_sender_request_reply_to.py b/sendgrid/rest/api/mc_senders/v3/models/create_sender_request_reply_to.py index aafaf26c..0ce7c479 100644 --- a/sendgrid/rest/api/mc_senders/v3/models/create_sender_request_reply_to.py +++ b/sendgrid/rest/api/mc_senders/v3/models/create_sender_request_reply_to.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateSenderRequestReplyTo: - def __init__( - self, - email: Optional[str]=None, - name: Optional[str]=None - ): - self.email=email - self.name=name + def __init__(self, email: Optional[str] = None, name: Optional[str] = None): + self.email = email + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email, - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email, "name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateSenderRequestReplyTo( - email=payload.get('email'), - name=payload.get('name') - ) - + email=payload.get("email"), name=payload.get("name") + ) diff --git a/sendgrid/rest/api/mc_senders/v3/models/error_response.py b/sendgrid/rest/api/mc_senders/v3/models/error_response.py index 9d1699c4..36f3b201 100644 --- a/sendgrid/rest/api/mc_senders/v3/models/error_response.py +++ b/sendgrid/rest/api/mc_senders/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_senders.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.mc_senders.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/mc_senders/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/mc_senders/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/mc_senders/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/mc_senders/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/mc_senders/v3/models/list_sender200_response.py b/sendgrid/rest/api/mc_senders/v3/models/list_sender200_response.py index d71c2c3b..ab0ccec9 100644 --- a/sendgrid/rest/api/mc_senders/v3/models/list_sender200_response.py +++ b/sendgrid/rest/api/mc_senders/v3/models/list_sender200_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_senders.v3.models.sender import Sender - class ListSender200Response: - def __init__( - self, - results: Optional[List[Sender]]=None - ): - self.results=results + def __init__(self, results: Optional[List[Sender]] = None): + self.results = results def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "results": self.results - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"results": self.results}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListSender200Response( - results=payload.get('results') - ) - + return ListSender200Response(results=payload.get("results")) diff --git a/sendgrid/rest/api/mc_senders/v3/models/sender.py b/sendgrid/rest/api/mc_senders/v3/models/sender.py index 84c85f72..bbf45cde 100644 --- a/sendgrid/rest/api/mc_senders/v3/models/sender.py +++ b/sendgrid/rest/api/mc_senders/v3/models/sender.py @@ -1,63 +1,67 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_senders.v3.models.create_sender_request_from import CreateSenderRequestFrom -from sendgrid.rest.api.mc_senders.v3.models.create_sender_request_reply_to import CreateSenderRequestReplyTo - +from sendgrid.rest.api.mc_senders.v3.models.create_sender_request_from import ( + CreateSenderRequestFrom, +) +from sendgrid.rest.api.mc_senders.v3.models.create_sender_request_reply_to import ( + CreateSenderRequestReplyTo, +) class Sender: def __init__( - self, - id: Optional[int]=None, - nickname: Optional[str]=None, - var_from: Optional[CreateSenderRequestFrom]=None, - reply_to: Optional[CreateSenderRequestReplyTo]=None, - address: Optional[str]=None, - address_2: Optional[str]=None, - city: Optional[str]=None, - state: Optional[str]=None, - zip: Optional[str]=None, - country: Optional[str]=None, - verified: Optional[bool]=None, - locked: Optional[bool]=None, - updated_at: Optional[int]=None, - created_at: Optional[int]=None + self, + id: Optional[int] = None, + nickname: Optional[str] = None, + var_from: Optional[CreateSenderRequestFrom] = None, + reply_to: Optional[CreateSenderRequestReplyTo] = None, + address: Optional[str] = None, + address_2: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + zip: Optional[str] = None, + country: Optional[str] = None, + verified: Optional[bool] = None, + locked: Optional[bool] = None, + updated_at: Optional[int] = None, + created_at: Optional[int] = None, ): - self.id=id - self.nickname=nickname - self.var_from=var_from - self.reply_to=reply_to - self.address=address - self.address_2=address_2 - self.city=city - self.state=state - self.zip=zip - self.country=country - self.verified=verified - self.locked=locked - self.updated_at=updated_at - self.created_at=created_at + self.id = id + self.nickname = nickname + self.var_from = var_from + self.reply_to = reply_to + self.address = address + self.address_2 = address_2 + self.city = city + self.state = state + self.zip = zip + self.country = country + self.verified = verified + self.locked = locked + self.updated_at = updated_at + self.created_at = created_at def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "nickname": self.nickname, - "from": self.var_from, - "reply_to": self.reply_to, - "address": self.address, - "address_2": self.address_2, - "city": self.city, - "state": self.state, - "zip": self.zip, - "country": self.country, - "verified": self.verified, - "locked": self.locked, - "updated_at": self.updated_at, - "created_at": self.created_at - }.items() if value is not None} + "id": self.id, + "nickname": self.nickname, + "from": self.var_from, + "reply_to": self.reply_to, + "address": self.address, + "address_2": self.address_2, + "city": self.city, + "state": self.state, + "zip": self.zip, + "country": self.country, + "verified": self.verified, + "locked": self.locked, + "updated_at": self.updated_at, + "created_at": self.created_at, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -66,19 +70,18 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Sender( - id=payload.get('id'), - nickname=payload.get('nickname'), - var_from=payload.get('from'), - reply_to=payload.get('reply_to'), - address=payload.get('address'), - address_2=payload.get('address_2'), - city=payload.get('city'), - state=payload.get('state'), - zip=payload.get('zip'), - country=payload.get('country'), - verified=payload.get('verified'), - locked=payload.get('locked'), - updated_at=payload.get('updated_at'), - created_at=payload.get('created_at') - ) - + id=payload.get("id"), + nickname=payload.get("nickname"), + var_from=payload.get("from"), + reply_to=payload.get("reply_to"), + address=payload.get("address"), + address_2=payload.get("address_2"), + city=payload.get("city"), + state=payload.get("state"), + zip=payload.get("zip"), + country=payload.get("country"), + verified=payload.get("verified"), + locked=payload.get("locked"), + updated_at=payload.get("updated_at"), + created_at=payload.get("created_at"), + ) diff --git a/sendgrid/rest/api/mc_senders/v3/models/sender_request.py b/sendgrid/rest/api/mc_senders/v3/models/sender_request.py index af9a1710..32a952e3 100644 --- a/sendgrid/rest/api/mc_senders/v3/models/sender_request.py +++ b/sendgrid/rest/api/mc_senders/v3/models/sender_request.py @@ -1,48 +1,50 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_senders.v3.models.sender_request_from import SenderRequestFrom -from sendgrid.rest.api.mc_senders.v3.models.sender_request_reply_to import SenderRequestReplyTo - +from sendgrid.rest.api.mc_senders.v3.models.sender_request_reply_to import ( + SenderRequestReplyTo, +) class SenderRequest: def __init__( - self, - nickname: Optional[str]=None, - var_from: Optional[SenderRequestFrom]=None, - reply_to: Optional[SenderRequestReplyTo]=None, - address: Optional[str]=None, - address_2: Optional[str]=None, - city: Optional[str]=None, - state: Optional[str]=None, - zip: Optional[str]=None, - country: Optional[str]=None + self, + nickname: Optional[str] = None, + var_from: Optional[SenderRequestFrom] = None, + reply_to: Optional[SenderRequestReplyTo] = None, + address: Optional[str] = None, + address_2: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + zip: Optional[str] = None, + country: Optional[str] = None, ): - self.nickname=nickname - self.var_from=var_from - self.reply_to=reply_to - self.address=address - self.address_2=address_2 - self.city=city - self.state=state - self.zip=zip - self.country=country + self.nickname = nickname + self.var_from = var_from + self.reply_to = reply_to + self.address = address + self.address_2 = address_2 + self.city = city + self.state = state + self.zip = zip + self.country = country def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "nickname": self.nickname, - "from": self.var_from, - "reply_to": self.reply_to, - "address": self.address, - "address_2": self.address_2, - "city": self.city, - "state": self.state, - "zip": self.zip, - "country": self.country - }.items() if value is not None} + "nickname": self.nickname, + "from": self.var_from, + "reply_to": self.reply_to, + "address": self.address, + "address_2": self.address_2, + "city": self.city, + "state": self.state, + "zip": self.zip, + "country": self.country, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -51,14 +53,13 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SenderRequest( - nickname=payload.get('nickname'), - var_from=payload.get('from'), - reply_to=payload.get('reply_to'), - address=payload.get('address'), - address_2=payload.get('address_2'), - city=payload.get('city'), - state=payload.get('state'), - zip=payload.get('zip'), - country=payload.get('country') - ) - + nickname=payload.get("nickname"), + var_from=payload.get("from"), + reply_to=payload.get("reply_to"), + address=payload.get("address"), + address_2=payload.get("address_2"), + city=payload.get("city"), + state=payload.get("state"), + zip=payload.get("zip"), + country=payload.get("country"), + ) diff --git a/sendgrid/rest/api/mc_senders/v3/models/sender_request_from.py b/sendgrid/rest/api/mc_senders/v3/models/sender_request_from.py index 179c1e43..46abfc11 100644 --- a/sendgrid/rest/api/mc_senders/v3/models/sender_request_from.py +++ b/sendgrid/rest/api/mc_senders/v3/models/sender_request_from.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SenderRequestFrom: - def __init__( - self, - email: Optional[str]=None, - name: Optional[str]=None - ): - self.email=email - self.name=name + def __init__(self, email: Optional[str] = None, name: Optional[str] = None): + self.email = email + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email, - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email, "name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -27,8 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SenderRequestFrom( - email=payload.get('email'), - name=payload.get('name') - ) - + return SenderRequestFrom(email=payload.get("email"), name=payload.get("name")) diff --git a/sendgrid/rest/api/mc_senders/v3/models/sender_request_reply_to.py b/sendgrid/rest/api/mc_senders/v3/models/sender_request_reply_to.py index a81c428b..c756e937 100644 --- a/sendgrid/rest/api/mc_senders/v3/models/sender_request_reply_to.py +++ b/sendgrid/rest/api/mc_senders/v3/models/sender_request_reply_to.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SenderRequestReplyTo: - def __init__( - self, - email: Optional[str]=None, - name: Optional[str]=None - ): - self.email=email - self.name=name + def __init__(self, email: Optional[str] = None, name: Optional[str] = None): + self.email = email + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email, - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email, "name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SenderRequestReplyTo( - email=payload.get('email'), - name=payload.get('name') - ) - + email=payload.get("email"), name=payload.get("name") + ) diff --git a/sendgrid/rest/api/mc_senders/v3/reset_sender_verification.py b/sendgrid/rest/api/mc_senders/v3/reset_sender_verification.py index a1cade28..042b4e72 100644 --- a/sendgrid/rest/api/mc_senders/v3/reset_sender_verification.py +++ b/sendgrid/rest/api/mc_senders/v3/reset_sender_verification.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated + class ResetSenderVerification: def __init__(self, client) -> None: self.client = client - + def send( self, - id: int, - on_behalf_of: Optional[str] = None, - + id: int, + on_behalf_of: Optional[str] = None, ): - path='/v3/marketing/senders/{id}/resend_verification' + path = "/v3/marketing/senders/{id}/resend_verification" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='POST', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_senders/v3/update_sender.py b/sendgrid/rest/api/mc_senders/v3/update_sender.py index 12ebad1e..b1f837e1 100644 --- a/sendgrid/rest/api/mc_senders/v3/update_sender.py +++ b/sendgrid/rest/api/mc_senders/v3/update_sender.py @@ -12,59 +12,56 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_senders.v3.models.sender import Sender from sendgrid.rest.api.mc_senders.v3.models.sender_request import SenderRequest + class UpdateSender: def __init__(self, client) -> None: self.client = client - + def send( self, - id: int, - on_behalf_of: Optional[str] = None, - sender_request: Optional[SenderRequest] = None, - + id: int, + on_behalf_of: Optional[str] = None, + sender_request: Optional[SenderRequest] = None, ): - path='/v3/marketing/senders/{id}' + path = "/v3/marketing/senders/{id}" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if sender_request: data = sender_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/__init__.py b/sendgrid/rest/api/mc_singlesends/v3/__init__.py new file mode 100644 index 00000000..46409041 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/__init__.py @@ -0,0 +1 @@ +# TODO diff --git a/sendgrid/rest/api/mc_singlesends/v3/create_single_send.py b/sendgrid/rest/api/mc_singlesends/v3/create_single_send.py new file mode 100644 index 00000000..0f7805ba --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/create_single_send.py @@ -0,0 +1,57 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Single Sends API + The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_request import ( + SinglesendRequest, +) + + +class CreateSingleSend: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + singlesend_request: Optional[SinglesendRequest] = None, + ): + path = "/v3/marketing/singlesends" + + data = None + if singlesend_request: + data = singlesend_request.to_dict() + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/delete_scheduled_single_send.py b/sendgrid/rest/api/mc_singlesends/v3/delete_scheduled_single_send.py new file mode 100644 index 00000000..afd2cf8d --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/delete_scheduled_single_send.py @@ -0,0 +1,52 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Single Sends API + The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + + +class DeleteScheduledSingleSend: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + ): + path = "/v3/marketing/singlesends/{id}/schedule" + path = path.format( + id=id, + ) + + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/delete_single_send.py b/sendgrid/rest/api/mc_singlesends/v3/delete_single_send.py new file mode 100644 index 00000000..d5f13d2f --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/delete_single_send.py @@ -0,0 +1,52 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Single Sends API + The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + + +class DeleteSingleSend: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + ): + path = "/v3/marketing/singlesends/{id}" + path = path.format( + id=id, + ) + + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/delete_single_sends.py b/sendgrid/rest/api/mc_singlesends/v3/delete_single_sends.py new file mode 100644 index 00000000..0fb3cf8f --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/delete_single_sends.py @@ -0,0 +1,52 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Single Sends API + The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import List, Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import List, Optional + + +class DeleteSingleSends: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + ids: Optional[List[str]] = None, + ): + path = "/v3/marketing/singlesends" + + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/duplicate_single_send.py b/sendgrid/rest/api/mc_singlesends/v3/duplicate_single_send.py new file mode 100644 index 00000000..e143ea62 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/duplicate_single_send.py @@ -0,0 +1,61 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Single Sends API + The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.mc_singlesends.v3.models.duplicate_single_send_request import ( + DuplicateSingleSendRequest, +) + + +class DuplicateSingleSend: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + duplicate_single_send_request: Optional[DuplicateSingleSendRequest] = None, + ): + path = "/v3/marketing/singlesends/{id}" + path = path.format( + id=id, + ) + + data = None + if duplicate_single_send_request: + data = duplicate_single_send_request.to_dict() + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/get_single_send.py b/sendgrid/rest/api/mc_singlesends/v3/get_single_send.py new file mode 100644 index 00000000..6f9aa24f --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/get_single_send.py @@ -0,0 +1,52 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Single Sends API + The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + + +class GetSingleSend: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + ): + path = "/v3/marketing/singlesends/{id}" + path = path.format( + id=id, + ) + + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/list_category.py b/sendgrid/rest/api/mc_singlesends/v3/list_category.py new file mode 100644 index 00000000..18d542ab --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/list_category.py @@ -0,0 +1,48 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Single Sends API + The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + + +class ListCategory: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + ): + path = "/v3/marketing/singlesends/categories" + + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/list_single_send.py b/sendgrid/rest/api/mc_singlesends/v3/list_single_send.py new file mode 100644 index 00000000..d8ad87bb --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/list_single_send.py @@ -0,0 +1,53 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Single Sends API + The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class ListSingleSend: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + ): + path = "/v3/marketing/singlesends" + + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/__init__.py b/sendgrid/rest/api/mc_singlesends/v3/models/__init__.py new file mode 100644 index 00000000..297e1ba8 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/__init__.py @@ -0,0 +1,112 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Single Sends API + The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +# import models into model package +from sendgrid.rest.api.mc_singlesends.v3.models.ab_test_summary import AbTestSummary +from sendgrid.rest.api.mc_singlesends.v3.models.duplicate_single_send_request import ( + DuplicateSingleSendRequest, +) +from sendgrid.rest.api.mc_singlesends.v3.models.editor import Editor +from sendgrid.rest.api.mc_singlesends.v3.models.editor1 import Editor1 +from sendgrid.rest.api.mc_singlesends.v3.models.items import Items +from sendgrid.rest.api.mc_singlesends.v3.models.list_category200_response import ( + ListCategory200Response, +) +from sendgrid.rest.api.mc_singlesends.v3.models.list_single_send200_response import ( + ListSingleSend200Response, +) +from sendgrid.rest.api.mc_singlesends.v3.models.list_single_send500_response import ( + ListSingleSend500Response, +) +from sendgrid.rest.api.mc_singlesends.v3.models.list_single_send500_response_errors_inner import ( + ListSingleSend500ResponseErrorsInner, +) +from sendgrid.rest.api.mc_singlesends.v3.models.metadata import Metadata +from sendgrid.rest.api.mc_singlesends.v3.models.schedule_single_send201_response import ( + ScheduleSingleSend201Response, +) +from sendgrid.rest.api.mc_singlesends.v3.models.schedule_single_send_request import ( + ScheduleSingleSendRequest, +) +from sendgrid.rest.api.mc_singlesends.v3.models.search_single_send200_response import ( + SearchSingleSend200Response, +) +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_request import ( + SinglesendRequest, +) +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_request_email_config import ( + SinglesendRequestEmailConfig, +) +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_request_send_to import ( + SinglesendRequestSendTo, +) +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_response import ( + SinglesendResponse, +) +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_response_email_config import ( + SinglesendResponseEmailConfig, +) +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_response_send_to import ( + SinglesendResponseSendTo, +) +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_response_short import ( + SinglesendResponseShort, +) +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_response_warnings_inner import ( + SinglesendResponseWarningsInner, +) +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_schedule import ( + SinglesendSchedule, +) +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_search import ( + SinglesendSearch, +) +from sendgrid.rest.api.mc_singlesends.v3.models.status import Status +from sendgrid.rest.api.mc_singlesends.v3.models.status1 import Status1 +from sendgrid.rest.api.mc_singlesends.v3.models.status2 import Status2 +from sendgrid.rest.api.mc_singlesends.v3.models.status3 import Status3 +from sendgrid.rest.api.mc_singlesends.v3.models.type import Type +from sendgrid.rest.api.mc_singlesends.v3.models.winner_criteria import WinnerCriteria + +__all__ = [ + "AbTestSummary", + "DuplicateSingleSendRequest", + "Editor", + "Editor1", + "Items", + "ListCategory200Response", + "ListSingleSend200Response", + "ListSingleSend500Response", + "ListSingleSend500ResponseErrorsInner", + "Metadata", + "ScheduleSingleSend201Response", + "ScheduleSingleSendRequest", + "SearchSingleSend200Response", + "SinglesendRequest", + "SinglesendRequestEmailConfig", + "SinglesendRequestSendTo", + "SinglesendResponse", + "SinglesendResponseEmailConfig", + "SinglesendResponseSendTo", + "SinglesendResponseShort", + "SinglesendResponseWarningsInner", + "SinglesendSchedule", + "SinglesendSearch", + "Status", + "Status1", + "Status2", + "Status3", + "Type", + "WinnerCriteria", +] +# Testing code diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/ab_test_summary.py b/sendgrid/rest/api/mc_singlesends/v3/models/ab_test_summary.py new file mode 100644 index 00000000..4c1eade4 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/ab_test_summary.py @@ -0,0 +1,55 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_singlesends.v3.models.type import Type +from sendgrid.rest.api.mc_singlesends.v3.models.winner_criteria import WinnerCriteria + + +class AbTestSummary: + def __init__( + self, + type: Optional[Type] = None, + winner_criteria: Optional[WinnerCriteria] = None, + test_percentage: Optional[int] = None, + duration: Optional[str] = None, + winning_template_id: Optional[str] = None, + winner_selected_at: Optional[str] = None, + expiration_date: Optional[str] = None, + ): + self.type = type + self.winner_criteria = winner_criteria + self.test_percentage = test_percentage + self.duration = duration + self.winning_template_id = winning_template_id + self.winner_selected_at = winner_selected_at + self.expiration_date = expiration_date + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "type": self.type, + "winner_criteria": self.winner_criteria, + "test_percentage": self.test_percentage, + "duration": self.duration, + "winning_template_id": self.winning_template_id, + "winner_selected_at": self.winner_selected_at, + "expiration_date": self.expiration_date, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return AbTestSummary( + type=payload.get("type"), + winner_criteria=payload.get("winner_criteria"), + test_percentage=payload.get("test_percentage"), + duration=payload.get("duration"), + winning_template_id=payload.get("winning_template_id"), + winner_selected_at=payload.get("winner_selected_at"), + expiration_date=payload.get("expiration_date"), + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/duplicate_single_send_request.py b/sendgrid/rest/api/mc_singlesends/v3/models/duplicate_single_send_request.py new file mode 100644 index 00000000..8a41fbd2 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/duplicate_single_send_request.py @@ -0,0 +1,22 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class DuplicateSingleSendRequest: + def __init__(self, name: Optional[str] = None): + self.name = name + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"name": self.name}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return DuplicateSingleSendRequest(name=payload.get("name")) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/editor.py b/sendgrid/rest/api/mc_singlesends/v3/models/editor.py new file mode 100644 index 00000000..47b41f47 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/editor.py @@ -0,0 +1,7 @@ +from enum import Enum +from enum import Enum + + +class Editor(Enum): + CODE = "code" + DESIGN = "design" diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/editor1.py b/sendgrid/rest/api/mc_singlesends/v3/models/editor1.py new file mode 100644 index 00000000..a50f81cc --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/editor1.py @@ -0,0 +1,7 @@ +from enum import Enum +from enum import Enum + + +class Editor1(Enum): + CODE = "code" + DESIGN = "design" diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/items.py b/sendgrid/rest/api/mc_singlesends/v3/models/items.py new file mode 100644 index 00000000..ab4d0ae8 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/items.py @@ -0,0 +1,8 @@ +from enum import Enum +from enum import Enum + + +class Items(Enum): + DRAFT = "draft" + SCHEDULED = "scheduled" + TRIGGERED = "triggered" diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/list_category200_response.py b/sendgrid/rest/api/mc_singlesends/v3/models/list_category200_response.py new file mode 100644 index 00000000..bfb8d1b4 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/list_category200_response.py @@ -0,0 +1,22 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class ListCategory200Response: + def __init__(self, categories: Optional[List[str]] = None): + self.categories = categories + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"categories": self.categories}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListCategory200Response(categories=payload.get("categories")) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/list_single_send200_response.py b/sendgrid/rest/api/mc_singlesends/v3/models/list_single_send200_response.py new file mode 100644 index 00000000..e34e759f --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/list_single_send200_response.py @@ -0,0 +1,36 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_singlesends.v3.models.metadata import Metadata +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_response_short import ( + SinglesendResponseShort, +) + + +class ListSingleSend200Response: + def __init__( + self, + result: Optional[List[SinglesendResponseShort]] = None, + metadata: Optional[Metadata] = None, + ): + self.result = result + self.metadata = metadata + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "result": self.result, + "_metadata": self.metadata, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListSingleSend200Response( + result=payload.get("result"), metadata=payload.get("_metadata") + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/list_single_send500_response.py b/sendgrid/rest/api/mc_singlesends/v3/models/list_single_send500_response.py new file mode 100644 index 00000000..926f4f8d --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/list_single_send500_response.py @@ -0,0 +1,27 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_singlesends.v3.models.list_single_send500_response_errors_inner import ( + ListSingleSend500ResponseErrorsInner, +) + + +class ListSingleSend500Response: + def __init__( + self, errors: Optional[List[ListSingleSend500ResponseErrorsInner]] = None + ): + self.errors = errors + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListSingleSend500Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/list_single_send500_response_errors_inner.py b/sendgrid/rest/api/mc_singlesends/v3/models/list_single_send500_response_errors_inner.py new file mode 100644 index 00000000..a45d0d89 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/list_single_send500_response_errors_inner.py @@ -0,0 +1,37 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class ListSingleSend500ResponseErrorsInner: + def __init__( + self, + field: Optional[str] = None, + message: Optional[str] = None, + error_id: Optional[str] = None, + ): + self.field = field + self.message = message + self.error_id = error_id + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "field": self.field, + "message": self.message, + "error_id": self.error_id, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListSingleSend500ResponseErrorsInner( + field=payload.get("field"), + message=payload.get("message"), + error_id=payload.get("error_id"), + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/metadata.py b/sendgrid/rest/api/mc_singlesends/v3/models/metadata.py new file mode 100644 index 00000000..3281a432 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/metadata.py @@ -0,0 +1,41 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class Metadata: + def __init__( + self, + prev: Optional[str] = None, + var_self: Optional[str] = None, + next: Optional[str] = None, + count: Optional[int] = None, + ): + self.prev = prev + self.var_self = var_self + self.next = next + self.count = count + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "prev": self.prev, + "self": self.var_self, + "next": self.next, + "count": self.count, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return Metadata( + prev=payload.get("prev"), + var_self=payload.get("self"), + next=payload.get("next"), + count=payload.get("count"), + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/schedule_single_send201_response.py b/sendgrid/rest/api/mc_singlesends/v3/models/schedule_single_send201_response.py new file mode 100644 index 00000000..287272ef --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/schedule_single_send201_response.py @@ -0,0 +1,28 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_singlesends.v3.models.status import Status + + +class ScheduleSingleSend201Response: + def __init__( + self, send_at: Optional[datetime] = None, status: Optional[Status] = None + ): + self.send_at = send_at + self.status = status + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"send_at": self.send_at, "status": self.status}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ScheduleSingleSend201Response( + send_at=payload.get("send_at"), status=payload.get("status") + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/schedule_single_send_request.py b/sendgrid/rest/api/mc_singlesends/v3/models/schedule_single_send_request.py new file mode 100644 index 00000000..137a3a80 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/schedule_single_send_request.py @@ -0,0 +1,22 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class ScheduleSingleSendRequest: + def __init__(self, send_at: Optional[datetime] = None): + self.send_at = send_at + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"send_at": self.send_at}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ScheduleSingleSendRequest(send_at=payload.get("send_at")) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/search_single_send200_response.py b/sendgrid/rest/api/mc_singlesends/v3/models/search_single_send200_response.py new file mode 100644 index 00000000..63d76a50 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/search_single_send200_response.py @@ -0,0 +1,36 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_singlesends.v3.models.metadata import Metadata +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_response_short import ( + SinglesendResponseShort, +) + + +class SearchSingleSend200Response: + def __init__( + self, + result: Optional[List[SinglesendResponseShort]] = None, + metadata: Optional[Metadata] = None, + ): + self.result = result + self.metadata = metadata + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "result": self.result, + "_metadata": self.metadata, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SearchSingleSend200Response( + result=payload.get("result"), metadata=payload.get("_metadata") + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_request.py b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_request.py new file mode 100644 index 00000000..45e70bcb --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_request.py @@ -0,0 +1,51 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_request_email_config import ( + SinglesendRequestEmailConfig, +) +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_request_send_to import ( + SinglesendRequestSendTo, +) + + +class SinglesendRequest: + def __init__( + self, + name: Optional[str] = None, + categories: Optional[List[str]] = None, + send_at: Optional[datetime] = None, + send_to: Optional[SinglesendRequestSendTo] = None, + email_config: Optional[SinglesendRequestEmailConfig] = None, + ): + self.name = name + self.categories = categories + self.send_at = send_at + self.send_to = send_to + self.email_config = email_config + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "name": self.name, + "categories": self.categories, + "send_at": self.send_at, + "send_to": self.send_to, + "email_config": self.email_config, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SinglesendRequest( + name=payload.get("name"), + categories=payload.get("categories"), + send_at=payload.get("send_at"), + send_to=payload.get("send_to"), + email_config=payload.get("email_config"), + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_request_email_config.py b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_request_email_config.py new file mode 100644 index 00000000..07d0d3b4 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_request_email_config.py @@ -0,0 +1,66 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_singlesends.v3.models.editor import Editor + + +class SinglesendRequestEmailConfig: + def __init__( + self, + subject: Optional[str] = None, + html_content: Optional[str] = None, + plain_content: Optional[str] = None, + generate_plain_content: Optional[bool] = None, + design_id: Optional[str] = None, + editor: Optional[Editor] = None, + suppression_group_id: Optional[int] = None, + custom_unsubscribe_url: Optional[str] = None, + sender_id: Optional[int] = None, + ip_pool: Optional[str] = None, + ): + self.subject = subject + self.html_content = html_content + self.plain_content = plain_content + self.generate_plain_content = generate_plain_content + self.design_id = design_id + self.editor = editor + self.suppression_group_id = suppression_group_id + self.custom_unsubscribe_url = custom_unsubscribe_url + self.sender_id = sender_id + self.ip_pool = ip_pool + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "subject": self.subject, + "html_content": self.html_content, + "plain_content": self.plain_content, + "generate_plain_content": self.generate_plain_content, + "design_id": self.design_id, + "editor": self.editor, + "suppression_group_id": self.suppression_group_id, + "custom_unsubscribe_url": self.custom_unsubscribe_url, + "sender_id": self.sender_id, + "ip_pool": self.ip_pool, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SinglesendRequestEmailConfig( + subject=payload.get("subject"), + html_content=payload.get("html_content"), + plain_content=payload.get("plain_content"), + generate_plain_content=payload.get("generate_plain_content"), + design_id=payload.get("design_id"), + editor=payload.get("editor"), + suppression_group_id=payload.get("suppression_group_id"), + custom_unsubscribe_url=payload.get("custom_unsubscribe_url"), + sender_id=payload.get("sender_id"), + ip_pool=payload.get("ip_pool"), + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_request_send_to.py b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_request_send_to.py new file mode 100644 index 00000000..2669f922 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_request_send_to.py @@ -0,0 +1,37 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class SinglesendRequestSendTo: + def __init__( + self, + list_ids: Optional[List[str]] = None, + segment_ids: Optional[List[str]] = None, + all: Optional[bool] = None, + ): + self.list_ids = list_ids + self.segment_ids = segment_ids + self.all = all + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "list_ids": self.list_ids, + "segment_ids": self.segment_ids, + "all": self.all, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SinglesendRequestSendTo( + list_ids=payload.get("list_ids"), + segment_ids=payload.get("segment_ids"), + all=payload.get("all"), + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response.py b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response.py new file mode 100644 index 00000000..2ec911cb --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response.py @@ -0,0 +1,75 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_response_email_config import ( + SinglesendResponseEmailConfig, +) +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_response_send_to import ( + SinglesendResponseSendTo, +) +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_response_warnings_inner import ( + SinglesendResponseWarningsInner, +) +from sendgrid.rest.api.mc_singlesends.v3.models.status2 import Status2 + + +class SinglesendResponse: + def __init__( + self, + id: Optional[str] = None, + name: Optional[str] = None, + status: Optional[Status2] = None, + categories: Optional[List[str]] = None, + send_at: Optional[datetime] = None, + send_to: Optional[SinglesendResponseSendTo] = None, + updated_at: Optional[datetime] = None, + created_at: Optional[datetime] = None, + email_config: Optional[SinglesendResponseEmailConfig] = None, + warnings: Optional[List[SinglesendResponseWarningsInner]] = None, + ): + self.id = id + self.name = name + self.status = status + self.categories = categories + self.send_at = send_at + self.send_to = send_to + self.updated_at = updated_at + self.created_at = created_at + self.email_config = email_config + self.warnings = warnings + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "id": self.id, + "name": self.name, + "status": self.status, + "categories": self.categories, + "send_at": self.send_at, + "send_to": self.send_to, + "updated_at": self.updated_at, + "created_at": self.created_at, + "email_config": self.email_config, + "warnings": self.warnings, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SinglesendResponse( + id=payload.get("id"), + name=payload.get("name"), + status=payload.get("status"), + categories=payload.get("categories"), + send_at=payload.get("send_at"), + send_to=payload.get("send_to"), + updated_at=payload.get("updated_at"), + created_at=payload.get("created_at"), + email_config=payload.get("email_config"), + warnings=payload.get("warnings"), + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_email_config.py b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_email_config.py new file mode 100644 index 00000000..5896da2d --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_email_config.py @@ -0,0 +1,66 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_singlesends.v3.models.editor1 import Editor1 + + +class SinglesendResponseEmailConfig: + def __init__( + self, + subject: Optional[str] = None, + html_content: Optional[str] = None, + plain_content: Optional[str] = None, + generate_plain_content: Optional[bool] = None, + design_id: Optional[str] = None, + editor: Optional[Editor1] = None, + suppression_group_id: Optional[int] = None, + custom_unsubscribe_url: Optional[str] = None, + sender_id: Optional[int] = None, + ip_pool: Optional[str] = None, + ): + self.subject = subject + self.html_content = html_content + self.plain_content = plain_content + self.generate_plain_content = generate_plain_content + self.design_id = design_id + self.editor = editor + self.suppression_group_id = suppression_group_id + self.custom_unsubscribe_url = custom_unsubscribe_url + self.sender_id = sender_id + self.ip_pool = ip_pool + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "subject": self.subject, + "html_content": self.html_content, + "plain_content": self.plain_content, + "generate_plain_content": self.generate_plain_content, + "design_id": self.design_id, + "editor": self.editor, + "suppression_group_id": self.suppression_group_id, + "custom_unsubscribe_url": self.custom_unsubscribe_url, + "sender_id": self.sender_id, + "ip_pool": self.ip_pool, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SinglesendResponseEmailConfig( + subject=payload.get("subject"), + html_content=payload.get("html_content"), + plain_content=payload.get("plain_content"), + generate_plain_content=payload.get("generate_plain_content"), + design_id=payload.get("design_id"), + editor=payload.get("editor"), + suppression_group_id=payload.get("suppression_group_id"), + custom_unsubscribe_url=payload.get("custom_unsubscribe_url"), + sender_id=payload.get("sender_id"), + ip_pool=payload.get("ip_pool"), + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_send_to.py b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_send_to.py new file mode 100644 index 00000000..c8622cf1 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_send_to.py @@ -0,0 +1,37 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class SinglesendResponseSendTo: + def __init__( + self, + list_ids: Optional[List[str]] = None, + segment_ids: Optional[List[str]] = None, + all: Optional[bool] = None, + ): + self.list_ids = list_ids + self.segment_ids = segment_ids + self.all = all + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "list_ids": self.list_ids, + "segment_ids": self.segment_ids, + "all": self.all, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SinglesendResponseSendTo( + list_ids=payload.get("list_ids"), + segment_ids=payload.get("segment_ids"), + all=payload.get("all"), + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_short.py b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_short.py new file mode 100644 index 00000000..679e8173 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_short.py @@ -0,0 +1,63 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_singlesends.v3.models.ab_test_summary import AbTestSummary +from sendgrid.rest.api.mc_singlesends.v3.models.status3 import Status3 + + +class SinglesendResponseShort: + def __init__( + self, + id: Optional[str] = None, + name: Optional[str] = None, + abtest: Optional[AbTestSummary] = None, + status: Optional[Status3] = None, + categories: Optional[List[str]] = None, + send_at: Optional[datetime] = None, + is_abtest: Optional[bool] = None, + updated_at: Optional[datetime] = None, + created_at: Optional[datetime] = None, + ): + self.id = id + self.name = name + self.abtest = abtest + self.status = status + self.categories = categories + self.send_at = send_at + self.is_abtest = is_abtest + self.updated_at = updated_at + self.created_at = created_at + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "id": self.id, + "name": self.name, + "abtest": self.abtest, + "status": self.status, + "categories": self.categories, + "send_at": self.send_at, + "is_abtest": self.is_abtest, + "updated_at": self.updated_at, + "created_at": self.created_at, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SinglesendResponseShort( + id=payload.get("id"), + name=payload.get("name"), + abtest=payload.get("abtest"), + status=payload.get("status"), + categories=payload.get("categories"), + send_at=payload.get("send_at"), + is_abtest=payload.get("is_abtest"), + updated_at=payload.get("updated_at"), + created_at=payload.get("created_at"), + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_warnings_inner.py b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_warnings_inner.py new file mode 100644 index 00000000..9605dadf --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_response_warnings_inner.py @@ -0,0 +1,37 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class SinglesendResponseWarningsInner: + def __init__( + self, + message: Optional[str] = None, + field: Optional[str] = None, + warning_id: Optional[str] = None, + ): + self.message = message + self.field = field + self.warning_id = warning_id + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "message": self.message, + "field": self.field, + "warning_id": self.warning_id, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SinglesendResponseWarningsInner( + message=payload.get("message"), + field=payload.get("field"), + warning_id=payload.get("warning_id"), + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_schedule.py b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_schedule.py new file mode 100644 index 00000000..7b8d9c9d --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_schedule.py @@ -0,0 +1,28 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_singlesends.v3.models.status1 import Status1 + + +class SinglesendSchedule: + def __init__( + self, send_at: Optional[datetime] = None, status: Optional[Status1] = None + ): + self.send_at = send_at + self.status = status + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"send_at": self.send_at, "status": self.status}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SinglesendSchedule( + send_at=payload.get("send_at"), status=payload.get("status") + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_search.py b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_search.py new file mode 100644 index 00000000..57e55497 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/singlesend_search.py @@ -0,0 +1,38 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.mc_singlesends.v3.models.items import Items + + +class SinglesendSearch: + def __init__( + self, + name: Optional[str] = None, + status: Optional[List[Items]] = None, + categories: Optional[List[str]] = None, + ): + self.name = name + self.status = status + self.categories = categories + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "name": self.name, + "status": self.status, + "categories": self.categories, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SinglesendSearch( + name=payload.get("name"), + status=payload.get("status"), + categories=payload.get("categories"), + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/status.py b/sendgrid/rest/api/mc_singlesends/v3/models/status.py new file mode 100644 index 00000000..53dcf2b5 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/status.py @@ -0,0 +1,6 @@ +from enum import Enum +from enum import Enum + + +class Status(Enum): + SCHEDULED = "scheduled" diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/status1.py b/sendgrid/rest/api/mc_singlesends/v3/models/status1.py new file mode 100644 index 00000000..dcce4640 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/status1.py @@ -0,0 +1,8 @@ +from enum import Enum +from enum import Enum + + +class Status1(Enum): + DRAFT = "draft" + SCHEDULED = "scheduled" + TRIGGERED = "triggered" diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/status2.py b/sendgrid/rest/api/mc_singlesends/v3/models/status2.py new file mode 100644 index 00000000..3386bba9 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/status2.py @@ -0,0 +1,8 @@ +from enum import Enum +from enum import Enum + + +class Status2(Enum): + DRAFT = "draft" + SCHEDULED = "scheduled" + TRIGGERED = "triggered" diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/status3.py b/sendgrid/rest/api/mc_singlesends/v3/models/status3.py new file mode 100644 index 00000000..8e5e9bb9 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/status3.py @@ -0,0 +1,8 @@ +from enum import Enum +from enum import Enum + + +class Status3(Enum): + DRAFT = "draft" + SCHEDULED = "scheduled" + TRIGGERED = "triggered" diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/type.py b/sendgrid/rest/api/mc_singlesends/v3/models/type.py new file mode 100644 index 00000000..7b1db81e --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/type.py @@ -0,0 +1,7 @@ +from enum import Enum +from enum import Enum + + +class Type(Enum): + SUBJECT = "subject" + CONTENT = "content" diff --git a/sendgrid/rest/api/mc_singlesends/v3/models/winner_criteria.py b/sendgrid/rest/api/mc_singlesends/v3/models/winner_criteria.py new file mode 100644 index 00000000..c459d53b --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/models/winner_criteria.py @@ -0,0 +1,8 @@ +from enum import Enum +from enum import Enum + + +class WinnerCriteria(Enum): + OPEN = "open" + CLICK = "click" + MANUAL = "manual" diff --git a/sendgrid/rest/api/mc_singlesends/v3/schedule_single_send.py b/sendgrid/rest/api/mc_singlesends/v3/schedule_single_send.py new file mode 100644 index 00000000..796ebbdc --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/schedule_single_send.py @@ -0,0 +1,61 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Single Sends API + The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.mc_singlesends.v3.models.schedule_single_send_request import ( + ScheduleSingleSendRequest, +) + + +class ScheduleSingleSend: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + schedule_single_send_request: Optional[ScheduleSingleSendRequest] = None, + ): + path = "/v3/marketing/singlesends/{id}/schedule" + path = path.format( + id=id, + ) + + data = None + if schedule_single_send_request: + data = schedule_single_send_request.to_dict() + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/search_single_send.py b/sendgrid/rest/api/mc_singlesends/v3/search_single_send.py new file mode 100644 index 00000000..32caaa69 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/search_single_send.py @@ -0,0 +1,59 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Single Sends API + The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_search import ( + SinglesendSearch, +) + + +class SearchSingleSend: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + singlesend_search: Optional[SinglesendSearch] = None, + ): + path = "/v3/marketing/singlesends/search" + + data = None + if singlesend_search: + data = singlesend_search.to_dict() + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_singlesends/v3/update_single_send.py b/sendgrid/rest/api/mc_singlesends/v3/update_single_send.py new file mode 100644 index 00000000..ee3e5116 --- /dev/null +++ b/sendgrid/rest/api/mc_singlesends/v3/update_single_send.py @@ -0,0 +1,61 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Marketing Campaigns Single Sends API + The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.mc_singlesends.v3.models.singlesend_request import ( + SinglesendRequest, +) + + +class UpdateSingleSend: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + singlesend_request: Optional[SinglesendRequest] = None, + ): + path = "/v3/marketing/singlesends/{id}" + path = path.format( + id=id, + ) + + data = None + if singlesend_request: + data = singlesend_request.to_dict() + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_stats/v3/__init__.py b/sendgrid/rest/api/mc_stats/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/mc_stats/v3/__init__.py +++ b/sendgrid/rest/api/mc_stats/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/mc_stats/v3/export_automation_stat.py b/sendgrid/rest/api/mc_stats/v3/export_automation_stat.py index ff536ac7..38fc48b5 100644 --- a/sendgrid/rest/api/mc_stats/v3/export_automation_stat.py +++ b/sendgrid/rest/api/mc_stats/v3/export_automation_stat.py @@ -12,46 +12,42 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import List, Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import List, Optional -from typing_extensions import Annotated + class ExportAutomationStat: def __init__(self, client) -> None: self.client = client - + def send( self, - ids: Optional[List[str]] = None, - timezone: Optional[str] = None, - + ids: Optional[List[str]] = None, + timezone: Optional[str] = None, ): - path='/v3/marketing/stats/automations/export' + path = "/v3/marketing/stats/automations/export" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_stats/v3/export_single_send_stat.py b/sendgrid/rest/api/mc_stats/v3/export_single_send_stat.py index a38d5ebb..d232a83d 100644 --- a/sendgrid/rest/api/mc_stats/v3/export_single_send_stat.py +++ b/sendgrid/rest/api/mc_stats/v3/export_single_send_stat.py @@ -12,46 +12,42 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import List, Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import List, Optional -from typing_extensions import Annotated + class ExportSingleSendStat: def __init__(self, client) -> None: self.client = client - + def send( self, - ids: Optional[List[str]] = None, - timezone: Optional[str] = None, - + ids: Optional[List[str]] = None, + timezone: Optional[str] = None, ): - path='/v3/marketing/stats/singlesends/export' + path = "/v3/marketing/stats/singlesends/export" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_stats/v3/get_automation_stat.py b/sendgrid/rest/api/mc_stats/v3/get_automation_stat.py index 80392e92..4690cea8 100644 --- a/sendgrid/rest/api/mc_stats/v3/get_automation_stat.py +++ b/sendgrid/rest/api/mc_stats/v3/get_automation_stat.py @@ -12,60 +12,55 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import List, Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from datetime import date -from pydantic import Field, StrictStr from typing import List, Optional -from typing_extensions import Annotated from sendgrid.rest.api.mc_stats.v3.models.aggregated_by import AggregatedBy -from sendgrid.rest.api.mc_stats.v3.models.automations_response import AutomationsResponse from sendgrid.rest.api.mc_stats.v3.models.items import Items + class GetAutomationStat: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - group_by: Optional[List[Items]] = None, - step_ids: Optional[List[str]] = None, - aggregated_by: Optional[AggregatedBy] = None, - start_date: Optional[date] = None, - end_date: Optional[date] = None, - timezone: Optional[str] = None, - page_size: Optional[int] = None, - page_token: Optional[str] = None, - + id: str, + group_by: Optional[List[Items]] = None, + step_ids: Optional[List[str]] = None, + aggregated_by: Optional[AggregatedBy] = None, + start_date: Optional[date] = None, + end_date: Optional[date] = None, + timezone: Optional[str] = None, + page_size: Optional[int] = None, + page_token: Optional[str] = None, ): - path='/v3/marketing/stats/automations/{id}' + path = "/v3/marketing/stats/automations/{id}" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_stats/v3/get_single_send_stat.py b/sendgrid/rest/api/mc_stats/v3/get_single_send_stat.py index 184a2371..2e7ad873 100644 --- a/sendgrid/rest/api/mc_stats/v3/get_single_send_stat.py +++ b/sendgrid/rest/api/mc_stats/v3/get_single_send_stat.py @@ -12,59 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import List, Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from datetime import date -from pydantic import Field, StrictStr from typing import List, Optional -from typing_extensions import Annotated from sendgrid.rest.api.mc_stats.v3.models.aggregated_by import AggregatedBy from sendgrid.rest.api.mc_stats.v3.models.items1 import Items1 -from sendgrid.rest.api.mc_stats.v3.models.singlesends_response import SinglesendsResponse + class GetSingleSendStat: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - aggregated_by: Optional[AggregatedBy] = None, - start_date: Optional[date] = None, - end_date: Optional[date] = None, - timezone: Optional[str] = None, - page_size: Optional[int] = None, - page_token: Optional[str] = None, - group_by: Optional[List[Items1]] = None, - + id: str, + aggregated_by: Optional[AggregatedBy] = None, + start_date: Optional[date] = None, + end_date: Optional[date] = None, + timezone: Optional[str] = None, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + group_by: Optional[List[Items1]] = None, ): - path='/v3/marketing/stats/singlesends/{id}' + path = "/v3/marketing/stats/singlesends/{id}" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_stats/v3/list_automation_stat.py b/sendgrid/rest/api/mc_stats/v3/list_automation_stat.py index abb9bef5..9f9ba940 100644 --- a/sendgrid/rest/api/mc_stats/v3/list_automation_stat.py +++ b/sendgrid/rest/api/mc_stats/v3/list_automation_stat.py @@ -12,48 +12,43 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import List, Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import List, Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_stats.v3.models.automations_response import AutomationsResponse + class ListAutomationStat: def __init__(self, client) -> None: self.client = client - + def send( self, - automation_ids: Optional[List[str]] = None, - page_size: Optional[int] = None, - page_token: Optional[str] = None, - + automation_ids: Optional[List[str]] = None, + page_size: Optional[int] = None, + page_token: Optional[str] = None, ): - path='/v3/marketing/stats/automations' + path = "/v3/marketing/stats/automations" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_stats/v3/list_click_tracking_stat.py b/sendgrid/rest/api/mc_stats/v3/list_click_tracking_stat.py index da3dc265..600543e9 100644 --- a/sendgrid/rest/api/mc_stats/v3/list_click_tracking_stat.py +++ b/sendgrid/rest/api/mc_stats/v3/list_click_tracking_stat.py @@ -12,54 +12,49 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import List, Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import List, Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_stats.v3.models.autmoations_link_stats_response import AutmoationsLinkStatsResponse from sendgrid.rest.api.mc_stats.v3.models.items import Items + class ListClickTrackingStat: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - group_by: Optional[List[Items]] = None, - step_ids: Optional[List[str]] = None, - page_size: Optional[int] = None, - page_token: Optional[str] = None, - + id: str, + group_by: Optional[List[Items]] = None, + step_ids: Optional[List[str]] = None, + page_size: Optional[int] = None, + page_token: Optional[str] = None, ): - path='/v3/marketing/stats/automations/{id}/links' + path = "/v3/marketing/stats/automations/{id}/links" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_stats/v3/list_single_send_stat.py b/sendgrid/rest/api/mc_stats/v3/list_single_send_stat.py index 735a6346..3750f4a4 100644 --- a/sendgrid/rest/api/mc_stats/v3/list_single_send_stat.py +++ b/sendgrid/rest/api/mc_stats/v3/list_single_send_stat.py @@ -12,48 +12,43 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import List, Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import List, Optional -from typing_extensions import Annotated -from sendgrid.rest.api.mc_stats.v3.models.singlesends_response import SinglesendsResponse + class ListSingleSendStat: def __init__(self, client) -> None: self.client = client - + def send( self, - singlesend_ids: Optional[List[str]] = None, - page_size: Optional[int] = None, - page_token: Optional[str] = None, - + singlesend_ids: Optional[List[str]] = None, + page_size: Optional[int] = None, + page_token: Optional[str] = None, ): - path='/v3/marketing/stats/singlesends' + path = "/v3/marketing/stats/singlesends" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_stats/v3/list_single_send_tracking_stat.py b/sendgrid/rest/api/mc_stats/v3/list_single_send_tracking_stat.py index 820ad468..d4d0f34a 100644 --- a/sendgrid/rest/api/mc_stats/v3/list_single_send_tracking_stat.py +++ b/sendgrid/rest/api/mc_stats/v3/list_single_send_tracking_stat.py @@ -12,56 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import List, Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import List, Optional -from typing_extensions import Annotated from sendgrid.rest.api.mc_stats.v3.models.ab_phase_id import AbPhaseId from sendgrid.rest.api.mc_stats.v3.models.items2 import Items2 -from sendgrid.rest.api.mc_stats.v3.models.singlesends_link_stats_response import SinglesendsLinkStatsResponse + class ListSingleSendTrackingStat: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - page_size: Optional[int] = None, - page_token: Optional[str] = None, - group_by: Optional[List[Items2]] = None, - ab_variation_id: Optional[str] = None, - ab_phase_id: Optional[AbPhaseId] = None, - + id: str, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + group_by: Optional[List[Items2]] = None, + ab_variation_id: Optional[str] = None, + ab_phase_id: Optional[AbPhaseId] = None, ): - path='/v3/marketing/stats/singlesends/{id}/links' + path = "/v3/marketing/stats/singlesends/{id}/links" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/mc_stats/v3/models/__init__.py b/sendgrid/rest/api/mc_stats/v3/models/__init__.py index 4e0df64a..eb748dbe 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/__init__.py +++ b/sendgrid/rest/api/mc_stats/v3/models/__init__.py @@ -11,27 +11,68 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.mc_stats.v3.models.ab_phase import AbPhase from sendgrid.rest.api.mc_stats.v3.models.ab_phase1 import AbPhase1 from sendgrid.rest.api.mc_stats.v3.models.ab_phase_id import AbPhaseId from sendgrid.rest.api.mc_stats.v3.models.aggregated_by import AggregatedBy -from sendgrid.rest.api.mc_stats.v3.models.autmoations_link_stats_response import AutmoationsLinkStatsResponse -from sendgrid.rest.api.mc_stats.v3.models.autmoations_link_stats_response_results_inner import AutmoationsLinkStatsResponseResultsInner -from sendgrid.rest.api.mc_stats.v3.models.automations_response import AutomationsResponse -from sendgrid.rest.api.mc_stats.v3.models.automations_response_results_inner import AutomationsResponseResultsInner +from sendgrid.rest.api.mc_stats.v3.models.autmoations_link_stats_response import ( + AutmoationsLinkStatsResponse, +) +from sendgrid.rest.api.mc_stats.v3.models.autmoations_link_stats_response_results_inner import ( + AutmoationsLinkStatsResponseResultsInner, +) +from sendgrid.rest.api.mc_stats.v3.models.automations_response import ( + AutomationsResponse, +) +from sendgrid.rest.api.mc_stats.v3.models.automations_response_results_inner import ( + AutomationsResponseResultsInner, +) from sendgrid.rest.api.mc_stats.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.mc_stats.v3.models.error_response_errors_inner import ErrorResponseErrorsInner +from sendgrid.rest.api.mc_stats.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) from sendgrid.rest.api.mc_stats.v3.models.items import Items from sendgrid.rest.api.mc_stats.v3.models.items1 import Items1 from sendgrid.rest.api.mc_stats.v3.models.items2 import Items2 -from sendgrid.rest.api.mc_stats.v3.models.link_tracking_metadata import LinkTrackingMetadata +from sendgrid.rest.api.mc_stats.v3.models.link_tracking_metadata import ( + LinkTrackingMetadata, +) from sendgrid.rest.api.mc_stats.v3.models.metadata import Metadata from sendgrid.rest.api.mc_stats.v3.models.metrics import Metrics -from sendgrid.rest.api.mc_stats.v3.models.singlesends_link_stats_response import SinglesendsLinkStatsResponse -from sendgrid.rest.api.mc_stats.v3.models.singlesends_link_stats_response_results_inner import SinglesendsLinkStatsResponseResultsInner -from sendgrid.rest.api.mc_stats.v3.models.singlesends_response import SinglesendsResponse -from sendgrid.rest.api.mc_stats.v3.models.singlesends_response_results_inner import SinglesendsResponseResultsInner -__all__ = [ 'AbPhase', 'AbPhase1', 'AbPhaseId', 'AggregatedBy', 'AutmoationsLinkStatsResponse', 'AutmoationsLinkStatsResponseResultsInner', 'AutomationsResponse', 'AutomationsResponseResultsInner', 'ErrorResponse', 'ErrorResponseErrorsInner', 'Items', 'Items1', 'Items2', 'LinkTrackingMetadata', 'Metadata', 'Metrics', 'SinglesendsLinkStatsResponse', 'SinglesendsLinkStatsResponseResultsInner', 'SinglesendsResponse', 'SinglesendsResponseResultsInner' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.mc_stats.v3.models.singlesends_link_stats_response import ( + SinglesendsLinkStatsResponse, +) +from sendgrid.rest.api.mc_stats.v3.models.singlesends_link_stats_response_results_inner import ( + SinglesendsLinkStatsResponseResultsInner, +) +from sendgrid.rest.api.mc_stats.v3.models.singlesends_response import ( + SinglesendsResponse, +) +from sendgrid.rest.api.mc_stats.v3.models.singlesends_response_results_inner import ( + SinglesendsResponseResultsInner, +) + +__all__ = [ + "AbPhase", + "AbPhase1", + "AbPhaseId", + "AggregatedBy", + "AutmoationsLinkStatsResponse", + "AutmoationsLinkStatsResponseResultsInner", + "AutomationsResponse", + "AutomationsResponseResultsInner", + "ErrorResponse", + "ErrorResponseErrorsInner", + "Items", + "Items1", + "Items2", + "LinkTrackingMetadata", + "Metadata", + "Metrics", + "SinglesendsLinkStatsResponse", + "SinglesendsLinkStatsResponseResultsInner", + "SinglesendsResponse", + "SinglesendsResponseResultsInner", +] +# Testing code diff --git a/sendgrid/rest/api/mc_stats/v3/models/ab_phase.py b/sendgrid/rest/api/mc_stats/v3/models/ab_phase.py index d18df834..c41d10eb 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/ab_phase.py +++ b/sendgrid/rest/api/mc_stats/v3/models/ab_phase.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class AbPhase(Enum): - SEND='send' - TEST='test' - ALL='all' - + SEND = "send" + TEST = "test" + ALL = "all" diff --git a/sendgrid/rest/api/mc_stats/v3/models/ab_phase1.py b/sendgrid/rest/api/mc_stats/v3/models/ab_phase1.py index bfa28b59..07ddc95a 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/ab_phase1.py +++ b/sendgrid/rest/api/mc_stats/v3/models/ab_phase1.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class AbPhase1(Enum): - SEND='send' - TEST='test' - ALL='all' - + SEND = "send" + TEST = "test" + ALL = "all" diff --git a/sendgrid/rest/api/mc_stats/v3/models/ab_phase_id.py b/sendgrid/rest/api/mc_stats/v3/models/ab_phase_id.py index 7cbfd1cd..c89ee0d7 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/ab_phase_id.py +++ b/sendgrid/rest/api/mc_stats/v3/models/ab_phase_id.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class AbPhaseId(Enum): - TEST='test' - SEND='send' - + TEST = "test" + SEND = "send" diff --git a/sendgrid/rest/api/mc_stats/v3/models/aggregated_by.py b/sendgrid/rest/api/mc_stats/v3/models/aggregated_by.py index 2cbc5954..2c1b62eb 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/aggregated_by.py +++ b/sendgrid/rest/api/mc_stats/v3/models/aggregated_by.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class AggregatedBy(Enum): - DAY='day' - TOTAL='total' - + DAY = "day" + TOTAL = "total" diff --git a/sendgrid/rest/api/mc_stats/v3/models/autmoations_link_stats_response.py b/sendgrid/rest/api/mc_stats/v3/models/autmoations_link_stats_response.py index 4b7b3af8..76bd1a8c 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/autmoations_link_stats_response.py +++ b/sendgrid/rest/api/mc_stats/v3/models/autmoations_link_stats_response.py @@ -1,30 +1,34 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_stats.v3.models.autmoations_link_stats_response_results_inner import AutmoationsLinkStatsResponseResultsInner -from sendgrid.rest.api.mc_stats.v3.models.link_tracking_metadata import LinkTrackingMetadata - +from sendgrid.rest.api.mc_stats.v3.models.autmoations_link_stats_response_results_inner import ( + AutmoationsLinkStatsResponseResultsInner, +) +from sendgrid.rest.api.mc_stats.v3.models.link_tracking_metadata import ( + LinkTrackingMetadata, +) class AutmoationsLinkStatsResponse: def __init__( - self, - results: Optional[List[AutmoationsLinkStatsResponseResultsInner]]=None, - total_clicks: Optional[int]=None, - metadata: Optional[LinkTrackingMetadata]=None + self, + results: Optional[List[AutmoationsLinkStatsResponseResultsInner]] = None, + total_clicks: Optional[int] = None, + metadata: Optional[LinkTrackingMetadata] = None, ): - self.results=results - self.total_clicks=total_clicks - self.metadata=metadata + self.results = results + self.total_clicks = total_clicks + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "results": self.results, - "total_clicks": self.total_clicks, - "_metadata": self.metadata - }.items() if value is not None} + "results": self.results, + "total_clicks": self.total_clicks, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -33,8 +37,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AutmoationsLinkStatsResponse( - results=payload.get('results'), - total_clicks=payload.get('total_clicks'), - metadata=payload.get('_metadata') - ) - + results=payload.get("results"), + total_clicks=payload.get("total_clicks"), + metadata=payload.get("_metadata"), + ) diff --git a/sendgrid/rest/api/mc_stats/v3/models/autmoations_link_stats_response_results_inner.py b/sendgrid/rest/api/mc_stats/v3/models/autmoations_link_stats_response_results_inner.py index 4cc3b023..4b3b7711 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/autmoations_link_stats_response_results_inner.py +++ b/sendgrid/rest/api/mc_stats/v3/models/autmoations_link_stats_response_results_inner.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AutmoationsLinkStatsResponseResultsInner: def __init__( - self, - url: Optional[str]=None, - url_location: Optional[int]=None, - step_id: Optional[str]=None, - clicks: Optional[int]=None + self, + url: Optional[str] = None, + url_location: Optional[int] = None, + step_id: Optional[str] = None, + clicks: Optional[int] = None, ): - self.url=url - self.url_location=url_location - self.step_id=step_id - self.clicks=clicks + self.url = url + self.url_location = url_location + self.step_id = step_id + self.clicks = clicks def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "url": self.url, - "url_location": self.url_location, - "step_id": self.step_id, - "clicks": self.clicks - }.items() if value is not None} + "url": self.url, + "url_location": self.url_location, + "step_id": self.step_id, + "clicks": self.clicks, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AutmoationsLinkStatsResponseResultsInner( - url=payload.get('url'), - url_location=payload.get('url_location'), - step_id=payload.get('step_id'), - clicks=payload.get('clicks') - ) - + url=payload.get("url"), + url_location=payload.get("url_location"), + step_id=payload.get("step_id"), + clicks=payload.get("clicks"), + ) diff --git a/sendgrid/rest/api/mc_stats/v3/models/automations_response.py b/sendgrid/rest/api/mc_stats/v3/models/automations_response.py index 350612a8..850e359b 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/automations_response.py +++ b/sendgrid/rest/api/mc_stats/v3/models/automations_response.py @@ -1,27 +1,29 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_stats.v3.models.automations_response_results_inner import AutomationsResponseResultsInner +from sendgrid.rest.api.mc_stats.v3.models.automations_response_results_inner import ( + AutomationsResponseResultsInner, +) from sendgrid.rest.api.mc_stats.v3.models.metadata import Metadata - class AutomationsResponse: def __init__( - self, - results: Optional[List[AutomationsResponseResultsInner]]=None, - metadata: Optional[Metadata]=None + self, + results: Optional[List[AutomationsResponseResultsInner]] = None, + metadata: Optional[Metadata] = None, ): - self.results=results - self.metadata=metadata + self.results = results + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "results": self.results, - "_metadata": self.metadata - }.items() if value is not None} + "results": self.results, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -30,7 +32,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AutomationsResponse( - results=payload.get('results'), - metadata=payload.get('_metadata') - ) - + results=payload.get("results"), metadata=payload.get("_metadata") + ) diff --git a/sendgrid/rest/api/mc_stats/v3/models/automations_response_results_inner.py b/sendgrid/rest/api/mc_stats/v3/models/automations_response_results_inner.py index 8fb9fa34..6d88b4c2 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/automations_response_results_inner.py +++ b/sendgrid/rest/api/mc_stats/v3/models/automations_response_results_inner.py @@ -1,32 +1,32 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_stats.v3.models.metrics import Metrics - class AutomationsResponseResultsInner: def __init__( - self, - id: Optional[str]=None, - aggregation: Optional[str]=None, - step_id: Optional[str]=None, - stats: Optional[Metrics]=None + self, + id: Optional[str] = None, + aggregation: Optional[str] = None, + step_id: Optional[str] = None, + stats: Optional[Metrics] = None, ): - self.id=id - self.aggregation=aggregation - self.step_id=step_id - self.stats=stats + self.id = id + self.aggregation = aggregation + self.step_id = step_id + self.stats = stats def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "aggregation": self.aggregation, - "step_id": self.step_id, - "stats": self.stats - }.items() if value is not None} + "id": self.id, + "aggregation": self.aggregation, + "step_id": self.step_id, + "stats": self.stats, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -35,9 +35,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AutomationsResponseResultsInner( - id=payload.get('id'), - aggregation=payload.get('aggregation'), - step_id=payload.get('step_id'), - stats=payload.get('stats') - ) - + id=payload.get("id"), + aggregation=payload.get("aggregation"), + step_id=payload.get("step_id"), + stats=payload.get("stats"), + ) diff --git a/sendgrid/rest/api/mc_stats/v3/models/error_response.py b/sendgrid/rest/api/mc_stats/v3/models/error_response.py index 1be2b19a..aa5ebafe 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/error_response.py +++ b/sendgrid/rest/api/mc_stats/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_stats.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.mc_stats.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/mc_stats/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/mc_stats/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/mc_stats/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/mc_stats/v3/models/items.py b/sendgrid/rest/api/mc_stats/v3/models/items.py index d89f5301..e48df653 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/items.py +++ b/sendgrid/rest/api/mc_stats/v3/models/items.py @@ -1,10 +1,6 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Items(Enum): - STEP_ID='step_id' - + STEP_ID = "step_id" diff --git a/sendgrid/rest/api/mc_stats/v3/models/items1.py b/sendgrid/rest/api/mc_stats/v3/models/items1.py index 5209f13f..ea1e22a3 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/items1.py +++ b/sendgrid/rest/api/mc_stats/v3/models/items1.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Items1(Enum): - AB_VARIATION='ab_variation' - AB_PHASE='ab_phase' - + AB_VARIATION = "ab_variation" + AB_PHASE = "ab_phase" diff --git a/sendgrid/rest/api/mc_stats/v3/models/items2.py b/sendgrid/rest/api/mc_stats/v3/models/items2.py index 40b7490f..39abebed 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/items2.py +++ b/sendgrid/rest/api/mc_stats/v3/models/items2.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Items2(Enum): - AB_VARIATION='ab_variation' - AB_PHASE='ab_phase' - + AB_VARIATION = "ab_variation" + AB_PHASE = "ab_phase" diff --git a/sendgrid/rest/api/mc_stats/v3/models/link_tracking_metadata.py b/sendgrid/rest/api/mc_stats/v3/models/link_tracking_metadata.py index 3fdd412f..8f828634 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/link_tracking_metadata.py +++ b/sendgrid/rest/api/mc_stats/v3/models/link_tracking_metadata.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class LinkTrackingMetadata: def __init__( - self, - prev: Optional[str]=None, - var_self: Optional[str]=None, - next: Optional[str]=None, - count: Optional[float]=None + self, + prev: Optional[str] = None, + var_self: Optional[str] = None, + next: Optional[str] = None, + count: Optional[float] = None, ): - self.prev=prev - self.var_self=var_self - self.next=next - self.count=count + self.prev = prev + self.var_self = var_self + self.next = next + self.count = count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "prev": self.prev, - "self": self.var_self, - "next": self.next, - "count": self.count - }.items() if value is not None} + "prev": self.prev, + "self": self.var_self, + "next": self.next, + "count": self.count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return LinkTrackingMetadata( - prev=payload.get('prev'), - var_self=payload.get('self'), - next=payload.get('next'), - count=payload.get('count') - ) - + prev=payload.get("prev"), + var_self=payload.get("self"), + next=payload.get("next"), + count=payload.get("count"), + ) diff --git a/sendgrid/rest/api/mc_stats/v3/models/metadata.py b/sendgrid/rest/api/mc_stats/v3/models/metadata.py index 1e8e145e..2d7bf72c 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/metadata.py +++ b/sendgrid/rest/api/mc_stats/v3/models/metadata.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class Metadata: def __init__( - self, - prev: Optional[str]=None, - var_self: Optional[str]=None, - next: Optional[str]=None, - count: Optional[float]=None + self, + prev: Optional[str] = None, + var_self: Optional[str] = None, + next: Optional[str] = None, + count: Optional[float] = None, ): - self.prev=prev - self.var_self=var_self - self.next=next - self.count=count + self.prev = prev + self.var_self = var_self + self.next = next + self.count = count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "prev": self.prev, - "self": self.var_self, - "next": self.next, - "count": self.count - }.items() if value is not None} + "prev": self.prev, + "self": self.var_self, + "next": self.next, + "count": self.count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Metadata( - prev=payload.get('prev'), - var_self=payload.get('self'), - next=payload.get('next'), - count=payload.get('count') - ) - + prev=payload.get("prev"), + var_self=payload.get("self"), + next=payload.get("next"), + count=payload.get("count"), + ) diff --git a/sendgrid/rest/api/mc_stats/v3/models/metrics.py b/sendgrid/rest/api/mc_stats/v3/models/metrics.py index 5fcf0d98..16518466 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/metrics.py +++ b/sendgrid/rest/api/mc_stats/v3/models/metrics.py @@ -1,55 +1,55 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class Metrics: def __init__( - self, - bounce_drops: Optional[int]=None, - bounces: Optional[int]=None, - clicks: Optional[int]=None, - delivered: Optional[int]=None, - invalid_emails: Optional[int]=None, - opens: Optional[int]=None, - requests: Optional[int]=None, - spam_report_drops: Optional[int]=None, - spam_reports: Optional[int]=None, - unique_clicks: Optional[int]=None, - unique_opens: Optional[int]=None, - unsubscribes: Optional[int]=None + self, + bounce_drops: Optional[int] = None, + bounces: Optional[int] = None, + clicks: Optional[int] = None, + delivered: Optional[int] = None, + invalid_emails: Optional[int] = None, + opens: Optional[int] = None, + requests: Optional[int] = None, + spam_report_drops: Optional[int] = None, + spam_reports: Optional[int] = None, + unique_clicks: Optional[int] = None, + unique_opens: Optional[int] = None, + unsubscribes: Optional[int] = None, ): - self.bounce_drops=bounce_drops - self.bounces=bounces - self.clicks=clicks - self.delivered=delivered - self.invalid_emails=invalid_emails - self.opens=opens - self.requests=requests - self.spam_report_drops=spam_report_drops - self.spam_reports=spam_reports - self.unique_clicks=unique_clicks - self.unique_opens=unique_opens - self.unsubscribes=unsubscribes + self.bounce_drops = bounce_drops + self.bounces = bounces + self.clicks = clicks + self.delivered = delivered + self.invalid_emails = invalid_emails + self.opens = opens + self.requests = requests + self.spam_report_drops = spam_report_drops + self.spam_reports = spam_reports + self.unique_clicks = unique_clicks + self.unique_opens = unique_opens + self.unsubscribes = unsubscribes def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "bounce_drops": self.bounce_drops, - "bounces": self.bounces, - "clicks": self.clicks, - "delivered": self.delivered, - "invalid_emails": self.invalid_emails, - "opens": self.opens, - "requests": self.requests, - "spam_report_drops": self.spam_report_drops, - "spam_reports": self.spam_reports, - "unique_clicks": self.unique_clicks, - "unique_opens": self.unique_opens, - "unsubscribes": self.unsubscribes - }.items() if value is not None} + "bounce_drops": self.bounce_drops, + "bounces": self.bounces, + "clicks": self.clicks, + "delivered": self.delivered, + "invalid_emails": self.invalid_emails, + "opens": self.opens, + "requests": self.requests, + "spam_report_drops": self.spam_report_drops, + "spam_reports": self.spam_reports, + "unique_clicks": self.unique_clicks, + "unique_opens": self.unique_opens, + "unsubscribes": self.unsubscribes, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -58,17 +58,16 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Metrics( - bounce_drops=payload.get('bounce_drops'), - bounces=payload.get('bounces'), - clicks=payload.get('clicks'), - delivered=payload.get('delivered'), - invalid_emails=payload.get('invalid_emails'), - opens=payload.get('opens'), - requests=payload.get('requests'), - spam_report_drops=payload.get('spam_report_drops'), - spam_reports=payload.get('spam_reports'), - unique_clicks=payload.get('unique_clicks'), - unique_opens=payload.get('unique_opens'), - unsubscribes=payload.get('unsubscribes') - ) - + bounce_drops=payload.get("bounce_drops"), + bounces=payload.get("bounces"), + clicks=payload.get("clicks"), + delivered=payload.get("delivered"), + invalid_emails=payload.get("invalid_emails"), + opens=payload.get("opens"), + requests=payload.get("requests"), + spam_report_drops=payload.get("spam_report_drops"), + spam_reports=payload.get("spam_reports"), + unique_clicks=payload.get("unique_clicks"), + unique_opens=payload.get("unique_opens"), + unsubscribes=payload.get("unsubscribes"), + ) diff --git a/sendgrid/rest/api/mc_stats/v3/models/singlesends_link_stats_response.py b/sendgrid/rest/api/mc_stats/v3/models/singlesends_link_stats_response.py index b015a0f8..fac0d388 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/singlesends_link_stats_response.py +++ b/sendgrid/rest/api/mc_stats/v3/models/singlesends_link_stats_response.py @@ -1,30 +1,34 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_stats.v3.models.link_tracking_metadata import LinkTrackingMetadata -from sendgrid.rest.api.mc_stats.v3.models.singlesends_link_stats_response_results_inner import SinglesendsLinkStatsResponseResultsInner - +from sendgrid.rest.api.mc_stats.v3.models.link_tracking_metadata import ( + LinkTrackingMetadata, +) +from sendgrid.rest.api.mc_stats.v3.models.singlesends_link_stats_response_results_inner import ( + SinglesendsLinkStatsResponseResultsInner, +) class SinglesendsLinkStatsResponse: def __init__( - self, - results: Optional[List[SinglesendsLinkStatsResponseResultsInner]]=None, - metadata: Optional[LinkTrackingMetadata]=None, - total_clicks: Optional[int]=None + self, + results: Optional[List[SinglesendsLinkStatsResponseResultsInner]] = None, + metadata: Optional[LinkTrackingMetadata] = None, + total_clicks: Optional[int] = None, ): - self.results=results - self.metadata=metadata - self.total_clicks=total_clicks + self.results = results + self.metadata = metadata + self.total_clicks = total_clicks def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "results": self.results, - "_metadata": self.metadata, - "total_clicks": self.total_clicks - }.items() if value is not None} + "results": self.results, + "_metadata": self.metadata, + "total_clicks": self.total_clicks, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -33,8 +37,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SinglesendsLinkStatsResponse( - results=payload.get('results'), - metadata=payload.get('_metadata'), - total_clicks=payload.get('total_clicks') - ) - + results=payload.get("results"), + metadata=payload.get("_metadata"), + total_clicks=payload.get("total_clicks"), + ) diff --git a/sendgrid/rest/api/mc_stats/v3/models/singlesends_link_stats_response_results_inner.py b/sendgrid/rest/api/mc_stats/v3/models/singlesends_link_stats_response_results_inner.py index f9d1516c..ed66c39b 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/singlesends_link_stats_response_results_inner.py +++ b/sendgrid/rest/api/mc_stats/v3/models/singlesends_link_stats_response_results_inner.py @@ -1,35 +1,35 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_stats.v3.models.ab_phase1 import AbPhase1 - class SinglesendsLinkStatsResponseResultsInner: def __init__( - self, - url: Optional[str]=None, - url_location: Optional[int]=None, - ab_variation: Optional[str]=None, - ab_phase: Optional[AbPhase1]=None, - clicks: Optional[int]=None + self, + url: Optional[str] = None, + url_location: Optional[int] = None, + ab_variation: Optional[str] = None, + ab_phase: Optional[AbPhase1] = None, + clicks: Optional[int] = None, ): - self.url=url - self.url_location=url_location - self.ab_variation=ab_variation - self.ab_phase=ab_phase - self.clicks=clicks + self.url = url + self.url_location = url_location + self.ab_variation = ab_variation + self.ab_phase = ab_phase + self.clicks = clicks def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "url": self.url, - "url_location": self.url_location, - "ab_variation": self.ab_variation, - "ab_phase": self.ab_phase, - "clicks": self.clicks - }.items() if value is not None} + "url": self.url, + "url_location": self.url_location, + "ab_variation": self.ab_variation, + "ab_phase": self.ab_phase, + "clicks": self.clicks, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -38,10 +38,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SinglesendsLinkStatsResponseResultsInner( - url=payload.get('url'), - url_location=payload.get('url_location'), - ab_variation=payload.get('ab_variation'), - ab_phase=payload.get('ab_phase'), - clicks=payload.get('clicks') - ) - + url=payload.get("url"), + url_location=payload.get("url_location"), + ab_variation=payload.get("ab_variation"), + ab_phase=payload.get("ab_phase"), + clicks=payload.get("clicks"), + ) diff --git a/sendgrid/rest/api/mc_stats/v3/models/singlesends_response.py b/sendgrid/rest/api/mc_stats/v3/models/singlesends_response.py index feb2cc11..5f2d17d8 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/singlesends_response.py +++ b/sendgrid/rest/api/mc_stats/v3/models/singlesends_response.py @@ -1,27 +1,29 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_stats.v3.models.metadata import Metadata -from sendgrid.rest.api.mc_stats.v3.models.singlesends_response_results_inner import SinglesendsResponseResultsInner - +from sendgrid.rest.api.mc_stats.v3.models.singlesends_response_results_inner import ( + SinglesendsResponseResultsInner, +) class SinglesendsResponse: def __init__( - self, - results: Optional[List[SinglesendsResponseResultsInner]]=None, - metadata: Optional[Metadata]=None + self, + results: Optional[List[SinglesendsResponseResultsInner]] = None, + metadata: Optional[Metadata] = None, ): - self.results=results - self.metadata=metadata + self.results = results + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "results": self.results, - "_metadata": self.metadata - }.items() if value is not None} + "results": self.results, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -30,7 +32,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SinglesendsResponse( - results=payload.get('results'), - metadata=payload.get('_metadata') - ) - + results=payload.get("results"), metadata=payload.get("_metadata") + ) diff --git a/sendgrid/rest/api/mc_stats/v3/models/singlesends_response_results_inner.py b/sendgrid/rest/api/mc_stats/v3/models/singlesends_response_results_inner.py index 8c59424c..1b8a4511 100644 --- a/sendgrid/rest/api/mc_stats/v3/models/singlesends_response_results_inner.py +++ b/sendgrid/rest/api/mc_stats/v3/models/singlesends_response_results_inner.py @@ -1,36 +1,36 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.mc_stats.v3.models.ab_phase import AbPhase from sendgrid.rest.api.mc_stats.v3.models.metrics import Metrics - class SinglesendsResponseResultsInner: def __init__( - self, - id: Optional[str]=None, - ab_variation: Optional[str]=None, - ab_phase: Optional[AbPhase]=None, - aggregation: Optional[str]=None, - stats: Optional[Metrics]=None + self, + id: Optional[str] = None, + ab_variation: Optional[str] = None, + ab_phase: Optional[AbPhase] = None, + aggregation: Optional[str] = None, + stats: Optional[Metrics] = None, ): - self.id=id - self.ab_variation=ab_variation - self.ab_phase=ab_phase - self.aggregation=aggregation - self.stats=stats + self.id = id + self.ab_variation = ab_variation + self.ab_phase = ab_phase + self.aggregation = aggregation + self.stats = stats def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "ab_variation": self.ab_variation, - "ab_phase": self.ab_phase, - "aggregation": self.aggregation, - "stats": self.stats - }.items() if value is not None} + "id": self.id, + "ab_variation": self.ab_variation, + "ab_phase": self.ab_phase, + "aggregation": self.aggregation, + "stats": self.stats, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -39,10 +39,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SinglesendsResponseResultsInner( - id=payload.get('id'), - ab_variation=payload.get('ab_variation'), - ab_phase=payload.get('ab_phase'), - aggregation=payload.get('aggregation'), - stats=payload.get('stats') - ) - + id=payload.get("id"), + ab_variation=payload.get("ab_variation"), + ab_phase=payload.get("ab_phase"), + aggregation=payload.get("aggregation"), + stats=payload.get("stats"), + ) diff --git a/sendgrid/rest/api/mc_test/v3/__init__.py b/sendgrid/rest/api/mc_test/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/mc_test/v3/__init__.py +++ b/sendgrid/rest/api/mc_test/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/mc_test/v3/models/__init__.py b/sendgrid/rest/api/mc_test/v3/models/__init__.py index 6025e869..ee72e356 100644 --- a/sendgrid/rest/api/mc_test/v3/models/__init__.py +++ b/sendgrid/rest/api/mc_test/v3/models/__init__.py @@ -11,10 +11,14 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.mc_test.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.mc_test.v3.models.error_response_errors_inner import ErrorResponseErrorsInner -from sendgrid.rest.api.mc_test.v3.models.send_test_marketing_email_request import SendTestMarketingEmailRequest -__all__ = [ 'ErrorResponse', 'ErrorResponseErrorsInner', 'SendTestMarketingEmailRequest' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.mc_test.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) +from sendgrid.rest.api.mc_test.v3.models.send_test_marketing_email_request import ( + SendTestMarketingEmailRequest, +) + +__all__ = ["ErrorResponse", "ErrorResponseErrorsInner", "SendTestMarketingEmailRequest"] +# Testing code diff --git a/sendgrid/rest/api/mc_test/v3/models/error_response.py b/sendgrid/rest/api/mc_test/v3/models/error_response.py index 85a4f757..6584fff1 100644 --- a/sendgrid/rest/api/mc_test/v3/models/error_response.py +++ b/sendgrid/rest/api/mc_test/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.mc_test.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.mc_test.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/mc_test/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/mc_test/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/mc_test/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/mc_test/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/mc_test/v3/models/send_test_marketing_email_request.py b/sendgrid/rest/api/mc_test/v3/models/send_test_marketing_email_request.py index f2fb3cec..d0eea073 100644 --- a/sendgrid/rest/api/mc_test/v3/models/send_test_marketing_email_request.py +++ b/sendgrid/rest/api/mc_test/v3/models/send_test_marketing_email_request.py @@ -1,40 +1,40 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SendTestMarketingEmailRequest: def __init__( - self, - template_id: Optional[str]=None, - version_id_override: Optional[str]=None, - sender_id: Optional[int]=None, - custom_unsubscribe_url: Optional[str]=None, - suppression_group_id: Optional[int]=None, - emails: Optional[List[str]]=None, - from_address: Optional[str]=None + self, + template_id: Optional[str] = None, + version_id_override: Optional[str] = None, + sender_id: Optional[int] = None, + custom_unsubscribe_url: Optional[str] = None, + suppression_group_id: Optional[int] = None, + emails: Optional[List[str]] = None, + from_address: Optional[str] = None, ): - self.template_id=template_id - self.version_id_override=version_id_override - self.sender_id=sender_id - self.custom_unsubscribe_url=custom_unsubscribe_url - self.suppression_group_id=suppression_group_id - self.emails=emails - self.from_address=from_address + self.template_id = template_id + self.version_id_override = version_id_override + self.sender_id = sender_id + self.custom_unsubscribe_url = custom_unsubscribe_url + self.suppression_group_id = suppression_group_id + self.emails = emails + self.from_address = from_address def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "template_id": self.template_id, - "version_id_override": self.version_id_override, - "sender_id": self.sender_id, - "custom_unsubscribe_url": self.custom_unsubscribe_url, - "suppression_group_id": self.suppression_group_id, - "emails": self.emails, - "from_address": self.from_address - }.items() if value is not None} + "template_id": self.template_id, + "version_id_override": self.version_id_override, + "sender_id": self.sender_id, + "custom_unsubscribe_url": self.custom_unsubscribe_url, + "suppression_group_id": self.suppression_group_id, + "emails": self.emails, + "from_address": self.from_address, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -43,12 +43,11 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SendTestMarketingEmailRequest( - template_id=payload.get('template_id'), - version_id_override=payload.get('version_id_override'), - sender_id=payload.get('sender_id'), - custom_unsubscribe_url=payload.get('custom_unsubscribe_url'), - suppression_group_id=payload.get('suppression_group_id'), - emails=payload.get('emails'), - from_address=payload.get('from_address') - ) - + template_id=payload.get("template_id"), + version_id_override=payload.get("version_id_override"), + sender_id=payload.get("sender_id"), + custom_unsubscribe_url=payload.get("custom_unsubscribe_url"), + suppression_group_id=payload.get("suppression_group_id"), + emails=payload.get("emails"), + from_address=payload.get("from_address"), + ) diff --git a/sendgrid/rest/api/mc_test/v3/send_test_marketing_email.py b/sendgrid/rest/api/mc_test/v3/send_test_marketing_email.py index 84a31325..1e85114b 100644 --- a/sendgrid/rest/api/mc_test/v3/send_test_marketing_email.py +++ b/sendgrid/rest/api/mc_test/v3/send_test_marketing_email.py @@ -12,46 +12,48 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.mc_test.v3.models.send_test_marketing_email_request import SendTestMarketingEmailRequest +from sendgrid.rest.api.mc_test.v3.models.send_test_marketing_email_request import ( + SendTestMarketingEmailRequest, +) + class SendTestMarketingEmail: def __init__(self, client) -> None: self.client = client - + def send( self, - send_test_marketing_email_request: Optional[SendTestMarketingEmailRequest] = None, - + send_test_marketing_email_request: Optional[ + SendTestMarketingEmailRequest + ] = None, ): - path='/v3/marketing/test/send_email' + path = "/v3/marketing/test/send_email" data = None if send_test_marketing_email_request: data = send_test_marketing_email_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/partner/v3/__init__.py b/sendgrid/rest/api/partner/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/partner/v3/__init__.py +++ b/sendgrid/rest/api/partner/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/partner/v3/list_partner_setting.py b/sendgrid/rest/api/partner/v3/list_partner_setting.py index d06f85dd..83ca5242 100644 --- a/sendgrid/rest/api/partner/v3/list_partner_setting.py +++ b/sendgrid/rest/api/partner/v3/list_partner_setting.py @@ -12,52 +12,49 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.partner.v3.models.list_partner_setting200_response import ListPartnerSetting200Response + class ListPartnerSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - + on_behalf_of: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, ): - path='/v3/partner_settings' + path = "/v3/partner_settings" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/partner/v3/models/__init__.py b/sendgrid/rest/api/partner/v3/models/__init__.py index d9d4df99..7ffa853a 100644 --- a/sendgrid/rest/api/partner/v3/models/__init__.py +++ b/sendgrid/rest/api/partner/v3/models/__init__.py @@ -11,9 +11,13 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.partner.v3.models.list_partner_setting200_response import ListPartnerSetting200Response -from sendgrid.rest.api.partner.v3.models.list_partner_setting200_response_result_inner import ListPartnerSetting200ResponseResultInner -__all__ = [ 'ListPartnerSetting200Response', 'ListPartnerSetting200ResponseResultInner' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.partner.v3.models.list_partner_setting200_response import ( + ListPartnerSetting200Response, +) +from sendgrid.rest.api.partner.v3.models.list_partner_setting200_response_result_inner import ( + ListPartnerSetting200ResponseResultInner, +) + +__all__ = ["ListPartnerSetting200Response", "ListPartnerSetting200ResponseResultInner"] +# Testing code diff --git a/sendgrid/rest/api/partner/v3/models/list_partner_setting200_response.py b/sendgrid/rest/api/partner/v3/models/list_partner_setting200_response.py index 849e946e..896c9695 100644 --- a/sendgrid/rest/api/partner/v3/models/list_partner_setting200_response.py +++ b/sendgrid/rest/api/partner/v3/models/list_partner_setting200_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.partner.v3.models.list_partner_setting200_response_result_inner import ListPartnerSetting200ResponseResultInner - +from sendgrid.rest.api.partner.v3.models.list_partner_setting200_response_result_inner import ( + ListPartnerSetting200ResponseResultInner, +) class ListPartnerSetting200Response: def __init__( - self, - result: Optional[List[ListPartnerSetting200ResponseResultInner]]=None + self, result: Optional[List[ListPartnerSetting200ResponseResultInner]] = None ): - self.result=result + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListPartnerSetting200Response( - result=payload.get('result') - ) - + return ListPartnerSetting200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/partner/v3/models/list_partner_setting200_response_result_inner.py b/sendgrid/rest/api/partner/v3/models/list_partner_setting200_response_result_inner.py index d6916049..2cf9c489 100644 --- a/sendgrid/rest/api/partner/v3/models/list_partner_setting200_response_result_inner.py +++ b/sendgrid/rest/api/partner/v3/models/list_partner_setting200_response_result_inner.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListPartnerSetting200ResponseResultInner: def __init__( - self, - title: Optional[str]=None, - enabled: Optional[bool]=None, - name: Optional[str]=None, - description: Optional[str]=None + self, + title: Optional[str] = None, + enabled: Optional[bool] = None, + name: Optional[str] = None, + description: Optional[str] = None, ): - self.title=title - self.enabled=enabled - self.name=name - self.description=description + self.title = title + self.enabled = enabled + self.name = name + self.description = description def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "title": self.title, - "enabled": self.enabled, - "name": self.name, - "description": self.description - }.items() if value is not None} + "title": self.title, + "enabled": self.enabled, + "name": self.name, + "description": self.description, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListPartnerSetting200ResponseResultInner( - title=payload.get('title'), - enabled=payload.get('enabled'), - name=payload.get('name'), - description=payload.get('description') - ) - + title=payload.get("title"), + enabled=payload.get("enabled"), + name=payload.get("name"), + description=payload.get("description"), + ) diff --git a/sendgrid/rest/api/recipients_data_erasure/v3/__init__.py b/sendgrid/rest/api/recipients_data_erasure/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/recipients_data_erasure/v3/__init__.py +++ b/sendgrid/rest/api/recipients_data_erasure/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/recipients_data_erasure/v3/erase_recipient_email_data.py b/sendgrid/rest/api/recipients_data_erasure/v3/erase_recipient_email_data.py index 251a7179..baa1bd73 100644 --- a/sendgrid/rest/api/recipients_data_erasure/v3/erase_recipient_email_data.py +++ b/sendgrid/rest/api/recipients_data_erasure/v3/erase_recipient_email_data.py @@ -12,55 +12,56 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.recipients_data_erasure.v3.models.recipients_data_erasure_erase_recipients_request import RecipientsDataErasureEraseRecipientsRequest -from sendgrid.rest.api.recipients_data_erasure.v3.models.recipients_data_erasure_job_id import RecipientsDataErasureJobId +from sendgrid.rest.api.recipients_data_erasure.v3.models.recipients_data_erasure_erase_recipients_request import ( + RecipientsDataErasureEraseRecipientsRequest, +) + class EraseRecipientEmailData: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - recipients_data_erasure_erase_recipients_request: Optional[RecipientsDataErasureEraseRecipientsRequest] = None, - + on_behalf_of: Optional[str] = None, + recipients_data_erasure_erase_recipients_request: Optional[ + RecipientsDataErasureEraseRecipientsRequest + ] = None, ): - path='/v3/recipients/erasejob' + path = "/v3/recipients/erasejob" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if recipients_data_erasure_erase_recipients_request: data = recipients_data_erasure_erase_recipients_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/recipients_data_erasure/v3/models/__init__.py b/sendgrid/rest/api/recipients_data_erasure/v3/models/__init__.py index c6a98d75..5c40d63d 100644 --- a/sendgrid/rest/api/recipients_data_erasure/v3/models/__init__.py +++ b/sendgrid/rest/api/recipients_data_erasure/v3/models/__init__.py @@ -11,10 +11,20 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.recipients_data_erasure.v3.models.recipients_data_erasure_erase_recipients_request import RecipientsDataErasureEraseRecipientsRequest -from sendgrid.rest.api.recipients_data_erasure.v3.models.recipients_data_erasure_error_v1 import RecipientsDataErasureErrorV1 -from sendgrid.rest.api.recipients_data_erasure.v3.models.recipients_data_erasure_job_id import RecipientsDataErasureJobId -__all__ = [ 'RecipientsDataErasureEraseRecipientsRequest', 'RecipientsDataErasureErrorV1', 'RecipientsDataErasureJobId' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.recipients_data_erasure.v3.models.recipients_data_erasure_erase_recipients_request import ( + RecipientsDataErasureEraseRecipientsRequest, +) +from sendgrid.rest.api.recipients_data_erasure.v3.models.recipients_data_erasure_error_v1 import ( + RecipientsDataErasureErrorV1, +) +from sendgrid.rest.api.recipients_data_erasure.v3.models.recipients_data_erasure_job_id import ( + RecipientsDataErasureJobId, +) + +__all__ = [ + "RecipientsDataErasureEraseRecipientsRequest", + "RecipientsDataErasureErrorV1", + "RecipientsDataErasureJobId", +] +# Testing code diff --git a/sendgrid/rest/api/recipients_data_erasure/v3/models/recipients_data_erasure_erase_recipients_request.py b/sendgrid/rest/api/recipients_data_erasure/v3/models/recipients_data_erasure_erase_recipients_request.py index 0e9693d2..7923dc6f 100644 --- a/sendgrid/rest/api/recipients_data_erasure/v3/models/recipients_data_erasure_erase_recipients_request.py +++ b/sendgrid/rest/api/recipients_data_erasure/v3/models/recipients_data_erasure_erase_recipients_request.py @@ -1,22 +1,17 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class RecipientsDataErasureEraseRecipientsRequest: - def __init__( - self, - email_addresses: Optional[List[str]]=None - ): - self.email_addresses=email_addresses + def __init__(self, email_addresses: Optional[List[str]] = None): + self.email_addresses = email_addresses def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email_addresses": self.email_addresses - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email_addresses": self.email_addresses}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,6 +20,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return RecipientsDataErasureEraseRecipientsRequest( - email_addresses=payload.get('email_addresses') - ) - + email_addresses=payload.get("email_addresses") + ) diff --git a/sendgrid/rest/api/recipients_data_erasure/v3/models/recipients_data_erasure_error_v1.py b/sendgrid/rest/api/recipients_data_erasure/v3/models/recipients_data_erasure_error_v1.py index da1b07d2..9841373b 100644 --- a/sendgrid/rest/api/recipients_data_erasure/v3/models/recipients_data_erasure_error_v1.py +++ b/sendgrid/rest/api/recipients_data_erasure/v3/models/recipients_data_erasure_error_v1.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class RecipientsDataErasureErrorV1: - def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None - ): - self.message=message - self.field=field + def __init__(self, message: Optional[str] = None, field: Optional[str] = None): + self.message = message + self.field = field def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message, - "field": self.field - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message, "field": self.field}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return RecipientsDataErasureErrorV1( - message=payload.get('message'), - field=payload.get('field') - ) - + message=payload.get("message"), field=payload.get("field") + ) diff --git a/sendgrid/rest/api/recipients_data_erasure/v3/models/recipients_data_erasure_job_id.py b/sendgrid/rest/api/recipients_data_erasure/v3/models/recipients_data_erasure_job_id.py index f8a54c62..4ab14388 100644 --- a/sendgrid/rest/api/recipients_data_erasure/v3/models/recipients_data_erasure_job_id.py +++ b/sendgrid/rest/api/recipients_data_erasure/v3/models/recipients_data_erasure_job_id.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class RecipientsDataErasureJobId: - def __init__( - self, - job_id: Optional[str]=None - ): - self.job_id=job_id + def __init__(self, job_id: Optional[str] = None): + self.job_id = job_id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "job_id": self.job_id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"job_id": self.job_id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return RecipientsDataErasureJobId( - job_id=payload.get('job_id') - ) - + return RecipientsDataErasureJobId(job_id=payload.get("job_id")) diff --git a/sendgrid/rest/api/reverse_dns/v3/__init__.py b/sendgrid/rest/api/reverse_dns/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/reverse_dns/v3/__init__.py +++ b/sendgrid/rest/api/reverse_dns/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/reverse_dns/v3/delete_reverse_dns.py b/sendgrid/rest/api/reverse_dns/v3/delete_reverse_dns.py index bd3e2f8d..60af46c8 100644 --- a/sendgrid/rest/api/reverse_dns/v3/delete_reverse_dns.py +++ b/sendgrid/rest/api/reverse_dns/v3/delete_reverse_dns.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteReverseDns: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - on_behalf_of: Optional[str] = None, - + id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/whitelabel/ips/{id}' + path = "/v3/whitelabel/ips/{id}" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/reverse_dns/v3/get_reverse_dns.py b/sendgrid/rest/api/reverse_dns/v3/get_reverse_dns.py index 06a70346..1d2ad9b6 100644 --- a/sendgrid/rest/api/reverse_dns/v3/get_reverse_dns.py +++ b/sendgrid/rest/api/reverse_dns/v3/get_reverse_dns.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.reverse_dns.v3.models.reverse_dns import ReverseDns + class GetReverseDns: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - on_behalf_of: Optional[str] = None, - + id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/whitelabel/ips/{id}' + path = "/v3/whitelabel/ips/{id}" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/reverse_dns/v3/list_reverse_dns.py b/sendgrid/rest/api/reverse_dns/v3/list_reverse_dns.py index 959c9401..4b1bbef1 100644 --- a/sendgrid/rest/api/reverse_dns/v3/list_reverse_dns.py +++ b/sendgrid/rest/api/reverse_dns/v3/list_reverse_dns.py @@ -12,53 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.reverse_dns.v3.models.reverse_dns import ReverseDns + class ListReverseDns: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - ip: Optional[str] = None, - + on_behalf_of: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + ip: Optional[str] = None, ): - path='/v3/whitelabel/ips' + path = "/v3/whitelabel/ips" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/reverse_dns/v3/models/__init__.py b/sendgrid/rest/api/reverse_dns/v3/models/__init__.py index 70217317..e82850ce 100644 --- a/sendgrid/rest/api/reverse_dns/v3/models/__init__.py +++ b/sendgrid/rest/api/reverse_dns/v3/models/__init__.py @@ -11,20 +11,54 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.reverse_dns.v3.models.reverse_dns import ReverseDns -from sendgrid.rest.api.reverse_dns.v3.models.reverse_dns_a_record import ReverseDnsARecord -from sendgrid.rest.api.reverse_dns.v3.models.reverse_dns_users_inner import ReverseDnsUsersInner -from sendgrid.rest.api.reverse_dns.v3.models.set_up_reverse_dns_request import SetUpReverseDnsRequest +from sendgrid.rest.api.reverse_dns.v3.models.reverse_dns_a_record import ( + ReverseDnsARecord, +) +from sendgrid.rest.api.reverse_dns.v3.models.reverse_dns_users_inner import ( + ReverseDnsUsersInner, +) +from sendgrid.rest.api.reverse_dns.v3.models.set_up_reverse_dns_request import ( + SetUpReverseDnsRequest, +) from sendgrid.rest.api.reverse_dns.v3.models.valid import Valid from sendgrid.rest.api.reverse_dns.v3.models.valid1 import Valid1 -from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns200_response import ValidateReverseDns200Response -from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns200_response_validation_results import ValidateReverseDns200ResponseValidationResults -from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns200_response_validation_results_a_record import ValidateReverseDns200ResponseValidationResultsARecord -from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns404_response import ValidateReverseDns404Response -from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns404_response_errors_inner import ValidateReverseDns404ResponseErrorsInner -from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns500_response import ValidateReverseDns500Response -from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns500_response_errors_inner import ValidateReverseDns500ResponseErrorsInner -__all__ = [ 'ReverseDns', 'ReverseDnsARecord', 'ReverseDnsUsersInner', 'SetUpReverseDnsRequest', 'Valid', 'Valid1', 'ValidateReverseDns200Response', 'ValidateReverseDns200ResponseValidationResults', 'ValidateReverseDns200ResponseValidationResultsARecord', 'ValidateReverseDns404Response', 'ValidateReverseDns404ResponseErrorsInner', 'ValidateReverseDns500Response', 'ValidateReverseDns500ResponseErrorsInner' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns200_response import ( + ValidateReverseDns200Response, +) +from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns200_response_validation_results import ( + ValidateReverseDns200ResponseValidationResults, +) +from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns200_response_validation_results_a_record import ( + ValidateReverseDns200ResponseValidationResultsARecord, +) +from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns404_response import ( + ValidateReverseDns404Response, +) +from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns404_response_errors_inner import ( + ValidateReverseDns404ResponseErrorsInner, +) +from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns500_response import ( + ValidateReverseDns500Response, +) +from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns500_response_errors_inner import ( + ValidateReverseDns500ResponseErrorsInner, +) + +__all__ = [ + "ReverseDns", + "ReverseDnsARecord", + "ReverseDnsUsersInner", + "SetUpReverseDnsRequest", + "Valid", + "Valid1", + "ValidateReverseDns200Response", + "ValidateReverseDns200ResponseValidationResults", + "ValidateReverseDns200ResponseValidationResultsARecord", + "ValidateReverseDns404Response", + "ValidateReverseDns404ResponseErrorsInner", + "ValidateReverseDns500Response", + "ValidateReverseDns500ResponseErrorsInner", +] +# Testing code diff --git a/sendgrid/rest/api/reverse_dns/v3/models/reverse_dns.py b/sendgrid/rest/api/reverse_dns/v3/models/reverse_dns.py index 14838420..198fc2e9 100644 --- a/sendgrid/rest/api/reverse_dns/v3/models/reverse_dns.py +++ b/sendgrid/rest/api/reverse_dns/v3/models/reverse_dns.py @@ -1,51 +1,55 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.reverse_dns.v3.models.reverse_dns_a_record import ReverseDnsARecord -from sendgrid.rest.api.reverse_dns.v3.models.reverse_dns_users_inner import ReverseDnsUsersInner - +from sendgrid.rest.api.reverse_dns.v3.models.reverse_dns_a_record import ( + ReverseDnsARecord, +) +from sendgrid.rest.api.reverse_dns.v3.models.reverse_dns_users_inner import ( + ReverseDnsUsersInner, +) class ReverseDns: def __init__( - self, - id: Optional[int]=None, - ip: Optional[str]=None, - rdns: Optional[str]=None, - users: Optional[List[ReverseDnsUsersInner]]=None, - subdomain: Optional[str]=None, - domain: Optional[str]=None, - valid: Optional[bool]=None, - legacy: Optional[bool]=None, - last_validation_attempt_at: Optional[int]=None, - a_record: Optional[ReverseDnsARecord]=None + self, + id: Optional[int] = None, + ip: Optional[str] = None, + rdns: Optional[str] = None, + users: Optional[List[ReverseDnsUsersInner]] = None, + subdomain: Optional[str] = None, + domain: Optional[str] = None, + valid: Optional[bool] = None, + legacy: Optional[bool] = None, + last_validation_attempt_at: Optional[int] = None, + a_record: Optional[ReverseDnsARecord] = None, ): - self.id=id - self.ip=ip - self.rdns=rdns - self.users=users - self.subdomain=subdomain - self.domain=domain - self.valid=valid - self.legacy=legacy - self.last_validation_attempt_at=last_validation_attempt_at - self.a_record=a_record + self.id = id + self.ip = ip + self.rdns = rdns + self.users = users + self.subdomain = subdomain + self.domain = domain + self.valid = valid + self.legacy = legacy + self.last_validation_attempt_at = last_validation_attempt_at + self.a_record = a_record def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "ip": self.ip, - "rdns": self.rdns, - "users": self.users, - "subdomain": self.subdomain, - "domain": self.domain, - "valid": self.valid, - "legacy": self.legacy, - "last_validation_attempt_at": self.last_validation_attempt_at, - "a_record": self.a_record - }.items() if value is not None} + "id": self.id, + "ip": self.ip, + "rdns": self.rdns, + "users": self.users, + "subdomain": self.subdomain, + "domain": self.domain, + "valid": self.valid, + "legacy": self.legacy, + "last_validation_attempt_at": self.last_validation_attempt_at, + "a_record": self.a_record, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -54,15 +58,14 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ReverseDns( - id=payload.get('id'), - ip=payload.get('ip'), - rdns=payload.get('rdns'), - users=payload.get('users'), - subdomain=payload.get('subdomain'), - domain=payload.get('domain'), - valid=payload.get('valid'), - legacy=payload.get('legacy'), - last_validation_attempt_at=payload.get('last_validation_attempt_at'), - a_record=payload.get('a_record') - ) - + id=payload.get("id"), + ip=payload.get("ip"), + rdns=payload.get("rdns"), + users=payload.get("users"), + subdomain=payload.get("subdomain"), + domain=payload.get("domain"), + valid=payload.get("valid"), + legacy=payload.get("legacy"), + last_validation_attempt_at=payload.get("last_validation_attempt_at"), + a_record=payload.get("a_record"), + ) diff --git a/sendgrid/rest/api/reverse_dns/v3/models/reverse_dns_a_record.py b/sendgrid/rest/api/reverse_dns/v3/models/reverse_dns_a_record.py index f9098842..1bfee5da 100644 --- a/sendgrid/rest/api/reverse_dns/v3/models/reverse_dns_a_record.py +++ b/sendgrid/rest/api/reverse_dns/v3/models/reverse_dns_a_record.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ReverseDnsARecord: def __init__( - self, - valid: Optional[bool]=None, - type: Optional[str]=None, - host: Optional[str]=None, - data: Optional[str]=None + self, + valid: Optional[bool] = None, + type: Optional[str] = None, + host: Optional[str] = None, + data: Optional[str] = None, ): - self.valid=valid - self.type=type - self.host=host - self.data=data + self.valid = valid + self.type = type + self.host = host + self.data = data def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "valid": self.valid, - "type": self.type, - "host": self.host, - "data": self.data - }.items() if value is not None} + "valid": self.valid, + "type": self.type, + "host": self.host, + "data": self.data, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ReverseDnsARecord( - valid=payload.get('valid'), - type=payload.get('type'), - host=payload.get('host'), - data=payload.get('data') - ) - + valid=payload.get("valid"), + type=payload.get("type"), + host=payload.get("host"), + data=payload.get("data"), + ) diff --git a/sendgrid/rest/api/reverse_dns/v3/models/reverse_dns_users_inner.py b/sendgrid/rest/api/reverse_dns/v3/models/reverse_dns_users_inner.py index 21262511..962fca06 100644 --- a/sendgrid/rest/api/reverse_dns/v3/models/reverse_dns_users_inner.py +++ b/sendgrid/rest/api/reverse_dns/v3/models/reverse_dns_users_inner.py @@ -1,25 +1,21 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ReverseDnsUsersInner: - def __init__( - self, - username: Optional[str]=None, - user_id: Optional[int]=None - ): - self.username=username - self.user_id=user_id + def __init__(self, username: Optional[str] = None, user_id: Optional[int] = None): + self.username = username + self.user_id = user_id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "username": self.username, - "user_id": self.user_id - }.items() if value is not None} + "username": self.username, + "user_id": self.user_id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +24,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ReverseDnsUsersInner( - username=payload.get('username'), - user_id=payload.get('user_id') - ) - + username=payload.get("username"), user_id=payload.get("user_id") + ) diff --git a/sendgrid/rest/api/reverse_dns/v3/models/set_up_reverse_dns_request.py b/sendgrid/rest/api/reverse_dns/v3/models/set_up_reverse_dns_request.py index c495a955..b8a552ec 100644 --- a/sendgrid/rest/api/reverse_dns/v3/models/set_up_reverse_dns_request.py +++ b/sendgrid/rest/api/reverse_dns/v3/models/set_up_reverse_dns_request.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SetUpReverseDnsRequest: def __init__( - self, - ip: Optional[str]=None, - subdomain: Optional[str]=None, - domain: Optional[str]=None + self, + ip: Optional[str] = None, + subdomain: Optional[str] = None, + domain: Optional[str] = None, ): - self.ip=ip - self.subdomain=subdomain - self.domain=domain + self.ip = ip + self.subdomain = subdomain + self.domain = domain def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "ip": self.ip, - "subdomain": self.subdomain, - "domain": self.domain - }.items() if value is not None} + "ip": self.ip, + "subdomain": self.subdomain, + "domain": self.domain, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SetUpReverseDnsRequest( - ip=payload.get('ip'), - subdomain=payload.get('subdomain'), - domain=payload.get('domain') - ) - + ip=payload.get("ip"), + subdomain=payload.get("subdomain"), + domain=payload.get("domain"), + ) diff --git a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns200_response.py b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns200_response.py index 8e2878ef..b9da37a5 100644 --- a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns200_response.py +++ b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns200_response.py @@ -1,30 +1,34 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.reverse_dns.v3.models.valid import Valid -from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns200_response_validation_results import ValidateReverseDns200ResponseValidationResults - +from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns200_response_validation_results import ( + ValidateReverseDns200ResponseValidationResults, +) class ValidateReverseDns200Response: def __init__( - self, - id: Optional[int]=None, - valid: Optional[Valid]=None, - validation_results: Optional[ValidateReverseDns200ResponseValidationResults]=None + self, + id: Optional[int] = None, + valid: Optional[Valid] = None, + validation_results: Optional[ + ValidateReverseDns200ResponseValidationResults + ] = None, ): - self.id=id - self.valid=valid - self.validation_results=validation_results + self.id = id + self.valid = valid + self.validation_results = validation_results def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "valid": self.valid, - "validation_results": self.validation_results - }.items() if value is not None} + "id": self.id, + "valid": self.valid, + "validation_results": self.validation_results, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -33,8 +37,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateReverseDns200Response( - id=payload.get('id'), - valid=payload.get('valid'), - validation_results=payload.get('validation_results') - ) - + id=payload.get("id"), + valid=payload.get("valid"), + validation_results=payload.get("validation_results"), + ) diff --git a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns200_response_validation_results.py b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns200_response_validation_results.py index 3b01b673..c4b5ac99 100644 --- a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns200_response_validation_results.py +++ b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns200_response_validation_results.py @@ -1,23 +1,25 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns200_response_validation_results_a_record import ValidateReverseDns200ResponseValidationResultsARecord - +from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns200_response_validation_results_a_record import ( + ValidateReverseDns200ResponseValidationResultsARecord, +) class ValidateReverseDns200ResponseValidationResults: def __init__( - self, - a_record: Optional[ValidateReverseDns200ResponseValidationResultsARecord]=None + self, + a_record: Optional[ + ValidateReverseDns200ResponseValidationResultsARecord + ] = None, ): - self.a_record=a_record + self.a_record = a_record def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "a_record": self.a_record - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"a_record": self.a_record}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -26,6 +28,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateReverseDns200ResponseValidationResults( - a_record=payload.get('a_record') - ) - + a_record=payload.get("a_record") + ) diff --git a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns200_response_validation_results_a_record.py b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns200_response_validation_results_a_record.py index cfdc27cf..0e50c18b 100644 --- a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns200_response_validation_results_a_record.py +++ b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns200_response_validation_results_a_record.py @@ -1,26 +1,19 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.reverse_dns.v3.models.valid1 import Valid1 - class ValidateReverseDns200ResponseValidationResultsARecord: - def __init__( - self, - valid: Optional[Valid1]=None, - reason: Optional[str]=None - ): - self.valid=valid - self.reason=reason + def __init__(self, valid: Optional[Valid1] = None, reason: Optional[str] = None): + self.valid = valid + self.reason = reason def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "valid": self.valid, - "reason": self.reason - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"valid": self.valid, "reason": self.reason}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +22,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ValidateReverseDns200ResponseValidationResultsARecord( - valid=payload.get('valid'), - reason=payload.get('reason') - ) - + valid=payload.get("valid"), reason=payload.get("reason") + ) diff --git a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns404_response.py b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns404_response.py index 687d8f0c..df9bb43a 100644 --- a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns404_response.py +++ b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns404_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns404_response_errors_inner import ValidateReverseDns404ResponseErrorsInner - +from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns404_response_errors_inner import ( + ValidateReverseDns404ResponseErrorsInner, +) class ValidateReverseDns404Response: def __init__( - self, - errors: Optional[List[ValidateReverseDns404ResponseErrorsInner]]=None + self, errors: Optional[List[ValidateReverseDns404ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ValidateReverseDns404Response( - errors=payload.get('errors') - ) - + return ValidateReverseDns404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns404_response_errors_inner.py b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns404_response_errors_inner.py index 75303308..459ed760 100644 --- a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns404_response_errors_inner.py +++ b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns404_response_errors_inner.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ValidateReverseDns404ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ValidateReverseDns404ResponseErrorsInner( - message=payload.get('message') - ) - + return ValidateReverseDns404ResponseErrorsInner(message=payload.get("message")) diff --git a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns500_response.py b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns500_response.py index 95bb238f..a2b80732 100644 --- a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns500_response.py +++ b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns500_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns500_response_errors_inner import ValidateReverseDns500ResponseErrorsInner - +from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns500_response_errors_inner import ( + ValidateReverseDns500ResponseErrorsInner, +) class ValidateReverseDns500Response: def __init__( - self, - errors: Optional[List[ValidateReverseDns500ResponseErrorsInner]]=None + self, errors: Optional[List[ValidateReverseDns500ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ValidateReverseDns500Response( - errors=payload.get('errors') - ) - + return ValidateReverseDns500Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns500_response_errors_inner.py b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns500_response_errors_inner.py index 23cefef1..73ff71dd 100644 --- a/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns500_response_errors_inner.py +++ b/sendgrid/rest/api/reverse_dns/v3/models/validate_reverse_dns500_response_errors_inner.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ValidateReverseDns500ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ValidateReverseDns500ResponseErrorsInner( - message=payload.get('message') - ) - + return ValidateReverseDns500ResponseErrorsInner(message=payload.get("message")) diff --git a/sendgrid/rest/api/reverse_dns/v3/set_up_reverse_dns.py b/sendgrid/rest/api/reverse_dns/v3/set_up_reverse_dns.py index 313bd433..12cf8b49 100644 --- a/sendgrid/rest/api/reverse_dns/v3/set_up_reverse_dns.py +++ b/sendgrid/rest/api/reverse_dns/v3/set_up_reverse_dns.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.reverse_dns.v3.models.reverse_dns import ReverseDns -from sendgrid.rest.api.reverse_dns.v3.models.set_up_reverse_dns_request import SetUpReverseDnsRequest +from sendgrid.rest.api.reverse_dns.v3.models.set_up_reverse_dns_request import ( + SetUpReverseDnsRequest, +) + class SetUpReverseDns: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - set_up_reverse_dns_request: Optional[SetUpReverseDnsRequest] = None, - + on_behalf_of: Optional[str] = None, + set_up_reverse_dns_request: Optional[SetUpReverseDnsRequest] = None, ): - path='/v3/whitelabel/ips' + path = "/v3/whitelabel/ips" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if set_up_reverse_dns_request: data = set_up_reverse_dns_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/reverse_dns/v3/validate_reverse_dns.py b/sendgrid/rest/api/reverse_dns/v3/validate_reverse_dns.py index 1a677baa..f21442e1 100644 --- a/sendgrid/rest/api/reverse_dns/v3/validate_reverse_dns.py +++ b/sendgrid/rest/api/reverse_dns/v3/validate_reverse_dns.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.reverse_dns.v3.models.validate_reverse_dns200_response import ValidateReverseDns200Response + class ValidateReverseDns: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - on_behalf_of: Optional[str] = None, - + id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/whitelabel/ips/{id}/validate' + path = "/v3/whitelabel/ips/{id}/validate" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='POST', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/scheduled_sends/v3/__init__.py b/sendgrid/rest/api/scheduled_sends/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/__init__.py +++ b/sendgrid/rest/api/scheduled_sends/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/scheduled_sends/v3/create_scheduled_send.py b/sendgrid/rest/api/scheduled_sends/v3/create_scheduled_send.py index 7d2a91b1..e5beed8c 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/create_scheduled_send.py +++ b/sendgrid/rest/api/scheduled_sends/v3/create_scheduled_send.py @@ -12,55 +12,56 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.scheduled_sends.v3.models.cancel_or_pause_a_scheduled_send_request import CancelOrPauseAScheduledSendRequest -from sendgrid.rest.api.scheduled_sends.v3.models.scheduled_send_status import ScheduledSendStatus +from sendgrid.rest.api.scheduled_sends.v3.models.cancel_or_pause_a_scheduled_send_request import ( + CancelOrPauseAScheduledSendRequest, +) + class CreateScheduledSend: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - cancel_or_pause_a_scheduled_send_request: Optional[CancelOrPauseAScheduledSendRequest] = None, - + on_behalf_of: Optional[str] = None, + cancel_or_pause_a_scheduled_send_request: Optional[ + CancelOrPauseAScheduledSendRequest + ] = None, ): - path='/v3/user/scheduled_sends' + path = "/v3/user/scheduled_sends" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if cancel_or_pause_a_scheduled_send_request: data = cancel_or_pause_a_scheduled_send_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/scheduled_sends/v3/delete_scheduled_send.py b/sendgrid/rest/api/scheduled_sends/v3/delete_scheduled_send.py index af513cae..4127722c 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/delete_scheduled_send.py +++ b/sendgrid/rest/api/scheduled_sends/v3/delete_scheduled_send.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteScheduledSend: def __init__(self, client) -> None: self.client = client - + def send( self, - batch_id: str, - on_behalf_of: Optional[str] = None, - + batch_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/user/scheduled_sends/{batch_id}' + path = "/v3/user/scheduled_sends/{batch_id}" path = path.format( - batch_id=batch_id, + batch_id=batch_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/scheduled_sends/v3/get_scheduled_send.py b/sendgrid/rest/api/scheduled_sends/v3/get_scheduled_send.py index b2a65849..21e8a47a 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/get_scheduled_send.py +++ b/sendgrid/rest/api/scheduled_sends/v3/get_scheduled_send.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.scheduled_sends.v3.models.scheduled_send_status import ScheduledSendStatus + class GetScheduledSend: def __init__(self, client) -> None: self.client = client - + def send( self, - batch_id: str, - on_behalf_of: Optional[str] = None, - + batch_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/user/scheduled_sends/{batch_id}' + path = "/v3/user/scheduled_sends/{batch_id}" path = path.format( - batch_id=batch_id, + batch_id=batch_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/scheduled_sends/v3/list_scheduled_send.py b/sendgrid/rest/api/scheduled_sends/v3/list_scheduled_send.py index 17ddf2ac..b01e75e1 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/list_scheduled_send.py +++ b/sendgrid/rest/api/scheduled_sends/v3/list_scheduled_send.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.scheduled_sends.v3.models.scheduled_send_status import ScheduledSendStatus + class ListScheduledSend: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/user/scheduled_sends' + path = "/v3/user/scheduled_sends" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/scheduled_sends/v3/models/__init__.py b/sendgrid/rest/api/scheduled_sends/v3/models/__init__.py index 38e79750..d89f7e04 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/models/__init__.py +++ b/sendgrid/rest/api/scheduled_sends/v3/models/__init__.py @@ -11,16 +11,34 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.scheduled_sends.v3.models.cancel_or_pause_a_scheduled_send_request import CancelOrPauseAScheduledSendRequest +from sendgrid.rest.api.scheduled_sends.v3.models.cancel_or_pause_a_scheduled_send_request import ( + CancelOrPauseAScheduledSendRequest, +) from sendgrid.rest.api.scheduled_sends.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.scheduled_sends.v3.models.error_response_errors_inner import ErrorResponseErrorsInner +from sendgrid.rest.api.scheduled_sends.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) from sendgrid.rest.api.scheduled_sends.v3.models.mail_batch_id import MailBatchId -from sendgrid.rest.api.scheduled_sends.v3.models.scheduled_send_status import ScheduledSendStatus +from sendgrid.rest.api.scheduled_sends.v3.models.scheduled_send_status import ( + ScheduledSendStatus, +) from sendgrid.rest.api.scheduled_sends.v3.models.status import Status from sendgrid.rest.api.scheduled_sends.v3.models.status1 import Status1 from sendgrid.rest.api.scheduled_sends.v3.models.status2 import Status2 -from sendgrid.rest.api.scheduled_sends.v3.models.update_scheduled_send_request import UpdateScheduledSendRequest -__all__ = [ 'CancelOrPauseAScheduledSendRequest', 'ErrorResponse', 'ErrorResponseErrorsInner', 'MailBatchId', 'ScheduledSendStatus', 'Status', 'Status1', 'Status2', 'UpdateScheduledSendRequest' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.scheduled_sends.v3.models.update_scheduled_send_request import ( + UpdateScheduledSendRequest, +) + +__all__ = [ + "CancelOrPauseAScheduledSendRequest", + "ErrorResponse", + "ErrorResponseErrorsInner", + "MailBatchId", + "ScheduledSendStatus", + "Status", + "Status1", + "Status2", + "UpdateScheduledSendRequest", +] +# Testing code diff --git a/sendgrid/rest/api/scheduled_sends/v3/models/cancel_or_pause_a_scheduled_send_request.py b/sendgrid/rest/api/scheduled_sends/v3/models/cancel_or_pause_a_scheduled_send_request.py index b91c2175..bd13b66a 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/models/cancel_or_pause_a_scheduled_send_request.py +++ b/sendgrid/rest/api/scheduled_sends/v3/models/cancel_or_pause_a_scheduled_send_request.py @@ -1,26 +1,19 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.scheduled_sends.v3.models.status import Status - class CancelOrPauseAScheduledSendRequest: - def __init__( - self, - batch_id: Optional[str]=None, - status: Optional[Status]=None - ): - self.batch_id=batch_id - self.status=status + def __init__(self, batch_id: Optional[str] = None, status: Optional[Status] = None): + self.batch_id = batch_id + self.status = status def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "batch_id": self.batch_id, - "status": self.status - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"batch_id": self.batch_id, "status": self.status}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +22,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CancelOrPauseAScheduledSendRequest( - batch_id=payload.get('batch_id'), - status=payload.get('status') - ) - + batch_id=payload.get("batch_id"), status=payload.get("status") + ) diff --git a/sendgrid/rest/api/scheduled_sends/v3/models/error_response.py b/sendgrid/rest/api/scheduled_sends/v3/models/error_response.py index 67934d42..3a4efebc 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/models/error_response.py +++ b/sendgrid/rest/api/scheduled_sends/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.scheduled_sends.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.scheduled_sends.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/scheduled_sends/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/scheduled_sends/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/scheduled_sends/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/scheduled_sends/v3/models/mail_batch_id.py b/sendgrid/rest/api/scheduled_sends/v3/models/mail_batch_id.py index b9847f3f..350826f8 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/models/mail_batch_id.py +++ b/sendgrid/rest/api/scheduled_sends/v3/models/mail_batch_id.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class MailBatchId: - def __init__( - self, - batch_id: Optional[str]=None - ): - self.batch_id=batch_id + def __init__(self, batch_id: Optional[str] = None): + self.batch_id = batch_id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "batch_id": self.batch_id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"batch_id": self.batch_id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return MailBatchId( - batch_id=payload.get('batch_id') - ) - + return MailBatchId(batch_id=payload.get("batch_id")) diff --git a/sendgrid/rest/api/scheduled_sends/v3/models/scheduled_send_status.py b/sendgrid/rest/api/scheduled_sends/v3/models/scheduled_send_status.py index c25b8d4f..4a8c32ca 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/models/scheduled_send_status.py +++ b/sendgrid/rest/api/scheduled_sends/v3/models/scheduled_send_status.py @@ -1,26 +1,21 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.scheduled_sends.v3.models.status2 import Status2 - class ScheduledSendStatus: def __init__( - self, - batch_id: Optional[str]=None, - status: Optional[Status2]=None + self, batch_id: Optional[str] = None, status: Optional[Status2] = None ): - self.batch_id=batch_id - self.status=status + self.batch_id = batch_id + self.status = status def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "batch_id": self.batch_id, - "status": self.status - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"batch_id": self.batch_id, "status": self.status}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +24,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ScheduledSendStatus( - batch_id=payload.get('batch_id'), - status=payload.get('status') - ) - + batch_id=payload.get("batch_id"), status=payload.get("status") + ) diff --git a/sendgrid/rest/api/scheduled_sends/v3/models/status.py b/sendgrid/rest/api/scheduled_sends/v3/models/status.py index 9aaea6f0..140a2a10 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/models/status.py +++ b/sendgrid/rest/api/scheduled_sends/v3/models/status.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Status(Enum): - PAUSE='pause' - CANCEL='cancel' - + PAUSE = "pause" + CANCEL = "cancel" diff --git a/sendgrid/rest/api/scheduled_sends/v3/models/status1.py b/sendgrid/rest/api/scheduled_sends/v3/models/status1.py index 1ce74a51..2dd755fe 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/models/status1.py +++ b/sendgrid/rest/api/scheduled_sends/v3/models/status1.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Status1(Enum): - CANCEL='cancel' - PAUSE='pause' - + CANCEL = "cancel" + PAUSE = "pause" diff --git a/sendgrid/rest/api/scheduled_sends/v3/models/status2.py b/sendgrid/rest/api/scheduled_sends/v3/models/status2.py index 8f83ba2c..8fa7674b 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/models/status2.py +++ b/sendgrid/rest/api/scheduled_sends/v3/models/status2.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Status2(Enum): - CANCEL='cancel' - PAUSE='pause' - + CANCEL = "cancel" + PAUSE = "pause" diff --git a/sendgrid/rest/api/scheduled_sends/v3/models/update_scheduled_send_request.py b/sendgrid/rest/api/scheduled_sends/v3/models/update_scheduled_send_request.py index 663fd686..49ed44d7 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/models/update_scheduled_send_request.py +++ b/sendgrid/rest/api/scheduled_sends/v3/models/update_scheduled_send_request.py @@ -1,23 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.scheduled_sends.v3.models.status1 import Status1 - class UpdateScheduledSendRequest: - def __init__( - self, - status: Optional[Status1]=None - ): - self.status=status + def __init__(self, status: Optional[Status1] = None): + self.status = status def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "status": self.status - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"status": self.status}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateScheduledSendRequest( - status=payload.get('status') - ) - + return UpdateScheduledSendRequest(status=payload.get("status")) diff --git a/sendgrid/rest/api/scheduled_sends/v3/update_scheduled_send.py b/sendgrid/rest/api/scheduled_sends/v3/update_scheduled_send.py index 4441a379..a26567ce 100644 --- a/sendgrid/rest/api/scheduled_sends/v3/update_scheduled_send.py +++ b/sendgrid/rest/api/scheduled_sends/v3/update_scheduled_send.py @@ -12,58 +12,58 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.scheduled_sends.v3.models.update_scheduled_send_request import UpdateScheduledSendRequest +from sendgrid.rest.api.scheduled_sends.v3.models.update_scheduled_send_request import ( + UpdateScheduledSendRequest, +) + class UpdateScheduledSend: def __init__(self, client) -> None: self.client = client - + def send( self, - batch_id: str, - on_behalf_of: Optional[str] = None, - update_scheduled_send_request: Optional[UpdateScheduledSendRequest] = None, - + batch_id: str, + on_behalf_of: Optional[str] = None, + update_scheduled_send_request: Optional[UpdateScheduledSendRequest] = None, ): - path='/v3/user/scheduled_sends/{batch_id}' + path = "/v3/user/scheduled_sends/{batch_id}" path = path.format( - batch_id=batch_id, + batch_id=batch_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_scheduled_send_request: data = update_scheduled_send_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/scopes/v3/__init__.py b/sendgrid/rest/api/scopes/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/scopes/v3/__init__.py +++ b/sendgrid/rest/api/scopes/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/scopes/v3/approve_scope_request.py b/sendgrid/rest/api/scopes/v3/approve_scope_request.py index 65b4951c..441d0ada 100644 --- a/sendgrid/rest/api/scopes/v3/approve_scope_request.py +++ b/sendgrid/rest/api/scopes/v3/approve_scope_request.py @@ -12,48 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.scopes.v3.models.approve_scope_request200_response import ApproveScopeRequest200Response class ApproveScopeRequest: def __init__(self, client) -> None: self.client = client - + def send( self, - request_id: str, - + request_id: str, ): - path='/v3/scopes/requests/{request_id}/approve' + path = "/v3/scopes/requests/{request_id}/approve" path = path.format( - request_id=request_id, + request_id=request_id, ) data = None - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/scopes/v3/deny_scope_request.py b/sendgrid/rest/api/scopes/v3/deny_scope_request.py index 64ab6b3c..702f5f3d 100644 --- a/sendgrid/rest/api/scopes/v3/deny_scope_request.py +++ b/sendgrid/rest/api/scopes/v3/deny_scope_request.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated class DenyScopeRequest: def __init__(self, client) -> None: self.client = client - + def send( self, - request_id: str, - + request_id: str, ): - path='/v3/scopes/requests/{request_id}' + path = "/v3/scopes/requests/{request_id}" path = path.format( - request_id=request_id, + request_id=request_id, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/scopes/v3/list_scope.py b/sendgrid/rest/api/scopes/v3/list_scope.py index 608c4885..b2adbcc1 100644 --- a/sendgrid/rest/api/scopes/v3/list_scope.py +++ b/sendgrid/rest/api/scopes/v3/list_scope.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.scopes.v3.models.list_scope200_response import ListScope200Response + class ListScope: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/scopes' + path = "/v3/scopes" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/scopes/v3/list_scope_request.py b/sendgrid/rest/api/scopes/v3/list_scope_request.py index 479f0412..aac12222 100644 --- a/sendgrid/rest/api/scopes/v3/list_scope_request.py +++ b/sendgrid/rest/api/scopes/v3/list_scope_request.py @@ -12,47 +12,42 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.scopes.v3.models.list_scope_request200_response_inner import ListScopeRequest200ResponseInner + class ListScopeRequest: def __init__(self, client) -> None: self.client = client - + def send( self, - limit: Optional[int] = None, - offset: Optional[int] = None, - + limit: Optional[int] = None, + offset: Optional[int] = None, ): - path='/v3/scopes/requests' + path = "/v3/scopes/requests" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/scopes/v3/models/__init__.py b/sendgrid/rest/api/scopes/v3/models/__init__.py index 2cc76be3..832161e1 100644 --- a/sendgrid/rest/api/scopes/v3/models/__init__.py +++ b/sendgrid/rest/api/scopes/v3/models/__init__.py @@ -11,16 +11,42 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.scopes.v3.models.approve_scope_request200_response import ApproveScopeRequest200Response -from sendgrid.rest.api.scopes.v3.models.deny_scope_request404_response import DenyScopeRequest404Response -from sendgrid.rest.api.scopes.v3.models.deny_scope_request404_response_errors_inner import DenyScopeRequest404ResponseErrorsInner +from sendgrid.rest.api.scopes.v3.models.approve_scope_request200_response import ( + ApproveScopeRequest200Response, +) +from sendgrid.rest.api.scopes.v3.models.deny_scope_request404_response import ( + DenyScopeRequest404Response, +) +from sendgrid.rest.api.scopes.v3.models.deny_scope_request404_response_errors_inner import ( + DenyScopeRequest404ResponseErrorsInner, +) from sendgrid.rest.api.scopes.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.scopes.v3.models.error_response_errors_inner import ErrorResponseErrorsInner -from sendgrid.rest.api.scopes.v3.models.list_scope200_response import ListScope200Response -from sendgrid.rest.api.scopes.v3.models.list_scope401_response import ListScope401Response -from sendgrid.rest.api.scopes.v3.models.list_scope401_response_errors_inner import ListScope401ResponseErrorsInner -from sendgrid.rest.api.scopes.v3.models.list_scope_request200_response_inner import ListScopeRequest200ResponseInner -__all__ = [ 'ApproveScopeRequest200Response', 'DenyScopeRequest404Response', 'DenyScopeRequest404ResponseErrorsInner', 'ErrorResponse', 'ErrorResponseErrorsInner', 'ListScope200Response', 'ListScope401Response', 'ListScope401ResponseErrorsInner', 'ListScopeRequest200ResponseInner' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.scopes.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) +from sendgrid.rest.api.scopes.v3.models.list_scope200_response import ( + ListScope200Response, +) +from sendgrid.rest.api.scopes.v3.models.list_scope401_response import ( + ListScope401Response, +) +from sendgrid.rest.api.scopes.v3.models.list_scope401_response_errors_inner import ( + ListScope401ResponseErrorsInner, +) +from sendgrid.rest.api.scopes.v3.models.list_scope_request200_response_inner import ( + ListScopeRequest200ResponseInner, +) + +__all__ = [ + "ApproveScopeRequest200Response", + "DenyScopeRequest404Response", + "DenyScopeRequest404ResponseErrorsInner", + "ErrorResponse", + "ErrorResponseErrorsInner", + "ListScope200Response", + "ListScope401Response", + "ListScope401ResponseErrorsInner", + "ListScopeRequest200ResponseInner", +] +# Testing code diff --git a/sendgrid/rest/api/scopes/v3/models/approve_scope_request200_response.py b/sendgrid/rest/api/scopes/v3/models/approve_scope_request200_response.py index d48c76ef..b9c822d1 100644 --- a/sendgrid/rest/api/scopes/v3/models/approve_scope_request200_response.py +++ b/sendgrid/rest/api/scopes/v3/models/approve_scope_request200_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ApproveScopeRequest200Response: - def __init__( - self, - scope_group_name: Optional[str]=None - ): - self.scope_group_name=scope_group_name + def __init__(self, scope_group_name: Optional[str] = None): + self.scope_group_name = scope_group_name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "scope_group_name": self.scope_group_name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"scope_group_name": self.scope_group_name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,6 +20,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ApproveScopeRequest200Response( - scope_group_name=payload.get('scope_group_name') - ) - + scope_group_name=payload.get("scope_group_name") + ) diff --git a/sendgrid/rest/api/scopes/v3/models/deny_scope_request404_response.py b/sendgrid/rest/api/scopes/v3/models/deny_scope_request404_response.py index 6ac58595..8e2ff9ba 100644 --- a/sendgrid/rest/api/scopes/v3/models/deny_scope_request404_response.py +++ b/sendgrid/rest/api/scopes/v3/models/deny_scope_request404_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.scopes.v3.models.deny_scope_request404_response_errors_inner import DenyScopeRequest404ResponseErrorsInner - +from sendgrid.rest.api.scopes.v3.models.deny_scope_request404_response_errors_inner import ( + DenyScopeRequest404ResponseErrorsInner, +) class DenyScopeRequest404Response: def __init__( - self, - errors: Optional[List[DenyScopeRequest404ResponseErrorsInner]]=None + self, errors: Optional[List[DenyScopeRequest404ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DenyScopeRequest404Response( - errors=payload.get('errors') - ) - + return DenyScopeRequest404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/scopes/v3/models/deny_scope_request404_response_errors_inner.py b/sendgrid/rest/api/scopes/v3/models/deny_scope_request404_response_errors_inner.py index 96c0d5d1..4865c12e 100644 --- a/sendgrid/rest/api/scopes/v3/models/deny_scope_request404_response_errors_inner.py +++ b/sendgrid/rest/api/scopes/v3/models/deny_scope_request404_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DenyScopeRequest404ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None - ): - self.message=message - self.field=field + def __init__(self, message: Optional[str] = None, field: Optional[str] = None): + self.message = message + self.field = field def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message, - "field": self.field - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message, "field": self.field}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return DenyScopeRequest404ResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field') - ) - + message=payload.get("message"), field=payload.get("field") + ) diff --git a/sendgrid/rest/api/scopes/v3/models/error_response.py b/sendgrid/rest/api/scopes/v3/models/error_response.py index a5b83587..cbbfd0f1 100644 --- a/sendgrid/rest/api/scopes/v3/models/error_response.py +++ b/sendgrid/rest/api/scopes/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.scopes.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.scopes.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/scopes/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/scopes/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/scopes/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/scopes/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/scopes/v3/models/list_scope200_response.py b/sendgrid/rest/api/scopes/v3/models/list_scope200_response.py index c2b81bf5..64ff65a7 100644 --- a/sendgrid/rest/api/scopes/v3/models/list_scope200_response.py +++ b/sendgrid/rest/api/scopes/v3/models/list_scope200_response.py @@ -1,22 +1,17 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListScope200Response: - def __init__( - self, - scopes: Optional[List[str]]=None - ): - self.scopes=scopes + def __init__(self, scopes: Optional[List[str]] = None): + self.scopes = scopes def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "scopes": self.scopes - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"scopes": self.scopes}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListScope200Response( - scopes=payload.get('scopes') - ) - + return ListScope200Response(scopes=payload.get("scopes")) diff --git a/sendgrid/rest/api/scopes/v3/models/list_scope401_response.py b/sendgrid/rest/api/scopes/v3/models/list_scope401_response.py index 0069a7d5..eec5ffd9 100644 --- a/sendgrid/rest/api/scopes/v3/models/list_scope401_response.py +++ b/sendgrid/rest/api/scopes/v3/models/list_scope401_response.py @@ -1,23 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.scopes.v3.models.list_scope401_response_errors_inner import ListScope401ResponseErrorsInner - +from sendgrid.rest.api.scopes.v3.models.list_scope401_response_errors_inner import ( + ListScope401ResponseErrorsInner, +) class ListScope401Response: - def __init__( - self, - errors: Optional[List[ListScope401ResponseErrorsInner]]=None - ): - self.errors=errors + def __init__(self, errors: Optional[List[ListScope401ResponseErrorsInner]] = None): + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListScope401Response( - errors=payload.get('errors') - ) - + return ListScope401Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/scopes/v3/models/list_scope401_response_errors_inner.py b/sendgrid/rest/api/scopes/v3/models/list_scope401_response_errors_inner.py index 6aac8d5a..e4368e54 100644 --- a/sendgrid/rest/api/scopes/v3/models/list_scope401_response_errors_inner.py +++ b/sendgrid/rest/api/scopes/v3/models/list_scope401_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListScope401ResponseErrorsInner: - def __init__( - self, - field: Optional[str]=None, - message: Optional[str]=None - ): - self.field=field - self.message=message + def __init__(self, field: Optional[str] = None, message: Optional[str] = None): + self.field = field + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "field": self.field, - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"field": self.field, "message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListScope401ResponseErrorsInner( - field=payload.get('field'), - message=payload.get('message') - ) - + field=payload.get("field"), message=payload.get("message") + ) diff --git a/sendgrid/rest/api/scopes/v3/models/list_scope_request200_response_inner.py b/sendgrid/rest/api/scopes/v3/models/list_scope_request200_response_inner.py index 01f26368..be3b62c5 100644 --- a/sendgrid/rest/api/scopes/v3/models/list_scope_request200_response_inner.py +++ b/sendgrid/rest/api/scopes/v3/models/list_scope_request200_response_inner.py @@ -1,37 +1,37 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListScopeRequest200ResponseInner: def __init__( - self, - id: Optional[int]=None, - scope_group_name: Optional[str]=None, - username: Optional[str]=None, - email: Optional[str]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None + self, + id: Optional[int] = None, + scope_group_name: Optional[str] = None, + username: Optional[str] = None, + email: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, ): - self.id=id - self.scope_group_name=scope_group_name - self.username=username - self.email=email - self.first_name=first_name - self.last_name=last_name + self.id = id + self.scope_group_name = scope_group_name + self.username = username + self.email = email + self.first_name = first_name + self.last_name = last_name def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "scope_group_name": self.scope_group_name, - "username": self.username, - "email": self.email, - "first_name": self.first_name, - "last_name": self.last_name - }.items() if value is not None} + "id": self.id, + "scope_group_name": self.scope_group_name, + "username": self.username, + "email": self.email, + "first_name": self.first_name, + "last_name": self.last_name, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -40,11 +40,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListScopeRequest200ResponseInner( - id=payload.get('id'), - scope_group_name=payload.get('scope_group_name'), - username=payload.get('username'), - email=payload.get('email'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name') - ) - + id=payload.get("id"), + scope_group_name=payload.get("scope_group_name"), + username=payload.get("username"), + email=payload.get("email"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + ) diff --git a/sendgrid/rest/api/seq/v3/__init__.py b/sendgrid/rest/api/seq/v3/__init__.py new file mode 100644 index 00000000..46409041 --- /dev/null +++ b/sendgrid/rest/api/seq/v3/__init__.py @@ -0,0 +1 @@ +# TODO diff --git a/sendgrid/rest/api/seq/v3/list_engagement_quality_score.py b/sendgrid/rest/api/seq/v3/list_engagement_quality_score.py new file mode 100644 index 00000000..7857ab9b --- /dev/null +++ b/sendgrid/rest/api/seq/v3/list_engagement_quality_score.py @@ -0,0 +1,61 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Engagement Quality API + The SendGrid Engagement Quality (SEQ) API allows you to retrieve metrics that define the quality of your email program. An SEQ score is correlated with: - The quality of the data in a sender’s program. - How “wanted” the sender's email is by their recipients. Because “wanted” email and deliverability are closely related, a higher SEQ metric is correlated with greater deliverability. This means the higher your SEQ score, the more likely you are to land in your recipients' inboxes. See the SEQ Overview page to understand SEQ, how it's calculated, and how you can address your score. The SEQ endpoints allow you to retrieve your scores and scores for your Subusers. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from datetime import date +from typing import Optional + + +class ListEngagementQualityScore: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + var_from: Optional[date] = None, + to: Optional[date] = None, + ): + path = "/v3/engagementquality/scores" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/seq/v3/list_subuser_engagement_quality_score.py b/sendgrid/rest/api/seq/v3/list_subuser_engagement_quality_score.py new file mode 100644 index 00000000..76b269e3 --- /dev/null +++ b/sendgrid/rest/api/seq/v3/list_subuser_engagement_quality_score.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Engagement Quality API + The SendGrid Engagement Quality (SEQ) API allows you to retrieve metrics that define the quality of your email program. An SEQ score is correlated with: - The quality of the data in a sender’s program. - How “wanted” the sender's email is by their recipients. Because “wanted” email and deliverability are closely related, a higher SEQ metric is correlated with greater deliverability. This means the higher your SEQ score, the more likely you are to land in your recipients' inboxes. See the SEQ Overview page to understand SEQ, how it's calculated, and how you can address your score. The SEQ endpoints allow you to retrieve your scores and scores for your Subusers. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from datetime import date +from typing import Optional + + +class ListSubuserEngagementQualityScore: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + limit: Optional[int] = None, + var_date: Optional[date] = None, + after_key: Optional[int] = None, + ): + path = "/v3/engagementquality/subusers/scores" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/seq/v3/models/__init__.py b/sendgrid/rest/api/seq/v3/models/__init__.py new file mode 100644 index 00000000..cdaa354f --- /dev/null +++ b/sendgrid/rest/api/seq/v3/models/__init__.py @@ -0,0 +1,24 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Engagement Quality API + The SendGrid Engagement Quality (SEQ) API allows you to retrieve metrics that define the quality of your email program. An SEQ score is correlated with: - The quality of the data in a sender’s program. - How “wanted” the sender's email is by their recipients. Because “wanted” email and deliverability are closely related, a higher SEQ metric is correlated with greater deliverability. This means the higher your SEQ score, the more likely you are to land in your recipients' inboxes. See the SEQ Overview page to understand SEQ, how it's calculated, and how you can address your score. The SEQ endpoints allow you to retrieve your scores and scores for your Subusers. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +# import models into model package +from sendgrid.rest.api.seq.v3.models.seq_error import SeqError +from sendgrid.rest.api.seq.v3.models.seq_metadata import SeqMetadata +from sendgrid.rest.api.seq.v3.models.seq_metadata_next_params import ( + SeqMetadataNextParams, +) +from sendgrid.rest.api.seq.v3.models.seq_metrics import SeqMetrics +from sendgrid.rest.api.seq.v3.models.seq_score import SeqScore + +__all__ = ["SeqError", "SeqMetadata", "SeqMetadataNextParams", "SeqMetrics", "SeqScore"] +# Testing code diff --git a/sendgrid/rest/api/seq/v3/models/seq_error.py b/sendgrid/rest/api/seq/v3/models/seq_error.py new file mode 100644 index 00000000..99a4da74 --- /dev/null +++ b/sendgrid/rest/api/seq/v3/models/seq_error.py @@ -0,0 +1,23 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class SeqError: + def __init__(self, field: Optional[str] = None, message: Optional[str] = None): + self.field = field + self.message = message + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"field": self.field, "message": self.message}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SeqError(field=payload.get("field"), message=payload.get("message")) diff --git a/sendgrid/rest/api/seq/v3/models/seq_metadata.py b/sendgrid/rest/api/seq/v3/models/seq_metadata.py new file mode 100644 index 00000000..2e0a80f7 --- /dev/null +++ b/sendgrid/rest/api/seq/v3/models/seq_metadata.py @@ -0,0 +1,25 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.seq.v3.models.seq_metadata_next_params import ( + SeqMetadataNextParams, +) + + +class SeqMetadata: + def __init__(self, next_params: Optional[SeqMetadataNextParams] = None): + self.next_params = next_params + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"next_params": self.next_params}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SeqMetadata(next_params=payload.get("next_params")) diff --git a/sendgrid/rest/api/seq/v3/models/seq_metadata_next_params.py b/sendgrid/rest/api/seq/v3/models/seq_metadata_next_params.py new file mode 100644 index 00000000..3688fcd8 --- /dev/null +++ b/sendgrid/rest/api/seq/v3/models/seq_metadata_next_params.py @@ -0,0 +1,22 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class SeqMetadataNextParams: + def __init__(self, after_key: Optional[str] = None): + self.after_key = after_key + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"after_key": self.after_key}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SeqMetadataNextParams(after_key=payload.get("after_key")) diff --git a/sendgrid/rest/api/seq/v3/models/seq_metrics.py b/sendgrid/rest/api/seq/v3/models/seq_metrics.py new file mode 100644 index 00000000..1a4dc111 --- /dev/null +++ b/sendgrid/rest/api/seq/v3/models/seq_metrics.py @@ -0,0 +1,45 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class SeqMetrics: + def __init__( + self, + engagement_recency: Optional[float] = None, + open_rate: Optional[float] = None, + bounce_classification: Optional[float] = None, + bounce_rate: Optional[float] = None, + spam_rate: Optional[float] = None, + ): + self.engagement_recency = engagement_recency + self.open_rate = open_rate + self.bounce_classification = bounce_classification + self.bounce_rate = bounce_rate + self.spam_rate = spam_rate + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "engagement_recency": self.engagement_recency, + "open_rate": self.open_rate, + "bounce_classification": self.bounce_classification, + "bounce_rate": self.bounce_rate, + "spam_rate": self.spam_rate, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SeqMetrics( + engagement_recency=payload.get("engagement_recency"), + open_rate=payload.get("open_rate"), + bounce_classification=payload.get("bounce_classification"), + bounce_rate=payload.get("bounce_rate"), + spam_rate=payload.get("spam_rate"), + ) diff --git a/sendgrid/rest/api/seq/v3/models/seq_score.py b/sendgrid/rest/api/seq/v3/models/seq_score.py new file mode 100644 index 00000000..b51e3eed --- /dev/null +++ b/sendgrid/rest/api/seq/v3/models/seq_score.py @@ -0,0 +1,46 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.seq.v3.models.seq_metrics import SeqMetrics + + +class SeqScore: + def __init__( + self, + user_id: Optional[str] = None, + username: Optional[str] = None, + var_date: Optional[date] = None, + score: Optional[float] = None, + metrics: Optional[SeqMetrics] = None, + ): + self.user_id = user_id + self.username = username + self.var_date = var_date + self.score = score + self.metrics = metrics + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "user_id": self.user_id, + "username": self.username, + "date": self.var_date, + "score": self.score, + "metrics": self.metrics, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SeqScore( + user_id=payload.get("user_id"), + username=payload.get("username"), + var_date=payload.get("date"), + score=payload.get("score"), + metrics=payload.get("metrics"), + ) diff --git a/sendgrid/rest/api/sso/v3/__init__.py b/sendgrid/rest/api/sso/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/sso/v3/__init__.py +++ b/sendgrid/rest/api/sso/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/sso/v3/create_sso_certificate.py b/sendgrid/rest/api/sso/v3/create_sso_certificate.py index 6e68d6a6..cb38af94 100644 --- a/sendgrid/rest/api/sso/v3/create_sso_certificate.py +++ b/sendgrid/rest/api/sso/v3/create_sso_certificate.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.sso.v3.models.create_sso_certificate_request import CreateSsoCertificateRequest -from sendgrid.rest.api.sso.v3.models.sso_certificate_body import SsoCertificateBody +from sendgrid.rest.api.sso.v3.models.create_sso_certificate_request import ( + CreateSsoCertificateRequest, +) + class CreateSsoCertificate: def __init__(self, client) -> None: self.client = client - + def send( self, - create_sso_certificate_request: Optional[CreateSsoCertificateRequest] = None, - + create_sso_certificate_request: Optional[CreateSsoCertificateRequest] = None, ): - path='/v3/sso/certificates' + path = "/v3/sso/certificates" data = None if create_sso_certificate_request: data = create_sso_certificate_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/sso/v3/create_sso_integration.py b/sendgrid/rest/api/sso/v3/create_sso_integration.py index a402c98a..99ba3356 100644 --- a/sendgrid/rest/api/sso/v3/create_sso_integration.py +++ b/sendgrid/rest/api/sso/v3/create_sso_integration.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.sso.v3.models.post_patch_integration_request import PostPatchIntegrationRequest -from sendgrid.rest.api.sso.v3.models.sso_integration import SsoIntegration +from sendgrid.rest.api.sso.v3.models.post_patch_integration_request import ( + PostPatchIntegrationRequest, +) + class CreateSsoIntegration: def __init__(self, client) -> None: self.client = client - + def send( self, - post_patch_integration_request: Optional[PostPatchIntegrationRequest] = None, - + post_patch_integration_request: Optional[PostPatchIntegrationRequest] = None, ): - path='/v3/sso/integrations' + path = "/v3/sso/integrations" data = None if post_patch_integration_request: data = post_patch_integration_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/sso/v3/create_sso_teammate.py b/sendgrid/rest/api/sso/v3/create_sso_teammate.py index 00ab697f..7a0beb08 100644 --- a/sendgrid/rest/api/sso/v3/create_sso_teammate.py +++ b/sendgrid/rest/api/sso/v3/create_sso_teammate.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.sso.v3.models.post_sso_teammates201 import PostSsoTeammates201 -from sendgrid.rest.api.sso.v3.models.post_sso_teammates_request import PostSsoTeammatesRequest +from sendgrid.rest.api.sso.v3.models.post_sso_teammates_request import ( + PostSsoTeammatesRequest, +) + class CreateSsoTeammate: def __init__(self, client) -> None: self.client = client - + def send( self, - post_sso_teammates_request: Optional[PostSsoTeammatesRequest] = None, - + post_sso_teammates_request: Optional[PostSsoTeammatesRequest] = None, ): - path='/v3/sso/teammates' + path = "/v3/sso/teammates" data = None if post_sso_teammates_request: data = post_sso_teammates_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/sso/v3/delete_sso_certificate.py b/sendgrid/rest/api/sso/v3/delete_sso_certificate.py index 0d0dad77..b5a5d381 100644 --- a/sendgrid/rest/api/sso/v3/delete_sso_certificate.py +++ b/sendgrid/rest/api/sso/v3/delete_sso_certificate.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr -from sendgrid.rest.api.sso.v3.models.sso_certificate_body import SsoCertificateBody class DeleteSsoCertificate: def __init__(self, client) -> None: self.client = client - + def send( self, - cert_id: str, - + cert_id: str, ): - path='/v3/sso/certificates/{cert_id}' + path = "/v3/sso/certificates/{cert_id}" path = path.format( - cert_id=cert_id, + cert_id=cert_id, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/sso/v3/delete_sso_integration.py b/sendgrid/rest/api/sso/v3/delete_sso_integration.py index 00142270..7a4ced34 100644 --- a/sendgrid/rest/api/sso/v3/delete_sso_integration.py +++ b/sendgrid/rest/api/sso/v3/delete_sso_integration.py @@ -12,46 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr class DeleteSsoIntegration: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - + id: str, ): - path='/v3/sso/integrations/{id}' + path = "/v3/sso/integrations/{id}" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/sso/v3/get_sso_certificate.py b/sendgrid/rest/api/sso/v3/get_sso_certificate.py index 11183589..edd59adb 100644 --- a/sendgrid/rest/api/sso/v3/get_sso_certificate.py +++ b/sendgrid/rest/api/sso/v3/get_sso_certificate.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr -from sendgrid.rest.api.sso.v3.models.sso_certificate_body import SsoCertificateBody class GetSsoCertificate: def __init__(self, client) -> None: self.client = client - + def send( self, - cert_id: str, - + cert_id: str, ): - path='/v3/sso/certificates/{cert_id}' + path = "/v3/sso/certificates/{cert_id}" path = path.format( - cert_id=cert_id, + cert_id=cert_id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/sso/v3/get_sso_integration.py b/sendgrid/rest/api/sso/v3/get_sso_integration.py index 298b5428..9217b39c 100644 --- a/sendgrid/rest/api/sso/v3/get_sso_integration.py +++ b/sendgrid/rest/api/sso/v3/get_sso_integration.py @@ -12,50 +12,45 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.sso.v3.models.sso_integration import SsoIntegration + class GetSsoIntegration: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - si: Optional[bool] = None, - + id: str, + si: Optional[bool] = None, ): - path='/v3/sso/integrations/{id}' + path = "/v3/sso/integrations/{id}" path = path.format( - id=id, + id=id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/sso/v3/list_sso_integration.py b/sendgrid/rest/api/sso/v3/list_sso_integration.py index cbaa1c69..9f43967d 100644 --- a/sendgrid/rest/api/sso/v3/list_sso_integration.py +++ b/sendgrid/rest/api/sso/v3/list_sso_integration.py @@ -12,46 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.sso.v3.models.sso_integration import SsoIntegration + class ListSsoIntegration: def __init__(self, client) -> None: self.client = client - + def send( self, - si: Optional[bool] = None, - + si: Optional[bool] = None, ): - path='/v3/sso/integrations' + path = "/v3/sso/integrations" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/sso/v3/list_sso_integration_certificate.py b/sendgrid/rest/api/sso/v3/list_sso_integration_certificate.py index f72175f3..07cc660e 100644 --- a/sendgrid/rest/api/sso/v3/list_sso_integration_certificate.py +++ b/sendgrid/rest/api/sso/v3/list_sso_integration_certificate.py @@ -12,48 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.sso.v3.models.sso_certificate_body import SsoCertificateBody class ListSsoIntegrationCertificate: def __init__(self, client) -> None: self.client = client - + def send( self, - integration_id: str, - + integration_id: str, ): - path='/v3/sso/integrations/{integration_id}/certificates' + path = "/v3/sso/integrations/{integration_id}/certificates" path = path.format( - integration_id=integration_id, + integration_id=integration_id, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/sso/v3/models/__init__.py b/sendgrid/rest/api/sso/v3/models/__init__.py index 730d167b..218c5fef 100644 --- a/sendgrid/rest/api/sso/v3/models/__init__.py +++ b/sendgrid/rest/api/sso/v3/models/__init__.py @@ -11,25 +11,64 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.sso.v3.models.create_sso_certificate_request import CreateSsoCertificateRequest +from sendgrid.rest.api.sso.v3.models.create_sso_certificate_request import ( + CreateSsoCertificateRequest, +) from sendgrid.rest.api.sso.v3.models.patch_sso_teammates200 import PatchSsoTeammates200 from sendgrid.rest.api.sso.v3.models.permission_type import PermissionType from sendgrid.rest.api.sso.v3.models.permission_type1 import PermissionType1 from sendgrid.rest.api.sso.v3.models.persona import Persona -from sendgrid.rest.api.sso.v3.models.post_patch_integration_request import PostPatchIntegrationRequest +from sendgrid.rest.api.sso.v3.models.post_patch_integration_request import ( + PostPatchIntegrationRequest, +) from sendgrid.rest.api.sso.v3.models.post_sso_teammates201 import PostSsoTeammates201 -from sendgrid.rest.api.sso.v3.models.post_sso_teammates_request import PostSsoTeammatesRequest +from sendgrid.rest.api.sso.v3.models.post_sso_teammates_request import ( + PostSsoTeammatesRequest, +) from sendgrid.rest.api.sso.v3.models.sso_certificate_body import SsoCertificateBody -from sendgrid.rest.api.sso.v3.models.sso_error_response_inner import SsoErrorResponseInner +from sendgrid.rest.api.sso.v3.models.sso_error_response_inner import ( + SsoErrorResponseInner, +) from sendgrid.rest.api.sso.v3.models.sso_integration import SsoIntegration -from sendgrid.rest.api.sso.v3.models.sso_teammates_base_request_props import SsoTeammatesBaseRequestProps -from sendgrid.rest.api.sso.v3.models.sso_teammates_base_request_props_subuser_access_inner import SsoTeammatesBaseRequestPropsSubuserAccessInner -from sendgrid.rest.api.sso.v3.models.sso_teammates_base_response_props import SsoTeammatesBaseResponseProps -from sendgrid.rest.api.sso.v3.models.sso_teammates_restricted_subuser_response_props import SsoTeammatesRestrictedSubuserResponseProps -from sendgrid.rest.api.sso.v3.models.sso_teammates_restricted_subuser_response_props_subuser_access_inner import SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner -from sendgrid.rest.api.sso.v3.models.update_sso_certificate_request import UpdateSsoCertificateRequest +from sendgrid.rest.api.sso.v3.models.sso_teammates_base_request_props import ( + SsoTeammatesBaseRequestProps, +) +from sendgrid.rest.api.sso.v3.models.sso_teammates_base_request_props_subuser_access_inner import ( + SsoTeammatesBaseRequestPropsSubuserAccessInner, +) +from sendgrid.rest.api.sso.v3.models.sso_teammates_base_response_props import ( + SsoTeammatesBaseResponseProps, +) +from sendgrid.rest.api.sso.v3.models.sso_teammates_restricted_subuser_response_props import ( + SsoTeammatesRestrictedSubuserResponseProps, +) +from sendgrid.rest.api.sso.v3.models.sso_teammates_restricted_subuser_response_props_subuser_access_inner import ( + SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner, +) +from sendgrid.rest.api.sso.v3.models.update_sso_certificate_request import ( + UpdateSsoCertificateRequest, +) from sendgrid.rest.api.sso.v3.models.user_type import UserType -__all__ = [ 'CreateSsoCertificateRequest', 'PatchSsoTeammates200', 'PermissionType', 'PermissionType1', 'Persona', 'PostPatchIntegrationRequest', 'PostSsoTeammates201', 'PostSsoTeammatesRequest', 'SsoCertificateBody', 'SsoErrorResponseInner', 'SsoIntegration', 'SsoTeammatesBaseRequestProps', 'SsoTeammatesBaseRequestPropsSubuserAccessInner', 'SsoTeammatesBaseResponseProps', 'SsoTeammatesRestrictedSubuserResponseProps', 'SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner', 'UpdateSsoCertificateRequest', 'UserType' ] -# Testing code \ No newline at end of file + +__all__ = [ + "CreateSsoCertificateRequest", + "PatchSsoTeammates200", + "PermissionType", + "PermissionType1", + "Persona", + "PostPatchIntegrationRequest", + "PostSsoTeammates201", + "PostSsoTeammatesRequest", + "SsoCertificateBody", + "SsoErrorResponseInner", + "SsoIntegration", + "SsoTeammatesBaseRequestProps", + "SsoTeammatesBaseRequestPropsSubuserAccessInner", + "SsoTeammatesBaseResponseProps", + "SsoTeammatesRestrictedSubuserResponseProps", + "SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner", + "UpdateSsoCertificateRequest", + "UserType", +] +# Testing code diff --git a/sendgrid/rest/api/sso/v3/models/create_sso_certificate_request.py b/sendgrid/rest/api/sso/v3/models/create_sso_certificate_request.py index 32491e8c..28a144e1 100644 --- a/sendgrid/rest/api/sso/v3/models/create_sso_certificate_request.py +++ b/sendgrid/rest/api/sso/v3/models/create_sso_certificate_request.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateSsoCertificateRequest: def __init__( - self, - public_certificate: Optional[str]=None, - enabled: Optional[bool]=None, - integration_id: Optional[str]=None + self, + public_certificate: Optional[str] = None, + enabled: Optional[bool] = None, + integration_id: Optional[str] = None, ): - self.public_certificate=public_certificate - self.enabled=enabled - self.integration_id=integration_id + self.public_certificate = public_certificate + self.enabled = enabled + self.integration_id = integration_id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "public_certificate": self.public_certificate, - "enabled": self.enabled, - "integration_id": self.integration_id - }.items() if value is not None} + "public_certificate": self.public_certificate, + "enabled": self.enabled, + "integration_id": self.integration_id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateSsoCertificateRequest( - public_certificate=payload.get('public_certificate'), - enabled=payload.get('enabled'), - integration_id=payload.get('integration_id') - ) - + public_certificate=payload.get("public_certificate"), + enabled=payload.get("enabled"), + integration_id=payload.get("integration_id"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/patch_sso_teammates200.py b/sendgrid/rest/api/sso/v3/models/patch_sso_teammates200.py index 8f8d44af..9b6d733e 100644 --- a/sendgrid/rest/api/sso/v3/models/patch_sso_teammates200.py +++ b/sendgrid/rest/api/sso/v3/models/patch_sso_teammates200.py @@ -1,78 +1,82 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.sso.v3.models.sso_teammates_restricted_subuser_response_props_subuser_access_inner import SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner +from sendgrid.rest.api.sso.v3.models.sso_teammates_restricted_subuser_response_props_subuser_access_inner import ( + SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner, +) from sendgrid.rest.api.sso.v3.models.user_type import UserType - class PatchSsoTeammates200: def __init__( - self, - address: Optional[str]=None, - address2: Optional[str]=None, - city: Optional[str]=None, - company: Optional[str]=None, - country: Optional[str]=None, - username: Optional[str]=None, - phone: Optional[str]=None, - state: Optional[str]=None, - user_type: Optional[UserType]=None, - website: Optional[str]=None, - zip: Optional[str]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - email: Optional[str]=None, - is_admin: Optional[bool]=None, - is_sso: Optional[bool]=None, - scopes: Optional[List[str]]=None, - has_restricted_subuser_access: Optional[bool]=None, - subuser_access: Optional[List[SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner]]=None + self, + address: Optional[str] = None, + address2: Optional[str] = None, + city: Optional[str] = None, + company: Optional[str] = None, + country: Optional[str] = None, + username: Optional[str] = None, + phone: Optional[str] = None, + state: Optional[str] = None, + user_type: Optional[UserType] = None, + website: Optional[str] = None, + zip: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + email: Optional[str] = None, + is_admin: Optional[bool] = None, + is_sso: Optional[bool] = None, + scopes: Optional[List[str]] = None, + has_restricted_subuser_access: Optional[bool] = None, + subuser_access: Optional[ + List[SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner] + ] = None, ): - self.address=address - self.address2=address2 - self.city=city - self.company=company - self.country=country - self.username=username - self.phone=phone - self.state=state - self.user_type=user_type - self.website=website - self.zip=zip - self.first_name=first_name - self.last_name=last_name - self.email=email - self.is_admin=is_admin - self.is_sso=is_sso - self.scopes=scopes - self.has_restricted_subuser_access=has_restricted_subuser_access - self.subuser_access=subuser_access + self.address = address + self.address2 = address2 + self.city = city + self.company = company + self.country = country + self.username = username + self.phone = phone + self.state = state + self.user_type = user_type + self.website = website + self.zip = zip + self.first_name = first_name + self.last_name = last_name + self.email = email + self.is_admin = is_admin + self.is_sso = is_sso + self.scopes = scopes + self.has_restricted_subuser_access = has_restricted_subuser_access + self.subuser_access = subuser_access def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "address": self.address, - "address2": self.address2, - "city": self.city, - "company": self.company, - "country": self.country, - "username": self.username, - "phone": self.phone, - "state": self.state, - "user_type": self.user_type, - "website": self.website, - "zip": self.zip, - "first_name": self.first_name, - "last_name": self.last_name, - "email": self.email, - "is_admin": self.is_admin, - "is_sso": self.is_sso, - "scopes": self.scopes, - "has_restricted_subuser_access": self.has_restricted_subuser_access, - "subuser_access": self.subuser_access - }.items() if value is not None} + "address": self.address, + "address2": self.address2, + "city": self.city, + "company": self.company, + "country": self.country, + "username": self.username, + "phone": self.phone, + "state": self.state, + "user_type": self.user_type, + "website": self.website, + "zip": self.zip, + "first_name": self.first_name, + "last_name": self.last_name, + "email": self.email, + "is_admin": self.is_admin, + "is_sso": self.is_sso, + "scopes": self.scopes, + "has_restricted_subuser_access": self.has_restricted_subuser_access, + "subuser_access": self.subuser_access, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -81,24 +85,23 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return PatchSsoTeammates200( - address=payload.get('address'), - address2=payload.get('address2'), - city=payload.get('city'), - company=payload.get('company'), - country=payload.get('country'), - username=payload.get('username'), - phone=payload.get('phone'), - state=payload.get('state'), - user_type=payload.get('user_type'), - website=payload.get('website'), - zip=payload.get('zip'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - email=payload.get('email'), - is_admin=payload.get('is_admin'), - is_sso=payload.get('is_sso'), - scopes=payload.get('scopes'), - has_restricted_subuser_access=payload.get('has_restricted_subuser_access'), - subuser_access=payload.get('subuser_access') - ) - + address=payload.get("address"), + address2=payload.get("address2"), + city=payload.get("city"), + company=payload.get("company"), + country=payload.get("country"), + username=payload.get("username"), + phone=payload.get("phone"), + state=payload.get("state"), + user_type=payload.get("user_type"), + website=payload.get("website"), + zip=payload.get("zip"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + email=payload.get("email"), + is_admin=payload.get("is_admin"), + is_sso=payload.get("is_sso"), + scopes=payload.get("scopes"), + has_restricted_subuser_access=payload.get("has_restricted_subuser_access"), + subuser_access=payload.get("subuser_access"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/permission_type.py b/sendgrid/rest/api/sso/v3/models/permission_type.py index 26e64ef6..14aced3d 100644 --- a/sendgrid/rest/api/sso/v3/models/permission_type.py +++ b/sendgrid/rest/api/sso/v3/models/permission_type.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class PermissionType(Enum): - ADMIN='admin' - RESTRICTED='restricted' - + ADMIN = "admin" + RESTRICTED = "restricted" diff --git a/sendgrid/rest/api/sso/v3/models/permission_type1.py b/sendgrid/rest/api/sso/v3/models/permission_type1.py index 4aebb47d..d03e913e 100644 --- a/sendgrid/rest/api/sso/v3/models/permission_type1.py +++ b/sendgrid/rest/api/sso/v3/models/permission_type1.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class PermissionType1(Enum): - ADMIN='admin' - RESTRICTED='restricted' - + ADMIN = "admin" + RESTRICTED = "restricted" diff --git a/sendgrid/rest/api/sso/v3/models/persona.py b/sendgrid/rest/api/sso/v3/models/persona.py index 3da2651e..e48f0b3a 100644 --- a/sendgrid/rest/api/sso/v3/models/persona.py +++ b/sendgrid/rest/api/sso/v3/models/persona.py @@ -1,13 +1,9 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Persona(Enum): - ACCOUNTANT='accountant' - DEVELOPER='developer' - MARKETER='marketer' - OBSERVER='observer' - + ACCOUNTANT = "accountant" + DEVELOPER = "developer" + MARKETER = "marketer" + OBSERVER = "observer" diff --git a/sendgrid/rest/api/sso/v3/models/post_patch_integration_request.py b/sendgrid/rest/api/sso/v3/models/post_patch_integration_request.py index 178df3d3..4c079d28 100644 --- a/sendgrid/rest/api/sso/v3/models/post_patch_integration_request.py +++ b/sendgrid/rest/api/sso/v3/models/post_patch_integration_request.py @@ -1,37 +1,37 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class PostPatchIntegrationRequest: def __init__( - self, - name: Optional[str]=None, - enabled: Optional[bool]=None, - signin_url: Optional[str]=None, - signout_url: Optional[str]=None, - entity_id: Optional[str]=None, - completed_integration: Optional[bool]=None + self, + name: Optional[str] = None, + enabled: Optional[bool] = None, + signin_url: Optional[str] = None, + signout_url: Optional[str] = None, + entity_id: Optional[str] = None, + completed_integration: Optional[bool] = None, ): - self.name=name - self.enabled=enabled - self.signin_url=signin_url - self.signout_url=signout_url - self.entity_id=entity_id - self.completed_integration=completed_integration + self.name = name + self.enabled = enabled + self.signin_url = signin_url + self.signout_url = signout_url + self.entity_id = entity_id + self.completed_integration = completed_integration def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "enabled": self.enabled, - "signin_url": self.signin_url, - "signout_url": self.signout_url, - "entity_id": self.entity_id, - "completed_integration": self.completed_integration - }.items() if value is not None} + "name": self.name, + "enabled": self.enabled, + "signin_url": self.signin_url, + "signout_url": self.signout_url, + "entity_id": self.entity_id, + "completed_integration": self.completed_integration, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -40,11 +40,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return PostPatchIntegrationRequest( - name=payload.get('name'), - enabled=payload.get('enabled'), - signin_url=payload.get('signin_url'), - signout_url=payload.get('signout_url'), - entity_id=payload.get('entity_id'), - completed_integration=payload.get('completed_integration') - ) - + name=payload.get("name"), + enabled=payload.get("enabled"), + signin_url=payload.get("signin_url"), + signout_url=payload.get("signout_url"), + entity_id=payload.get("entity_id"), + completed_integration=payload.get("completed_integration"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/post_sso_teammates201.py b/sendgrid/rest/api/sso/v3/models/post_sso_teammates201.py index b765ff56..93e35dbf 100644 --- a/sendgrid/rest/api/sso/v3/models/post_sso_teammates201.py +++ b/sendgrid/rest/api/sso/v3/models/post_sso_teammates201.py @@ -1,44 +1,48 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.sso.v3.models.sso_teammates_restricted_subuser_response_props_subuser_access_inner import SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner - +from sendgrid.rest.api.sso.v3.models.sso_teammates_restricted_subuser_response_props_subuser_access_inner import ( + SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner, +) class PostSsoTeammates201: def __init__( - self, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - email: Optional[str]=None, - is_admin: Optional[bool]=None, - is_sso: Optional[bool]=None, - scopes: Optional[List[str]]=None, - has_restricted_subuser_access: Optional[bool]=None, - subuser_access: Optional[List[SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner]]=None + self, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + email: Optional[str] = None, + is_admin: Optional[bool] = None, + is_sso: Optional[bool] = None, + scopes: Optional[List[str]] = None, + has_restricted_subuser_access: Optional[bool] = None, + subuser_access: Optional[ + List[SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner] + ] = None, ): - self.first_name=first_name - self.last_name=last_name - self.email=email - self.is_admin=is_admin - self.is_sso=is_sso - self.scopes=scopes - self.has_restricted_subuser_access=has_restricted_subuser_access - self.subuser_access=subuser_access + self.first_name = first_name + self.last_name = last_name + self.email = email + self.is_admin = is_admin + self.is_sso = is_sso + self.scopes = scopes + self.has_restricted_subuser_access = has_restricted_subuser_access + self.subuser_access = subuser_access def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "first_name": self.first_name, - "last_name": self.last_name, - "email": self.email, - "is_admin": self.is_admin, - "is_sso": self.is_sso, - "scopes": self.scopes, - "has_restricted_subuser_access": self.has_restricted_subuser_access, - "subuser_access": self.subuser_access - }.items() if value is not None} + "first_name": self.first_name, + "last_name": self.last_name, + "email": self.email, + "is_admin": self.is_admin, + "is_sso": self.is_sso, + "scopes": self.scopes, + "has_restricted_subuser_access": self.has_restricted_subuser_access, + "subuser_access": self.subuser_access, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -47,13 +51,12 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return PostSsoTeammates201( - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - email=payload.get('email'), - is_admin=payload.get('is_admin'), - is_sso=payload.get('is_sso'), - scopes=payload.get('scopes'), - has_restricted_subuser_access=payload.get('has_restricted_subuser_access'), - subuser_access=payload.get('subuser_access') - ) - + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + email=payload.get("email"), + is_admin=payload.get("is_admin"), + is_sso=payload.get("is_sso"), + scopes=payload.get("scopes"), + has_restricted_subuser_access=payload.get("has_restricted_subuser_access"), + subuser_access=payload.get("subuser_access"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/post_sso_teammates_request.py b/sendgrid/rest/api/sso/v3/models/post_sso_teammates_request.py index 0a7d3395..7d8a1384 100644 --- a/sendgrid/rest/api/sso/v3/models/post_sso_teammates_request.py +++ b/sendgrid/rest/api/sso/v3/models/post_sso_teammates_request.py @@ -1,45 +1,49 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.sso.v3.models.persona import Persona -from sendgrid.rest.api.sso.v3.models.sso_teammates_base_request_props_subuser_access_inner import SsoTeammatesBaseRequestPropsSubuserAccessInner - +from sendgrid.rest.api.sso.v3.models.sso_teammates_base_request_props_subuser_access_inner import ( + SsoTeammatesBaseRequestPropsSubuserAccessInner, +) class PostSsoTeammatesRequest: def __init__( - self, - email: Optional[str]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - is_admin: Optional[bool]=None, - persona: Optional[Persona]=None, - scopes: Optional[List[str]]=None, - has_restricted_subuser_access: Optional[bool]=None, - subuser_access: Optional[List[SsoTeammatesBaseRequestPropsSubuserAccessInner]]=None + self, + email: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + is_admin: Optional[bool] = None, + persona: Optional[Persona] = None, + scopes: Optional[List[str]] = None, + has_restricted_subuser_access: Optional[bool] = None, + subuser_access: Optional[ + List[SsoTeammatesBaseRequestPropsSubuserAccessInner] + ] = None, ): - self.email=email - self.first_name=first_name - self.last_name=last_name - self.is_admin=is_admin - self.persona=persona - self.scopes=scopes - self.has_restricted_subuser_access=has_restricted_subuser_access - self.subuser_access=subuser_access + self.email = email + self.first_name = first_name + self.last_name = last_name + self.is_admin = is_admin + self.persona = persona + self.scopes = scopes + self.has_restricted_subuser_access = has_restricted_subuser_access + self.subuser_access = subuser_access def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "email": self.email, - "first_name": self.first_name, - "last_name": self.last_name, - "is_admin": self.is_admin, - "persona": self.persona, - "scopes": self.scopes, - "has_restricted_subuser_access": self.has_restricted_subuser_access, - "subuser_access": self.subuser_access - }.items() if value is not None} + "email": self.email, + "first_name": self.first_name, + "last_name": self.last_name, + "is_admin": self.is_admin, + "persona": self.persona, + "scopes": self.scopes, + "has_restricted_subuser_access": self.has_restricted_subuser_access, + "subuser_access": self.subuser_access, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -48,13 +52,12 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return PostSsoTeammatesRequest( - email=payload.get('email'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - is_admin=payload.get('is_admin'), - persona=payload.get('persona'), - scopes=payload.get('scopes'), - has_restricted_subuser_access=payload.get('has_restricted_subuser_access'), - subuser_access=payload.get('subuser_access') - ) - + email=payload.get("email"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + is_admin=payload.get("is_admin"), + persona=payload.get("persona"), + scopes=payload.get("scopes"), + has_restricted_subuser_access=payload.get("has_restricted_subuser_access"), + subuser_access=payload.get("subuser_access"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/sso_certificate_body.py b/sendgrid/rest/api/sso/v3/models/sso_certificate_body.py index 236acd8c..6523e2fd 100644 --- a/sendgrid/rest/api/sso/v3/models/sso_certificate_body.py +++ b/sendgrid/rest/api/sso/v3/models/sso_certificate_body.py @@ -1,34 +1,34 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SsoCertificateBody: def __init__( - self, - public_certificate: Optional[str]=None, - id: Optional[float]=None, - not_before: Optional[float]=None, - not_after: Optional[float]=None, - intergration_id: Optional[str]=None + self, + public_certificate: Optional[str] = None, + id: Optional[float] = None, + not_before: Optional[float] = None, + not_after: Optional[float] = None, + intergration_id: Optional[str] = None, ): - self.public_certificate=public_certificate - self.id=id - self.not_before=not_before - self.not_after=not_after - self.intergration_id=intergration_id + self.public_certificate = public_certificate + self.id = id + self.not_before = not_before + self.not_after = not_after + self.intergration_id = intergration_id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "public_certificate": self.public_certificate, - "id": self.id, - "not_before": self.not_before, - "not_after": self.not_after, - "intergration_id": self.intergration_id - }.items() if value is not None} + "public_certificate": self.public_certificate, + "id": self.id, + "not_before": self.not_before, + "not_after": self.not_after, + "intergration_id": self.intergration_id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -37,10 +37,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SsoCertificateBody( - public_certificate=payload.get('public_certificate'), - id=payload.get('id'), - not_before=payload.get('not_before'), - not_after=payload.get('not_after'), - intergration_id=payload.get('intergration_id') - ) - + public_certificate=payload.get("public_certificate"), + id=payload.get("id"), + not_before=payload.get("not_before"), + not_after=payload.get("not_after"), + intergration_id=payload.get("intergration_id"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/sso_error_response_inner.py b/sendgrid/rest/api/sso/v3/models/sso_error_response_inner.py index 1621b5e0..11f5ed1c 100644 --- a/sendgrid/rest/api/sso/v3/models/sso_error_response_inner.py +++ b/sendgrid/rest/api/sso/v3/models/sso_error_response_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SsoErrorResponseInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - error_id: Optional[str]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + error_id: Optional[str] = None, ): - self.message=message - self.field=field - self.error_id=error_id + self.message = message + self.field = field + self.error_id = error_id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "error_id": self.error_id - }.items() if value is not None} + "message": self.message, + "field": self.field, + "error_id": self.error_id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SsoErrorResponseInner( - message=payload.get('message'), - field=payload.get('field'), - error_id=payload.get('error_id') - ) - + message=payload.get("message"), + field=payload.get("field"), + error_id=payload.get("error_id"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/sso_integration.py b/sendgrid/rest/api/sso/v3/models/sso_integration.py index c59b12fa..5d81a9da 100644 --- a/sendgrid/rest/api/sso/v3/models/sso_integration.py +++ b/sendgrid/rest/api/sso/v3/models/sso_integration.py @@ -1,49 +1,49 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SsoIntegration: def __init__( - self, - name: Optional[str]=None, - enabled: Optional[bool]=None, - signin_url: Optional[str]=None, - signout_url: Optional[str]=None, - entity_id: Optional[str]=None, - completed_integration: Optional[bool]=None, - last_updated: Optional[float]=None, - id: Optional[str]=None, - single_signon_url: Optional[str]=None, - audience_url: Optional[str]=None + self, + name: Optional[str] = None, + enabled: Optional[bool] = None, + signin_url: Optional[str] = None, + signout_url: Optional[str] = None, + entity_id: Optional[str] = None, + completed_integration: Optional[bool] = None, + last_updated: Optional[float] = None, + id: Optional[str] = None, + single_signon_url: Optional[str] = None, + audience_url: Optional[str] = None, ): - self.name=name - self.enabled=enabled - self.signin_url=signin_url - self.signout_url=signout_url - self.entity_id=entity_id - self.completed_integration=completed_integration - self.last_updated=last_updated - self.id=id - self.single_signon_url=single_signon_url - self.audience_url=audience_url + self.name = name + self.enabled = enabled + self.signin_url = signin_url + self.signout_url = signout_url + self.entity_id = entity_id + self.completed_integration = completed_integration + self.last_updated = last_updated + self.id = id + self.single_signon_url = single_signon_url + self.audience_url = audience_url def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "enabled": self.enabled, - "signin_url": self.signin_url, - "signout_url": self.signout_url, - "entity_id": self.entity_id, - "completed_integration": self.completed_integration, - "last_updated": self.last_updated, - "id": self.id, - "single_signon_url": self.single_signon_url, - "audience_url": self.audience_url - }.items() if value is not None} + "name": self.name, + "enabled": self.enabled, + "signin_url": self.signin_url, + "signout_url": self.signout_url, + "entity_id": self.entity_id, + "completed_integration": self.completed_integration, + "last_updated": self.last_updated, + "id": self.id, + "single_signon_url": self.single_signon_url, + "audience_url": self.audience_url, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -52,15 +52,14 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SsoIntegration( - name=payload.get('name'), - enabled=payload.get('enabled'), - signin_url=payload.get('signin_url'), - signout_url=payload.get('signout_url'), - entity_id=payload.get('entity_id'), - completed_integration=payload.get('completed_integration'), - last_updated=payload.get('last_updated'), - id=payload.get('id'), - single_signon_url=payload.get('single_signon_url'), - audience_url=payload.get('audience_url') - ) - + name=payload.get("name"), + enabled=payload.get("enabled"), + signin_url=payload.get("signin_url"), + signout_url=payload.get("signout_url"), + entity_id=payload.get("entity_id"), + completed_integration=payload.get("completed_integration"), + last_updated=payload.get("last_updated"), + id=payload.get("id"), + single_signon_url=payload.get("single_signon_url"), + audience_url=payload.get("audience_url"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/sso_teammates_base_request_props.py b/sendgrid/rest/api/sso/v3/models/sso_teammates_base_request_props.py index 4b81e296..9045bd8b 100644 --- a/sendgrid/rest/api/sso/v3/models/sso_teammates_base_request_props.py +++ b/sendgrid/rest/api/sso/v3/models/sso_teammates_base_request_props.py @@ -1,42 +1,46 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.sso.v3.models.persona import Persona -from sendgrid.rest.api.sso.v3.models.sso_teammates_base_request_props_subuser_access_inner import SsoTeammatesBaseRequestPropsSubuserAccessInner - +from sendgrid.rest.api.sso.v3.models.sso_teammates_base_request_props_subuser_access_inner import ( + SsoTeammatesBaseRequestPropsSubuserAccessInner, +) class SsoTeammatesBaseRequestProps: def __init__( - self, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - is_admin: Optional[bool]=None, - persona: Optional[Persona]=None, - scopes: Optional[List[str]]=None, - has_restricted_subuser_access: Optional[bool]=None, - subuser_access: Optional[List[SsoTeammatesBaseRequestPropsSubuserAccessInner]]=None + self, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + is_admin: Optional[bool] = None, + persona: Optional[Persona] = None, + scopes: Optional[List[str]] = None, + has_restricted_subuser_access: Optional[bool] = None, + subuser_access: Optional[ + List[SsoTeammatesBaseRequestPropsSubuserAccessInner] + ] = None, ): - self.first_name=first_name - self.last_name=last_name - self.is_admin=is_admin - self.persona=persona - self.scopes=scopes - self.has_restricted_subuser_access=has_restricted_subuser_access - self.subuser_access=subuser_access + self.first_name = first_name + self.last_name = last_name + self.is_admin = is_admin + self.persona = persona + self.scopes = scopes + self.has_restricted_subuser_access = has_restricted_subuser_access + self.subuser_access = subuser_access def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "first_name": self.first_name, - "last_name": self.last_name, - "is_admin": self.is_admin, - "persona": self.persona, - "scopes": self.scopes, - "has_restricted_subuser_access": self.has_restricted_subuser_access, - "subuser_access": self.subuser_access - }.items() if value is not None} + "first_name": self.first_name, + "last_name": self.last_name, + "is_admin": self.is_admin, + "persona": self.persona, + "scopes": self.scopes, + "has_restricted_subuser_access": self.has_restricted_subuser_access, + "subuser_access": self.subuser_access, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -45,12 +49,11 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SsoTeammatesBaseRequestProps( - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - is_admin=payload.get('is_admin'), - persona=payload.get('persona'), - scopes=payload.get('scopes'), - has_restricted_subuser_access=payload.get('has_restricted_subuser_access'), - subuser_access=payload.get('subuser_access') - ) - + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + is_admin=payload.get("is_admin"), + persona=payload.get("persona"), + scopes=payload.get("scopes"), + has_restricted_subuser_access=payload.get("has_restricted_subuser_access"), + subuser_access=payload.get("subuser_access"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/sso_teammates_base_request_props_subuser_access_inner.py b/sendgrid/rest/api/sso/v3/models/sso_teammates_base_request_props_subuser_access_inner.py index a920bd0f..27e54b8b 100644 --- a/sendgrid/rest/api/sso/v3/models/sso_teammates_base_request_props_subuser_access_inner.py +++ b/sendgrid/rest/api/sso/v3/models/sso_teammates_base_request_props_subuser_access_inner.py @@ -1,29 +1,29 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.sso.v3.models.permission_type import PermissionType - class SsoTeammatesBaseRequestPropsSubuserAccessInner: def __init__( - self, - id: Optional[int]=None, - permission_type: Optional[PermissionType]=None, - scopes: Optional[List[str]]=None + self, + id: Optional[int] = None, + permission_type: Optional[PermissionType] = None, + scopes: Optional[List[str]] = None, ): - self.id=id - self.permission_type=permission_type - self.scopes=scopes + self.id = id + self.permission_type = permission_type + self.scopes = scopes def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "permission_type": self.permission_type, - "scopes": self.scopes - }.items() if value is not None} + "id": self.id, + "permission_type": self.permission_type, + "scopes": self.scopes, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +32,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SsoTeammatesBaseRequestPropsSubuserAccessInner( - id=payload.get('id'), - permission_type=payload.get('permission_type'), - scopes=payload.get('scopes') - ) - + id=payload.get("id"), + permission_type=payload.get("permission_type"), + scopes=payload.get("scopes"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/sso_teammates_base_response_props.py b/sendgrid/rest/api/sso/v3/models/sso_teammates_base_response_props.py index ba788ceb..bebc34f5 100644 --- a/sendgrid/rest/api/sso/v3/models/sso_teammates_base_response_props.py +++ b/sendgrid/rest/api/sso/v3/models/sso_teammates_base_response_props.py @@ -1,37 +1,37 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SsoTeammatesBaseResponseProps: def __init__( - self, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - email: Optional[str]=None, - is_admin: Optional[bool]=None, - is_sso: Optional[bool]=None, - scopes: Optional[List[str]]=None + self, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + email: Optional[str] = None, + is_admin: Optional[bool] = None, + is_sso: Optional[bool] = None, + scopes: Optional[List[str]] = None, ): - self.first_name=first_name - self.last_name=last_name - self.email=email - self.is_admin=is_admin - self.is_sso=is_sso - self.scopes=scopes + self.first_name = first_name + self.last_name = last_name + self.email = email + self.is_admin = is_admin + self.is_sso = is_sso + self.scopes = scopes def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "first_name": self.first_name, - "last_name": self.last_name, - "email": self.email, - "is_admin": self.is_admin, - "is_sso": self.is_sso, - "scopes": self.scopes - }.items() if value is not None} + "first_name": self.first_name, + "last_name": self.last_name, + "email": self.email, + "is_admin": self.is_admin, + "is_sso": self.is_sso, + "scopes": self.scopes, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -40,11 +40,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SsoTeammatesBaseResponseProps( - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - email=payload.get('email'), - is_admin=payload.get('is_admin'), - is_sso=payload.get('is_sso'), - scopes=payload.get('scopes') - ) - + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + email=payload.get("email"), + is_admin=payload.get("is_admin"), + is_sso=payload.get("is_sso"), + scopes=payload.get("scopes"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/sso_teammates_restricted_subuser_response_props.py b/sendgrid/rest/api/sso/v3/models/sso_teammates_restricted_subuser_response_props.py index cdac9e79..18d28d3a 100644 --- a/sendgrid/rest/api/sso/v3/models/sso_teammates_restricted_subuser_response_props.py +++ b/sendgrid/rest/api/sso/v3/models/sso_teammates_restricted_subuser_response_props.py @@ -1,26 +1,30 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.sso.v3.models.sso_teammates_restricted_subuser_response_props_subuser_access_inner import SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner - +from sendgrid.rest.api.sso.v3.models.sso_teammates_restricted_subuser_response_props_subuser_access_inner import ( + SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner, +) class SsoTeammatesRestrictedSubuserResponseProps: def __init__( - self, - has_restricted_subuser_access: Optional[bool]=None, - subuser_access: Optional[List[SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner]]=None + self, + has_restricted_subuser_access: Optional[bool] = None, + subuser_access: Optional[ + List[SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner] + ] = None, ): - self.has_restricted_subuser_access=has_restricted_subuser_access - self.subuser_access=subuser_access + self.has_restricted_subuser_access = has_restricted_subuser_access + self.subuser_access = subuser_access def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "has_restricted_subuser_access": self.has_restricted_subuser_access, - "subuser_access": self.subuser_access - }.items() if value is not None} + "has_restricted_subuser_access": self.has_restricted_subuser_access, + "subuser_access": self.subuser_access, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +33,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SsoTeammatesRestrictedSubuserResponseProps( - has_restricted_subuser_access=payload.get('has_restricted_subuser_access'), - subuser_access=payload.get('subuser_access') - ) - + has_restricted_subuser_access=payload.get("has_restricted_subuser_access"), + subuser_access=payload.get("subuser_access"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/sso_teammates_restricted_subuser_response_props_subuser_access_inner.py b/sendgrid/rest/api/sso/v3/models/sso_teammates_restricted_subuser_response_props_subuser_access_inner.py index a43f9601..f30bb340 100644 --- a/sendgrid/rest/api/sso/v3/models/sso_teammates_restricted_subuser_response_props_subuser_access_inner.py +++ b/sendgrid/rest/api/sso/v3/models/sso_teammates_restricted_subuser_response_props_subuser_access_inner.py @@ -1,38 +1,38 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.sso.v3.models.permission_type1 import PermissionType1 - class SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner: def __init__( - self, - id: Optional[int]=None, - username: Optional[str]=None, - email: Optional[str]=None, - disabled: Optional[bool]=None, - permission_type: Optional[PermissionType1]=None, - scopes: Optional[List[str]]=None + self, + id: Optional[int] = None, + username: Optional[str] = None, + email: Optional[str] = None, + disabled: Optional[bool] = None, + permission_type: Optional[PermissionType1] = None, + scopes: Optional[List[str]] = None, ): - self.id=id - self.username=username - self.email=email - self.disabled=disabled - self.permission_type=permission_type - self.scopes=scopes + self.id = id + self.username = username + self.email = email + self.disabled = disabled + self.permission_type = permission_type + self.scopes = scopes def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "username": self.username, - "email": self.email, - "disabled": self.disabled, - "permission_type": self.permission_type, - "scopes": self.scopes - }.items() if value is not None} + "id": self.id, + "username": self.username, + "email": self.email, + "disabled": self.disabled, + "permission_type": self.permission_type, + "scopes": self.scopes, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -41,11 +41,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner( - id=payload.get('id'), - username=payload.get('username'), - email=payload.get('email'), - disabled=payload.get('disabled'), - permission_type=payload.get('permission_type'), - scopes=payload.get('scopes') - ) - + id=payload.get("id"), + username=payload.get("username"), + email=payload.get("email"), + disabled=payload.get("disabled"), + permission_type=payload.get("permission_type"), + scopes=payload.get("scopes"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/update_sso_certificate_request.py b/sendgrid/rest/api/sso/v3/models/update_sso_certificate_request.py index 4bb65e5d..101dc681 100644 --- a/sendgrid/rest/api/sso/v3/models/update_sso_certificate_request.py +++ b/sendgrid/rest/api/sso/v3/models/update_sso_certificate_request.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateSsoCertificateRequest: def __init__( - self, - public_certificate: Optional[str]=None, - enabled: Optional[bool]=None, - integration_id: Optional[str]=None + self, + public_certificate: Optional[str] = None, + enabled: Optional[bool] = None, + integration_id: Optional[str] = None, ): - self.public_certificate=public_certificate - self.enabled=enabled - self.integration_id=integration_id + self.public_certificate = public_certificate + self.enabled = enabled + self.integration_id = integration_id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "public_certificate": self.public_certificate, - "enabled": self.enabled, - "integration_id": self.integration_id - }.items() if value is not None} + "public_certificate": self.public_certificate, + "enabled": self.enabled, + "integration_id": self.integration_id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateSsoCertificateRequest( - public_certificate=payload.get('public_certificate'), - enabled=payload.get('enabled'), - integration_id=payload.get('integration_id') - ) - + public_certificate=payload.get("public_certificate"), + enabled=payload.get("enabled"), + integration_id=payload.get("integration_id"), + ) diff --git a/sendgrid/rest/api/sso/v3/models/user_type.py b/sendgrid/rest/api/sso/v3/models/user_type.py index 4d1bc2f2..c57452aa 100644 --- a/sendgrid/rest/api/sso/v3/models/user_type.py +++ b/sendgrid/rest/api/sso/v3/models/user_type.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class UserType(Enum): - ADMIN='admin' - OWNER='owner' - TEAMMATE='teammate' - + ADMIN = "admin" + OWNER = "owner" + TEAMMATE = "teammate" diff --git a/sendgrid/rest/api/sso/v3/update_sso_certificate.py b/sendgrid/rest/api/sso/v3/update_sso_certificate.py index df08840a..65119428 100644 --- a/sendgrid/rest/api/sso/v3/update_sso_certificate.py +++ b/sendgrid/rest/api/sso/v3/update_sso_certificate.py @@ -12,52 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr from typing import Optional -from sendgrid.rest.api.sso.v3.models.sso_certificate_body import SsoCertificateBody -from sendgrid.rest.api.sso.v3.models.update_sso_certificate_request import UpdateSsoCertificateRequest +from sendgrid.rest.api.sso.v3.models.update_sso_certificate_request import ( + UpdateSsoCertificateRequest, +) + class UpdateSsoCertificate: def __init__(self, client) -> None: self.client = client - + def send( self, - cert_id: str, - update_sso_certificate_request: Optional[UpdateSsoCertificateRequest] = None, - + cert_id: str, + update_sso_certificate_request: Optional[UpdateSsoCertificateRequest] = None, ): - path='/v3/sso/certificates/{cert_id}' + path = "/v3/sso/certificates/{cert_id}" path = path.format( - cert_id=cert_id, + cert_id=cert_id, ) data = None if update_sso_certificate_request: data = update_sso_certificate_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/sso/v3/update_sso_integration.py b/sendgrid/rest/api/sso/v3/update_sso_integration.py index a84b6248..348cb15e 100644 --- a/sendgrid/rest/api/sso/v3/update_sso_integration.py +++ b/sendgrid/rest/api/sso/v3/update_sso_integration.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.sso.v3.models.post_patch_integration_request import PostPatchIntegrationRequest -from sendgrid.rest.api.sso.v3.models.sso_integration import SsoIntegration +from sendgrid.rest.api.sso.v3.models.post_patch_integration_request import ( + PostPatchIntegrationRequest, +) + class UpdateSsoIntegration: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - si: Optional[bool] = None, - post_patch_integration_request: Optional[PostPatchIntegrationRequest] = None, - + id: str, + si: Optional[bool] = None, + post_patch_integration_request: Optional[PostPatchIntegrationRequest] = None, ): - path='/v3/sso/integrations/{id}' + path = "/v3/sso/integrations/{id}" path = path.format( - id=id, + id=id, ) data = None if post_patch_integration_request: data = post_patch_integration_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/sso/v3/update_sso_teammate.py b/sendgrid/rest/api/sso/v3/update_sso_teammate.py index 962841ce..60f55415 100644 --- a/sendgrid/rest/api/sso/v3/update_sso_teammate.py +++ b/sendgrid/rest/api/sso/v3/update_sso_teammate.py @@ -12,53 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.sso.v3.models.patch_sso_teammates200 import PatchSsoTeammates200 -from sendgrid.rest.api.sso.v3.models.sso_teammates_base_request_props import SsoTeammatesBaseRequestProps +from sendgrid.rest.api.sso.v3.models.sso_teammates_base_request_props import ( + SsoTeammatesBaseRequestProps, +) + class UpdateSsoTeammate: def __init__(self, client) -> None: self.client = client - + def send( self, - username: str, - body: Optional[SsoTeammatesBaseRequestProps] = None, - + username: str, + body: Optional[SsoTeammatesBaseRequestProps] = None, ): - path='/v3/sso/teammates/{username}' + path = "/v3/sso/teammates/{username}" path = path.format( - username=username, + username=username, ) data = None if body: data = body.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/stats/v3/__init__.py b/sendgrid/rest/api/stats/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/stats/v3/__init__.py +++ b/sendgrid/rest/api/stats/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/stats/v3/get_client_stat.py b/sendgrid/rest/api/stats/v3/get_client_stat.py index 804090a9..6c52d32f 100644 --- a/sendgrid/rest/api/stats/v3/get_client_stat.py +++ b/sendgrid/rest/api/stats/v3/get_client_stat.py @@ -12,59 +12,56 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.stats.v3.models.aggregated_by2 import AggregatedBy2 from sendgrid.rest.api.stats.v3.models.client_type import ClientType -from sendgrid.rest.api.stats.v3.models.list_client_stat200_response_inner import ListClientStat200ResponseInner + class GetClientStat: def __init__(self, client) -> None: self.client = client - + def send( self, - client_type: ClientType, - on_behalf_of: Optional[str] = None, - start_date: Optional[str] = None, - end_date: Optional[str] = None, - aggregated_by: Optional[AggregatedBy2] = None, - + client_type: ClientType, + on_behalf_of: Optional[str] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, + aggregated_by: Optional[AggregatedBy2] = None, ): - path='/v3/clients/{client_type}/stats' + path = "/v3/clients/{client_type}/stats" path = path.format( - client_type=client_type, + client_type=client_type, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/stats/v3/list_browser_stat.py b/sendgrid/rest/api/stats/v3/list_browser_stat.py index 35af8d18..27739703 100644 --- a/sendgrid/rest/api/stats/v3/list_browser_stat.py +++ b/sendgrid/rest/api/stats/v3/list_browser_stat.py @@ -12,57 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.stats.v3.models.aggregated_by3 import AggregatedBy3 -from sendgrid.rest.api.stats.v3.models.list_browser_stat200_response_inner import ListBrowserStat200ResponseInner + class ListBrowserStat: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - browsers: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - aggregated_by: Optional[AggregatedBy3] = None, - start_date: Optional[str] = None, - end_date: Optional[str] = None, - + on_behalf_of: Optional[str] = None, + browsers: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + aggregated_by: Optional[AggregatedBy3] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, ): - path='/v3/browsers/stats' + path = "/v3/browsers/stats" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/stats/v3/list_category.py b/sendgrid/rest/api/stats/v3/list_category.py index f9b52ebd..780f9bd5 100644 --- a/sendgrid/rest/api/stats/v3/list_category.py +++ b/sendgrid/rest/api/stats/v3/list_category.py @@ -12,53 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.stats.v3.models.list_category200_response_inner import ListCategory200ResponseInner + class ListCategory: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - limit: Optional[int] = None, - category: Optional[str] = None, - offset: Optional[int] = None, - + on_behalf_of: Optional[str] = None, + limit: Optional[int] = None, + category: Optional[str] = None, + offset: Optional[int] = None, ): - path='/v3/categories' + path = "/v3/categories" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/stats/v3/list_category_stat.py b/sendgrid/rest/api/stats/v3/list_category_stat.py index a9a58473..7e67abd8 100644 --- a/sendgrid/rest/api/stats/v3/list_category_stat.py +++ b/sendgrid/rest/api/stats/v3/list_category_stat.py @@ -12,55 +12,52 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.stats.v3.models.aggregated_by import AggregatedBy -from sendgrid.rest.api.stats.v3.models.category_stats import CategoryStats + class ListCategoryStat: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - start_date: Optional[str] = None, - end_date: Optional[str] = None, - categories: Optional[str] = None, - aggregated_by: Optional[AggregatedBy] = None, - + on_behalf_of: Optional[str] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, + categories: Optional[str] = None, + aggregated_by: Optional[AggregatedBy] = None, ): - path='/v3/categories/stats' + path = "/v3/categories/stats" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/stats/v3/list_category_stat_sum.py b/sendgrid/rest/api/stats/v3/list_category_stat_sum.py index 252f2d36..5e2716d2 100644 --- a/sendgrid/rest/api/stats/v3/list_category_stat_sum.py +++ b/sendgrid/rest/api/stats/v3/list_category_stat_sum.py @@ -12,59 +12,56 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.stats.v3.models.aggregated_by1 import AggregatedBy1 -from sendgrid.rest.api.stats.v3.models.category_stats import CategoryStats from sendgrid.rest.api.stats.v3.models.sort_by_direction import SortByDirection + class ListCategoryStatSum: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - sort_by_metric: Optional[str] = None, - sort_by_direction: Optional[SortByDirection] = None, - start_date: Optional[str] = None, - end_date: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - aggregated_by: Optional[AggregatedBy1] = None, - + on_behalf_of: Optional[str] = None, + sort_by_metric: Optional[str] = None, + sort_by_direction: Optional[SortByDirection] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + aggregated_by: Optional[AggregatedBy1] = None, ): - path='/v3/categories/stats/sums' + path = "/v3/categories/stats/sums" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/stats/v3/list_client_stat.py b/sendgrid/rest/api/stats/v3/list_client_stat.py index 1bc36098..16533a33 100644 --- a/sendgrid/rest/api/stats/v3/list_client_stat.py +++ b/sendgrid/rest/api/stats/v3/list_client_stat.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.stats.v3.models.aggregated_by2 import AggregatedBy2 -from sendgrid.rest.api.stats.v3.models.list_client_stat200_response_inner import ListClientStat200ResponseInner + class ListClientStat: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - start_date: Optional[str] = None, - end_date: Optional[str] = None, - aggregated_by: Optional[AggregatedBy2] = None, - + on_behalf_of: Optional[str] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, + aggregated_by: Optional[AggregatedBy2] = None, ): - path='/v3/clients/stats' + path = "/v3/clients/stats" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/stats/v3/list_device_stat.py b/sendgrid/rest/api/stats/v3/list_device_stat.py index 4d91dd48..d7397878 100644 --- a/sendgrid/rest/api/stats/v3/list_device_stat.py +++ b/sendgrid/rest/api/stats/v3/list_device_stat.py @@ -12,56 +12,53 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.stats.v3.models.aggregated_by3 import AggregatedBy3 -from sendgrid.rest.api.stats.v3.models.list_client_stat200_response_inner import ListClientStat200ResponseInner + class ListDeviceStat: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - aggregated_by: Optional[AggregatedBy3] = None, - start_date: Optional[str] = None, - end_date: Optional[str] = None, - + on_behalf_of: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + aggregated_by: Optional[AggregatedBy3] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, ): - path='/v3/devices/stats' + path = "/v3/devices/stats" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/stats/v3/list_geo_stat.py b/sendgrid/rest/api/stats/v3/list_geo_stat.py index b4a9bc91..05771180 100644 --- a/sendgrid/rest/api/stats/v3/list_geo_stat.py +++ b/sendgrid/rest/api/stats/v3/list_geo_stat.py @@ -12,58 +12,55 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.stats.v3.models.aggregated_by3 import AggregatedBy3 from sendgrid.rest.api.stats.v3.models.country import Country -from sendgrid.rest.api.stats.v3.models.list_geo_stat200_response_inner import ListGeoStat200ResponseInner + class ListGeoStat: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - country: Optional[Country] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - aggregated_by: Optional[AggregatedBy3] = None, - start_date: Optional[str] = None, - end_date: Optional[str] = None, - + on_behalf_of: Optional[str] = None, + country: Optional[Country] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + aggregated_by: Optional[AggregatedBy3] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, ): - path='/v3/geo/stats' + path = "/v3/geo/stats" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/stats/v3/list_mailbox_provider_stat.py b/sendgrid/rest/api/stats/v3/list_mailbox_provider_stat.py index e4bd4123..3c1d2af8 100644 --- a/sendgrid/rest/api/stats/v3/list_mailbox_provider_stat.py +++ b/sendgrid/rest/api/stats/v3/list_mailbox_provider_stat.py @@ -12,57 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.stats.v3.models.aggregated_by3 import AggregatedBy3 -from sendgrid.rest.api.stats.v3.models.list_mailbox_provider_stat200_response_inner import ListMailboxProviderStat200ResponseInner + class ListMailboxProviderStat: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - mailbox_providers: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - aggregated_by: Optional[AggregatedBy3] = None, - start_date: Optional[str] = None, - end_date: Optional[str] = None, - + on_behalf_of: Optional[str] = None, + mailbox_providers: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + aggregated_by: Optional[AggregatedBy3] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, ): - path='/v3/mailbox_providers/stats' + path = "/v3/mailbox_providers/stats" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/stats/v3/list_stat.py b/sendgrid/rest/api/stats/v3/list_stat.py index 5033881b..e091ff2c 100644 --- a/sendgrid/rest/api/stats/v3/list_stat.py +++ b/sendgrid/rest/api/stats/v3/list_stat.py @@ -12,56 +12,53 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.stats.v3.models.aggregated_by3 import AggregatedBy3 -from sendgrid.rest.api.stats.v3.models.list_stat200_response_inner import ListStat200ResponseInner + class ListStat: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - aggregated_by: Optional[AggregatedBy3] = None, - start_date: Optional[str] = None, - end_date: Optional[str] = None, - + on_behalf_of: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + aggregated_by: Optional[AggregatedBy3] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, ): - path='/v3/stats' + path = "/v3/stats" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/stats/v3/models/__init__.py b/sendgrid/rest/api/stats/v3/models/__init__.py index 18b92911..36051aa7 100644 --- a/sendgrid/rest/api/stats/v3/models/__init__.py +++ b/sendgrid/rest/api/stats/v3/models/__init__.py @@ -11,35 +11,100 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.stats.v3.models.advanced_stats_clicks import AdvancedStatsClicks -from sendgrid.rest.api.stats.v3.models.advanced_stats_clicks_opens import AdvancedStatsClicksOpens -from sendgrid.rest.api.stats.v3.models.advanced_stats_mailbox_provider import AdvancedStatsMailboxProvider +from sendgrid.rest.api.stats.v3.models.advanced_stats_clicks_opens import ( + AdvancedStatsClicksOpens, +) +from sendgrid.rest.api.stats.v3.models.advanced_stats_mailbox_provider import ( + AdvancedStatsMailboxProvider, +) from sendgrid.rest.api.stats.v3.models.advanced_stats_opens import AdvancedStatsOpens from sendgrid.rest.api.stats.v3.models.aggregated_by import AggregatedBy from sendgrid.rest.api.stats.v3.models.aggregated_by1 import AggregatedBy1 from sendgrid.rest.api.stats.v3.models.aggregated_by2 import AggregatedBy2 from sendgrid.rest.api.stats.v3.models.aggregated_by3 import AggregatedBy3 from sendgrid.rest.api.stats.v3.models.category_stats import CategoryStats -from sendgrid.rest.api.stats.v3.models.category_stats_stats_inner import CategoryStatsStatsInner -from sendgrid.rest.api.stats.v3.models.category_stats_stats_inner_metrics import CategoryStatsStatsInnerMetrics +from sendgrid.rest.api.stats.v3.models.category_stats_stats_inner import ( + CategoryStatsStatsInner, +) +from sendgrid.rest.api.stats.v3.models.category_stats_stats_inner_metrics import ( + CategoryStatsStatsInnerMetrics, +) from sendgrid.rest.api.stats.v3.models.client_type import ClientType from sendgrid.rest.api.stats.v3.models.country import Country -from sendgrid.rest.api.stats.v3.models.list_browser_stat200_response_inner import ListBrowserStat200ResponseInner -from sendgrid.rest.api.stats.v3.models.list_browser_stat200_response_inner_stats_inner import ListBrowserStat200ResponseInnerStatsInner -from sendgrid.rest.api.stats.v3.models.list_category200_response_inner import ListCategory200ResponseInner -from sendgrid.rest.api.stats.v3.models.list_category400_response import ListCategory400Response -from sendgrid.rest.api.stats.v3.models.list_category400_response_errors_inner import ListCategory400ResponseErrorsInner -from sendgrid.rest.api.stats.v3.models.list_client_stat200_response_inner import ListClientStat200ResponseInner -from sendgrid.rest.api.stats.v3.models.list_client_stat200_response_inner_stats_inner import ListClientStat200ResponseInnerStatsInner -from sendgrid.rest.api.stats.v3.models.list_geo_stat200_response_inner import ListGeoStat200ResponseInner -from sendgrid.rest.api.stats.v3.models.list_geo_stat200_response_inner_stats_inner import ListGeoStat200ResponseInnerStatsInner -from sendgrid.rest.api.stats.v3.models.list_mailbox_provider_stat200_response_inner import ListMailboxProviderStat200ResponseInner -from sendgrid.rest.api.stats.v3.models.list_mailbox_provider_stat200_response_inner_stats_inner import ListMailboxProviderStat200ResponseInnerStatsInner -from sendgrid.rest.api.stats.v3.models.list_stat200_response_inner import ListStat200ResponseInner -from sendgrid.rest.api.stats.v3.models.list_stat200_response_inner_stats_inner import ListStat200ResponseInnerStatsInner +from sendgrid.rest.api.stats.v3.models.list_browser_stat200_response_inner import ( + ListBrowserStat200ResponseInner, +) +from sendgrid.rest.api.stats.v3.models.list_browser_stat200_response_inner_stats_inner import ( + ListBrowserStat200ResponseInnerStatsInner, +) +from sendgrid.rest.api.stats.v3.models.list_category200_response_inner import ( + ListCategory200ResponseInner, +) +from sendgrid.rest.api.stats.v3.models.list_category400_response import ( + ListCategory400Response, +) +from sendgrid.rest.api.stats.v3.models.list_category400_response_errors_inner import ( + ListCategory400ResponseErrorsInner, +) +from sendgrid.rest.api.stats.v3.models.list_client_stat200_response_inner import ( + ListClientStat200ResponseInner, +) +from sendgrid.rest.api.stats.v3.models.list_client_stat200_response_inner_stats_inner import ( + ListClientStat200ResponseInnerStatsInner, +) +from sendgrid.rest.api.stats.v3.models.list_geo_stat200_response_inner import ( + ListGeoStat200ResponseInner, +) +from sendgrid.rest.api.stats.v3.models.list_geo_stat200_response_inner_stats_inner import ( + ListGeoStat200ResponseInnerStatsInner, +) +from sendgrid.rest.api.stats.v3.models.list_mailbox_provider_stat200_response_inner import ( + ListMailboxProviderStat200ResponseInner, +) +from sendgrid.rest.api.stats.v3.models.list_mailbox_provider_stat200_response_inner_stats_inner import ( + ListMailboxProviderStat200ResponseInnerStatsInner, +) +from sendgrid.rest.api.stats.v3.models.list_stat200_response_inner import ( + ListStat200ResponseInner, +) +from sendgrid.rest.api.stats.v3.models.list_stat200_response_inner_stats_inner import ( + ListStat200ResponseInnerStatsInner, +) from sendgrid.rest.api.stats.v3.models.sort_by_direction import SortByDirection -from sendgrid.rest.api.stats.v3.models.stats_advanced_global_stats import StatsAdvancedGlobalStats -__all__ = [ 'AdvancedStatsClicks', 'AdvancedStatsClicksOpens', 'AdvancedStatsMailboxProvider', 'AdvancedStatsOpens', 'AggregatedBy', 'AggregatedBy1', 'AggregatedBy2', 'AggregatedBy3', 'CategoryStats', 'CategoryStatsStatsInner', 'CategoryStatsStatsInnerMetrics', 'ClientType', 'Country', 'ListBrowserStat200ResponseInner', 'ListBrowserStat200ResponseInnerStatsInner', 'ListCategory200ResponseInner', 'ListCategory400Response', 'ListCategory400ResponseErrorsInner', 'ListClientStat200ResponseInner', 'ListClientStat200ResponseInnerStatsInner', 'ListGeoStat200ResponseInner', 'ListGeoStat200ResponseInnerStatsInner', 'ListMailboxProviderStat200ResponseInner', 'ListMailboxProviderStat200ResponseInnerStatsInner', 'ListStat200ResponseInner', 'ListStat200ResponseInnerStatsInner', 'SortByDirection', 'StatsAdvancedGlobalStats' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.stats.v3.models.stats_advanced_global_stats import ( + StatsAdvancedGlobalStats, +) + +__all__ = [ + "AdvancedStatsClicks", + "AdvancedStatsClicksOpens", + "AdvancedStatsMailboxProvider", + "AdvancedStatsOpens", + "AggregatedBy", + "AggregatedBy1", + "AggregatedBy2", + "AggregatedBy3", + "CategoryStats", + "CategoryStatsStatsInner", + "CategoryStatsStatsInnerMetrics", + "ClientType", + "Country", + "ListBrowserStat200ResponseInner", + "ListBrowserStat200ResponseInnerStatsInner", + "ListCategory200ResponseInner", + "ListCategory400Response", + "ListCategory400ResponseErrorsInner", + "ListClientStat200ResponseInner", + "ListClientStat200ResponseInnerStatsInner", + "ListGeoStat200ResponseInner", + "ListGeoStat200ResponseInnerStatsInner", + "ListMailboxProviderStat200ResponseInner", + "ListMailboxProviderStat200ResponseInnerStatsInner", + "ListStat200ResponseInner", + "ListStat200ResponseInnerStatsInner", + "SortByDirection", + "StatsAdvancedGlobalStats", +] +# Testing code diff --git a/sendgrid/rest/api/stats/v3/models/advanced_stats_clicks.py b/sendgrid/rest/api/stats/v3/models/advanced_stats_clicks.py index 0e914bce..47b77182 100644 --- a/sendgrid/rest/api/stats/v3/models/advanced_stats_clicks.py +++ b/sendgrid/rest/api/stats/v3/models/advanced_stats_clicks.py @@ -1,25 +1,23 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AdvancedStatsClicks: def __init__( - self, - clicks: Optional[int]=None, - unique_clicks: Optional[int]=None + self, clicks: Optional[int] = None, unique_clicks: Optional[int] = None ): - self.clicks=clicks - self.unique_clicks=unique_clicks + self.clicks = clicks + self.unique_clicks = unique_clicks def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "clicks": self.clicks, - "unique_clicks": self.unique_clicks - }.items() if value is not None} + "clicks": self.clicks, + "unique_clicks": self.unique_clicks, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +26,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AdvancedStatsClicks( - clicks=payload.get('clicks'), - unique_clicks=payload.get('unique_clicks') - ) - + clicks=payload.get("clicks"), unique_clicks=payload.get("unique_clicks") + ) diff --git a/sendgrid/rest/api/stats/v3/models/advanced_stats_clicks_opens.py b/sendgrid/rest/api/stats/v3/models/advanced_stats_clicks_opens.py index 451c4c38..decb96df 100644 --- a/sendgrid/rest/api/stats/v3/models/advanced_stats_clicks_opens.py +++ b/sendgrid/rest/api/stats/v3/models/advanced_stats_clicks_opens.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AdvancedStatsClicksOpens: def __init__( - self, - clicks: Optional[int]=None, - unique_clicks: Optional[int]=None, - opens: Optional[int]=None, - unique_opens: Optional[int]=None + self, + clicks: Optional[int] = None, + unique_clicks: Optional[int] = None, + opens: Optional[int] = None, + unique_opens: Optional[int] = None, ): - self.clicks=clicks - self.unique_clicks=unique_clicks - self.opens=opens - self.unique_opens=unique_opens + self.clicks = clicks + self.unique_clicks = unique_clicks + self.opens = opens + self.unique_opens = unique_opens def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "clicks": self.clicks, - "unique_clicks": self.unique_clicks, - "opens": self.opens, - "unique_opens": self.unique_opens - }.items() if value is not None} + "clicks": self.clicks, + "unique_clicks": self.unique_clicks, + "opens": self.opens, + "unique_opens": self.unique_opens, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AdvancedStatsClicksOpens( - clicks=payload.get('clicks'), - unique_clicks=payload.get('unique_clicks'), - opens=payload.get('opens'), - unique_opens=payload.get('unique_opens') - ) - + clicks=payload.get("clicks"), + unique_clicks=payload.get("unique_clicks"), + opens=payload.get("opens"), + unique_opens=payload.get("unique_opens"), + ) diff --git a/sendgrid/rest/api/stats/v3/models/advanced_stats_mailbox_provider.py b/sendgrid/rest/api/stats/v3/models/advanced_stats_mailbox_provider.py index 28e51e39..8f42345c 100644 --- a/sendgrid/rest/api/stats/v3/models/advanced_stats_mailbox_provider.py +++ b/sendgrid/rest/api/stats/v3/models/advanced_stats_mailbox_provider.py @@ -1,43 +1,43 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AdvancedStatsMailboxProvider: def __init__( - self, - blocks: Optional[int]=None, - bounces: Optional[int]=None, - deferred: Optional[int]=None, - delivered: Optional[int]=None, - drops: Optional[int]=None, - requests: Optional[int]=None, - processed: Optional[int]=None, - spam_reports: Optional[int]=None + self, + blocks: Optional[int] = None, + bounces: Optional[int] = None, + deferred: Optional[int] = None, + delivered: Optional[int] = None, + drops: Optional[int] = None, + requests: Optional[int] = None, + processed: Optional[int] = None, + spam_reports: Optional[int] = None, ): - self.blocks=blocks - self.bounces=bounces - self.deferred=deferred - self.delivered=delivered - self.drops=drops - self.requests=requests - self.processed=processed - self.spam_reports=spam_reports + self.blocks = blocks + self.bounces = bounces + self.deferred = deferred + self.delivered = delivered + self.drops = drops + self.requests = requests + self.processed = processed + self.spam_reports = spam_reports def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "blocks": self.blocks, - "bounces": self.bounces, - "deferred": self.deferred, - "delivered": self.delivered, - "drops": self.drops, - "requests": self.requests, - "processed": self.processed, - "spam_reports": self.spam_reports - }.items() if value is not None} + "blocks": self.blocks, + "bounces": self.bounces, + "deferred": self.deferred, + "delivered": self.delivered, + "drops": self.drops, + "requests": self.requests, + "processed": self.processed, + "spam_reports": self.spam_reports, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -46,13 +46,12 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AdvancedStatsMailboxProvider( - blocks=payload.get('blocks'), - bounces=payload.get('bounces'), - deferred=payload.get('deferred'), - delivered=payload.get('delivered'), - drops=payload.get('drops'), - requests=payload.get('requests'), - processed=payload.get('processed'), - spam_reports=payload.get('spam_reports') - ) - + blocks=payload.get("blocks"), + bounces=payload.get("bounces"), + deferred=payload.get("deferred"), + delivered=payload.get("delivered"), + drops=payload.get("drops"), + requests=payload.get("requests"), + processed=payload.get("processed"), + spam_reports=payload.get("spam_reports"), + ) diff --git a/sendgrid/rest/api/stats/v3/models/advanced_stats_opens.py b/sendgrid/rest/api/stats/v3/models/advanced_stats_opens.py index 27f556c6..eb8971f4 100644 --- a/sendgrid/rest/api/stats/v3/models/advanced_stats_opens.py +++ b/sendgrid/rest/api/stats/v3/models/advanced_stats_opens.py @@ -1,25 +1,21 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class AdvancedStatsOpens: - def __init__( - self, - opens: Optional[int]=None, - unique_opens: Optional[int]=None - ): - self.opens=opens - self.unique_opens=unique_opens + def __init__(self, opens: Optional[int] = None, unique_opens: Optional[int] = None): + self.opens = opens + self.unique_opens = unique_opens def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "opens": self.opens, - "unique_opens": self.unique_opens - }.items() if value is not None} + "opens": self.opens, + "unique_opens": self.unique_opens, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +24,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return AdvancedStatsOpens( - opens=payload.get('opens'), - unique_opens=payload.get('unique_opens') - ) - + opens=payload.get("opens"), unique_opens=payload.get("unique_opens") + ) diff --git a/sendgrid/rest/api/stats/v3/models/aggregated_by.py b/sendgrid/rest/api/stats/v3/models/aggregated_by.py index 03766c63..8139656a 100644 --- a/sendgrid/rest/api/stats/v3/models/aggregated_by.py +++ b/sendgrid/rest/api/stats/v3/models/aggregated_by.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class AggregatedBy(Enum): - DAY='day' - WEEK='week' - MONTH='month' - + DAY = "day" + WEEK = "week" + MONTH = "month" diff --git a/sendgrid/rest/api/stats/v3/models/aggregated_by1.py b/sendgrid/rest/api/stats/v3/models/aggregated_by1.py index e6070e5b..909b31b7 100644 --- a/sendgrid/rest/api/stats/v3/models/aggregated_by1.py +++ b/sendgrid/rest/api/stats/v3/models/aggregated_by1.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class AggregatedBy1(Enum): - DAY='day' - WEEK='week' - MONTH='month' - + DAY = "day" + WEEK = "week" + MONTH = "month" diff --git a/sendgrid/rest/api/stats/v3/models/aggregated_by2.py b/sendgrid/rest/api/stats/v3/models/aggregated_by2.py index f4aa6ebe..1441663e 100644 --- a/sendgrid/rest/api/stats/v3/models/aggregated_by2.py +++ b/sendgrid/rest/api/stats/v3/models/aggregated_by2.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class AggregatedBy2(Enum): - DAY='day' - WEEK='week' - MONTH='month' - + DAY = "day" + WEEK = "week" + MONTH = "month" diff --git a/sendgrid/rest/api/stats/v3/models/aggregated_by3.py b/sendgrid/rest/api/stats/v3/models/aggregated_by3.py index 5978e084..344f6d9a 100644 --- a/sendgrid/rest/api/stats/v3/models/aggregated_by3.py +++ b/sendgrid/rest/api/stats/v3/models/aggregated_by3.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class AggregatedBy3(Enum): - DAY='day' - WEEK='week' - MONTH='month' - + DAY = "day" + WEEK = "week" + MONTH = "month" diff --git a/sendgrid/rest/api/stats/v3/models/category_stats.py b/sendgrid/rest/api/stats/v3/models/category_stats.py index e90de1f7..f4ec5f01 100644 --- a/sendgrid/rest/api/stats/v3/models/category_stats.py +++ b/sendgrid/rest/api/stats/v3/models/category_stats.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.stats.v3.models.category_stats_stats_inner import CategoryStatsStatsInner - +from sendgrid.rest.api.stats.v3.models.category_stats_stats_inner import ( + CategoryStatsStatsInner, +) class CategoryStats: def __init__( - self, - var_date: Optional[str]=None, - stats: Optional[List[CategoryStatsStatsInner]]=None + self, + var_date: Optional[str] = None, + stats: Optional[List[CategoryStatsStatsInner]] = None, ): - self.var_date=var_date - self.stats=stats + self.var_date = var_date + self.stats = stats def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "date": self.var_date, - "stats": self.stats - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"date": self.var_date, "stats": self.stats}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return CategoryStats( - var_date=payload.get('date'), - stats=payload.get('stats') - ) - + return CategoryStats(var_date=payload.get("date"), stats=payload.get("stats")) diff --git a/sendgrid/rest/api/stats/v3/models/category_stats_stats_inner.py b/sendgrid/rest/api/stats/v3/models/category_stats_stats_inner.py index 01fa7cef..b729be64 100644 --- a/sendgrid/rest/api/stats/v3/models/category_stats_stats_inner.py +++ b/sendgrid/rest/api/stats/v3/models/category_stats_stats_inner.py @@ -1,29 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.stats.v3.models.category_stats_stats_inner_metrics import CategoryStatsStatsInnerMetrics - +from sendgrid.rest.api.stats.v3.models.category_stats_stats_inner_metrics import ( + CategoryStatsStatsInnerMetrics, +) class CategoryStatsStatsInner: def __init__( - self, - metrics: Optional[CategoryStatsStatsInnerMetrics]=None, - name: Optional[str]=None, - type: Optional[str]=None + self, + metrics: Optional[CategoryStatsStatsInnerMetrics] = None, + name: Optional[str] = None, + type: Optional[str] = None, ): - self.metrics=metrics - self.name=name - self.type=type + self.metrics = metrics + self.name = name + self.type = type def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "metrics": self.metrics, - "name": self.name, - "type": self.type - }.items() if value is not None} + "metrics": self.metrics, + "name": self.name, + "type": self.type, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +34,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CategoryStatsStatsInner( - metrics=payload.get('metrics'), - name=payload.get('name'), - type=payload.get('type') - ) - + metrics=payload.get("metrics"), + name=payload.get("name"), + type=payload.get("type"), + ) diff --git a/sendgrid/rest/api/stats/v3/models/category_stats_stats_inner_metrics.py b/sendgrid/rest/api/stats/v3/models/category_stats_stats_inner_metrics.py index 3c6de1c5..e0fda7ef 100644 --- a/sendgrid/rest/api/stats/v3/models/category_stats_stats_inner_metrics.py +++ b/sendgrid/rest/api/stats/v3/models/category_stats_stats_inner_metrics.py @@ -1,67 +1,67 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CategoryStatsStatsInnerMetrics: def __init__( - self, - blocks: Optional[int]=None, - bounce_drops: Optional[int]=None, - bounces: Optional[int]=None, - clicks: Optional[int]=None, - deferred: Optional[int]=None, - delivered: Optional[int]=None, - invalid_emails: Optional[int]=None, - opens: Optional[int]=None, - processed: Optional[int]=None, - requests: Optional[int]=None, - spam_report_drops: Optional[int]=None, - spam_reports: Optional[int]=None, - unique_clicks: Optional[int]=None, - unique_opens: Optional[int]=None, - unsubscribe_drops: Optional[int]=None, - unsubscribes: Optional[int]=None + self, + blocks: Optional[int] = None, + bounce_drops: Optional[int] = None, + bounces: Optional[int] = None, + clicks: Optional[int] = None, + deferred: Optional[int] = None, + delivered: Optional[int] = None, + invalid_emails: Optional[int] = None, + opens: Optional[int] = None, + processed: Optional[int] = None, + requests: Optional[int] = None, + spam_report_drops: Optional[int] = None, + spam_reports: Optional[int] = None, + unique_clicks: Optional[int] = None, + unique_opens: Optional[int] = None, + unsubscribe_drops: Optional[int] = None, + unsubscribes: Optional[int] = None, ): - self.blocks=blocks - self.bounce_drops=bounce_drops - self.bounces=bounces - self.clicks=clicks - self.deferred=deferred - self.delivered=delivered - self.invalid_emails=invalid_emails - self.opens=opens - self.processed=processed - self.requests=requests - self.spam_report_drops=spam_report_drops - self.spam_reports=spam_reports - self.unique_clicks=unique_clicks - self.unique_opens=unique_opens - self.unsubscribe_drops=unsubscribe_drops - self.unsubscribes=unsubscribes + self.blocks = blocks + self.bounce_drops = bounce_drops + self.bounces = bounces + self.clicks = clicks + self.deferred = deferred + self.delivered = delivered + self.invalid_emails = invalid_emails + self.opens = opens + self.processed = processed + self.requests = requests + self.spam_report_drops = spam_report_drops + self.spam_reports = spam_reports + self.unique_clicks = unique_clicks + self.unique_opens = unique_opens + self.unsubscribe_drops = unsubscribe_drops + self.unsubscribes = unsubscribes def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "blocks": self.blocks, - "bounce_drops": self.bounce_drops, - "bounces": self.bounces, - "clicks": self.clicks, - "deferred": self.deferred, - "delivered": self.delivered, - "invalid_emails": self.invalid_emails, - "opens": self.opens, - "processed": self.processed, - "requests": self.requests, - "spam_report_drops": self.spam_report_drops, - "spam_reports": self.spam_reports, - "unique_clicks": self.unique_clicks, - "unique_opens": self.unique_opens, - "unsubscribe_drops": self.unsubscribe_drops, - "unsubscribes": self.unsubscribes - }.items() if value is not None} + "blocks": self.blocks, + "bounce_drops": self.bounce_drops, + "bounces": self.bounces, + "clicks": self.clicks, + "deferred": self.deferred, + "delivered": self.delivered, + "invalid_emails": self.invalid_emails, + "opens": self.opens, + "processed": self.processed, + "requests": self.requests, + "spam_report_drops": self.spam_report_drops, + "spam_reports": self.spam_reports, + "unique_clicks": self.unique_clicks, + "unique_opens": self.unique_opens, + "unsubscribe_drops": self.unsubscribe_drops, + "unsubscribes": self.unsubscribes, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -70,21 +70,20 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CategoryStatsStatsInnerMetrics( - blocks=payload.get('blocks'), - bounce_drops=payload.get('bounce_drops'), - bounces=payload.get('bounces'), - clicks=payload.get('clicks'), - deferred=payload.get('deferred'), - delivered=payload.get('delivered'), - invalid_emails=payload.get('invalid_emails'), - opens=payload.get('opens'), - processed=payload.get('processed'), - requests=payload.get('requests'), - spam_report_drops=payload.get('spam_report_drops'), - spam_reports=payload.get('spam_reports'), - unique_clicks=payload.get('unique_clicks'), - unique_opens=payload.get('unique_opens'), - unsubscribe_drops=payload.get('unsubscribe_drops'), - unsubscribes=payload.get('unsubscribes') - ) - + blocks=payload.get("blocks"), + bounce_drops=payload.get("bounce_drops"), + bounces=payload.get("bounces"), + clicks=payload.get("clicks"), + deferred=payload.get("deferred"), + delivered=payload.get("delivered"), + invalid_emails=payload.get("invalid_emails"), + opens=payload.get("opens"), + processed=payload.get("processed"), + requests=payload.get("requests"), + spam_report_drops=payload.get("spam_report_drops"), + spam_reports=payload.get("spam_reports"), + unique_clicks=payload.get("unique_clicks"), + unique_opens=payload.get("unique_opens"), + unsubscribe_drops=payload.get("unsubscribe_drops"), + unsubscribes=payload.get("unsubscribes"), + ) diff --git a/sendgrid/rest/api/stats/v3/models/client_type.py b/sendgrid/rest/api/stats/v3/models/client_type.py index 85fbe400..a5f6e100 100644 --- a/sendgrid/rest/api/stats/v3/models/client_type.py +++ b/sendgrid/rest/api/stats/v3/models/client_type.py @@ -1,13 +1,9 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class ClientType(Enum): - PHONE='phone' - TABLET='tablet' - WEBMAIL='webmail' - DESKTOP='desktop' - + PHONE = "phone" + TABLET = "tablet" + WEBMAIL = "webmail" + DESKTOP = "desktop" diff --git a/sendgrid/rest/api/stats/v3/models/country.py b/sendgrid/rest/api/stats/v3/models/country.py index 09a64406..2e9c1038 100644 --- a/sendgrid/rest/api/stats/v3/models/country.py +++ b/sendgrid/rest/api/stats/v3/models/country.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Country(Enum): - US='US' - CA='CA' - + US = "US" + CA = "CA" diff --git a/sendgrid/rest/api/stats/v3/models/list_browser_stat200_response_inner.py b/sendgrid/rest/api/stats/v3/models/list_browser_stat200_response_inner.py index aee6486a..1f880401 100644 --- a/sendgrid/rest/api/stats/v3/models/list_browser_stat200_response_inner.py +++ b/sendgrid/rest/api/stats/v3/models/list_browser_stat200_response_inner.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.stats.v3.models.list_browser_stat200_response_inner_stats_inner import ListBrowserStat200ResponseInnerStatsInner - +from sendgrid.rest.api.stats.v3.models.list_browser_stat200_response_inner_stats_inner import ( + ListBrowserStat200ResponseInnerStatsInner, +) class ListBrowserStat200ResponseInner: def __init__( - self, - var_date: Optional[str]=None, - stats: Optional[List[ListBrowserStat200ResponseInnerStatsInner]]=None + self, + var_date: Optional[str] = None, + stats: Optional[List[ListBrowserStat200ResponseInnerStatsInner]] = None, ): - self.var_date=var_date - self.stats=stats + self.var_date = var_date + self.stats = stats def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "date": self.var_date, - "stats": self.stats - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"date": self.var_date, "stats": self.stats}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +28,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListBrowserStat200ResponseInner( - var_date=payload.get('date'), - stats=payload.get('stats') - ) - + var_date=payload.get("date"), stats=payload.get("stats") + ) diff --git a/sendgrid/rest/api/stats/v3/models/list_browser_stat200_response_inner_stats_inner.py b/sendgrid/rest/api/stats/v3/models/list_browser_stat200_response_inner_stats_inner.py index d3a96e69..1bd3569b 100644 --- a/sendgrid/rest/api/stats/v3/models/list_browser_stat200_response_inner_stats_inner.py +++ b/sendgrid/rest/api/stats/v3/models/list_browser_stat200_response_inner_stats_inner.py @@ -1,29 +1,29 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.stats.v3.models.advanced_stats_clicks import AdvancedStatsClicks - class ListBrowserStat200ResponseInnerStatsInner: def __init__( - self, - type: Optional[str]=None, - name: Optional[str]=None, - metrics: Optional[AdvancedStatsClicks]=None + self, + type: Optional[str] = None, + name: Optional[str] = None, + metrics: Optional[AdvancedStatsClicks] = None, ): - self.type=type - self.name=name - self.metrics=metrics + self.type = type + self.name = name + self.metrics = metrics def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "type": self.type, - "name": self.name, - "metrics": self.metrics - }.items() if value is not None} + "type": self.type, + "name": self.name, + "metrics": self.metrics, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +32,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListBrowserStat200ResponseInnerStatsInner( - type=payload.get('type'), - name=payload.get('name'), - metrics=payload.get('metrics') - ) - + type=payload.get("type"), + name=payload.get("name"), + metrics=payload.get("metrics"), + ) diff --git a/sendgrid/rest/api/stats/v3/models/list_category200_response_inner.py b/sendgrid/rest/api/stats/v3/models/list_category200_response_inner.py index fd24a85b..234f21c2 100644 --- a/sendgrid/rest/api/stats/v3/models/list_category200_response_inner.py +++ b/sendgrid/rest/api/stats/v3/models/list_category200_response_inner.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListCategory200ResponseInner: - def __init__( - self, - category: Optional[str]=None - ): - self.category=category + def __init__(self, category: Optional[str] = None): + self.category = category def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "category": self.category - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"category": self.category}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListCategory200ResponseInner( - category=payload.get('category') - ) - + return ListCategory200ResponseInner(category=payload.get("category")) diff --git a/sendgrid/rest/api/stats/v3/models/list_category400_response.py b/sendgrid/rest/api/stats/v3/models/list_category400_response.py index dca3ccb7..a543a569 100644 --- a/sendgrid/rest/api/stats/v3/models/list_category400_response.py +++ b/sendgrid/rest/api/stats/v3/models/list_category400_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.stats.v3.models.list_category400_response_errors_inner import ListCategory400ResponseErrorsInner - +from sendgrid.rest.api.stats.v3.models.list_category400_response_errors_inner import ( + ListCategory400ResponseErrorsInner, +) class ListCategory400Response: def __init__( - self, - errors: Optional[List[ListCategory400ResponseErrorsInner]]=None + self, errors: Optional[List[ListCategory400ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListCategory400Response( - errors=payload.get('errors') - ) - + return ListCategory400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/stats/v3/models/list_category400_response_errors_inner.py b/sendgrid/rest/api/stats/v3/models/list_category400_response_errors_inner.py index ce95ebe8..d39409ea 100644 --- a/sendgrid/rest/api/stats/v3/models/list_category400_response_errors_inner.py +++ b/sendgrid/rest/api/stats/v3/models/list_category400_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListCategory400ResponseErrorsInner: - def __init__( - self, - field: Optional[str]=None, - message: Optional[str]=None - ): - self.field=field - self.message=message + def __init__(self, field: Optional[str] = None, message: Optional[str] = None): + self.field = field + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "field": self.field, - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"field": self.field, "message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListCategory400ResponseErrorsInner( - field=payload.get('field'), - message=payload.get('message') - ) - + field=payload.get("field"), message=payload.get("message") + ) diff --git a/sendgrid/rest/api/stats/v3/models/list_client_stat200_response_inner.py b/sendgrid/rest/api/stats/v3/models/list_client_stat200_response_inner.py index a28fd76e..656c5449 100644 --- a/sendgrid/rest/api/stats/v3/models/list_client_stat200_response_inner.py +++ b/sendgrid/rest/api/stats/v3/models/list_client_stat200_response_inner.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.stats.v3.models.list_client_stat200_response_inner_stats_inner import ListClientStat200ResponseInnerStatsInner - +from sendgrid.rest.api.stats.v3.models.list_client_stat200_response_inner_stats_inner import ( + ListClientStat200ResponseInnerStatsInner, +) class ListClientStat200ResponseInner: def __init__( - self, - var_date: Optional[str]=None, - stats: Optional[List[ListClientStat200ResponseInnerStatsInner]]=None + self, + var_date: Optional[str] = None, + stats: Optional[List[ListClientStat200ResponseInnerStatsInner]] = None, ): - self.var_date=var_date - self.stats=stats + self.var_date = var_date + self.stats = stats def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "date": self.var_date, - "stats": self.stats - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"date": self.var_date, "stats": self.stats}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +28,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListClientStat200ResponseInner( - var_date=payload.get('date'), - stats=payload.get('stats') - ) - + var_date=payload.get("date"), stats=payload.get("stats") + ) diff --git a/sendgrid/rest/api/stats/v3/models/list_client_stat200_response_inner_stats_inner.py b/sendgrid/rest/api/stats/v3/models/list_client_stat200_response_inner_stats_inner.py index 7e5a4015..d2e77a5e 100644 --- a/sendgrid/rest/api/stats/v3/models/list_client_stat200_response_inner_stats_inner.py +++ b/sendgrid/rest/api/stats/v3/models/list_client_stat200_response_inner_stats_inner.py @@ -1,29 +1,29 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.stats.v3.models.advanced_stats_opens import AdvancedStatsOpens - class ListClientStat200ResponseInnerStatsInner: def __init__( - self, - type: Optional[str]=None, - name: Optional[str]=None, - metrics: Optional[AdvancedStatsOpens]=None + self, + type: Optional[str] = None, + name: Optional[str] = None, + metrics: Optional[AdvancedStatsOpens] = None, ): - self.type=type - self.name=name - self.metrics=metrics + self.type = type + self.name = name + self.metrics = metrics def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "type": self.type, - "name": self.name, - "metrics": self.metrics - }.items() if value is not None} + "type": self.type, + "name": self.name, + "metrics": self.metrics, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +32,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListClientStat200ResponseInnerStatsInner( - type=payload.get('type'), - name=payload.get('name'), - metrics=payload.get('metrics') - ) - + type=payload.get("type"), + name=payload.get("name"), + metrics=payload.get("metrics"), + ) diff --git a/sendgrid/rest/api/stats/v3/models/list_geo_stat200_response_inner.py b/sendgrid/rest/api/stats/v3/models/list_geo_stat200_response_inner.py index e1bf4315..273f0e0d 100644 --- a/sendgrid/rest/api/stats/v3/models/list_geo_stat200_response_inner.py +++ b/sendgrid/rest/api/stats/v3/models/list_geo_stat200_response_inner.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.stats.v3.models.list_geo_stat200_response_inner_stats_inner import ListGeoStat200ResponseInnerStatsInner - +from sendgrid.rest.api.stats.v3.models.list_geo_stat200_response_inner_stats_inner import ( + ListGeoStat200ResponseInnerStatsInner, +) class ListGeoStat200ResponseInner: def __init__( - self, - var_date: Optional[str]=None, - stats: Optional[List[ListGeoStat200ResponseInnerStatsInner]]=None + self, + var_date: Optional[str] = None, + stats: Optional[List[ListGeoStat200ResponseInnerStatsInner]] = None, ): - self.var_date=var_date - self.stats=stats + self.var_date = var_date + self.stats = stats def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "date": self.var_date, - "stats": self.stats - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"date": self.var_date, "stats": self.stats}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +28,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListGeoStat200ResponseInner( - var_date=payload.get('date'), - stats=payload.get('stats') - ) - + var_date=payload.get("date"), stats=payload.get("stats") + ) diff --git a/sendgrid/rest/api/stats/v3/models/list_geo_stat200_response_inner_stats_inner.py b/sendgrid/rest/api/stats/v3/models/list_geo_stat200_response_inner_stats_inner.py index aae13cc7..97c2e18b 100644 --- a/sendgrid/rest/api/stats/v3/models/list_geo_stat200_response_inner_stats_inner.py +++ b/sendgrid/rest/api/stats/v3/models/list_geo_stat200_response_inner_stats_inner.py @@ -1,29 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.stats.v3.models.advanced_stats_clicks_opens import AdvancedStatsClicksOpens - +from sendgrid.rest.api.stats.v3.models.advanced_stats_clicks_opens import ( + AdvancedStatsClicksOpens, +) class ListGeoStat200ResponseInnerStatsInner: def __init__( - self, - type: Optional[str]=None, - name: Optional[str]=None, - metrics: Optional[AdvancedStatsClicksOpens]=None + self, + type: Optional[str] = None, + name: Optional[str] = None, + metrics: Optional[AdvancedStatsClicksOpens] = None, ): - self.type=type - self.name=name - self.metrics=metrics + self.type = type + self.name = name + self.metrics = metrics def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "type": self.type, - "name": self.name, - "metrics": self.metrics - }.items() if value is not None} + "type": self.type, + "name": self.name, + "metrics": self.metrics, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +34,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListGeoStat200ResponseInnerStatsInner( - type=payload.get('type'), - name=payload.get('name'), - metrics=payload.get('metrics') - ) - + type=payload.get("type"), + name=payload.get("name"), + metrics=payload.get("metrics"), + ) diff --git a/sendgrid/rest/api/stats/v3/models/list_mailbox_provider_stat200_response_inner.py b/sendgrid/rest/api/stats/v3/models/list_mailbox_provider_stat200_response_inner.py index fba5b86b..bedd162b 100644 --- a/sendgrid/rest/api/stats/v3/models/list_mailbox_provider_stat200_response_inner.py +++ b/sendgrid/rest/api/stats/v3/models/list_mailbox_provider_stat200_response_inner.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.stats.v3.models.list_mailbox_provider_stat200_response_inner_stats_inner import ListMailboxProviderStat200ResponseInnerStatsInner - +from sendgrid.rest.api.stats.v3.models.list_mailbox_provider_stat200_response_inner_stats_inner import ( + ListMailboxProviderStat200ResponseInnerStatsInner, +) class ListMailboxProviderStat200ResponseInner: def __init__( - self, - var_date: Optional[str]=None, - stats: Optional[List[ListMailboxProviderStat200ResponseInnerStatsInner]]=None + self, + var_date: Optional[str] = None, + stats: Optional[List[ListMailboxProviderStat200ResponseInnerStatsInner]] = None, ): - self.var_date=var_date - self.stats=stats + self.var_date = var_date + self.stats = stats def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "date": self.var_date, - "stats": self.stats - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"date": self.var_date, "stats": self.stats}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +28,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListMailboxProviderStat200ResponseInner( - var_date=payload.get('date'), - stats=payload.get('stats') - ) - + var_date=payload.get("date"), stats=payload.get("stats") + ) diff --git a/sendgrid/rest/api/stats/v3/models/list_mailbox_provider_stat200_response_inner_stats_inner.py b/sendgrid/rest/api/stats/v3/models/list_mailbox_provider_stat200_response_inner_stats_inner.py index ac95020c..30a71a26 100644 --- a/sendgrid/rest/api/stats/v3/models/list_mailbox_provider_stat200_response_inner_stats_inner.py +++ b/sendgrid/rest/api/stats/v3/models/list_mailbox_provider_stat200_response_inner_stats_inner.py @@ -1,29 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.stats.v3.models.advanced_stats_mailbox_provider import AdvancedStatsMailboxProvider - +from sendgrid.rest.api.stats.v3.models.advanced_stats_mailbox_provider import ( + AdvancedStatsMailboxProvider, +) class ListMailboxProviderStat200ResponseInnerStatsInner: def __init__( - self, - type: Optional[str]=None, - name: Optional[str]=None, - metrics: Optional[AdvancedStatsMailboxProvider]=None + self, + type: Optional[str] = None, + name: Optional[str] = None, + metrics: Optional[AdvancedStatsMailboxProvider] = None, ): - self.type=type - self.name=name - self.metrics=metrics + self.type = type + self.name = name + self.metrics = metrics def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "type": self.type, - "name": self.name, - "metrics": self.metrics - }.items() if value is not None} + "type": self.type, + "name": self.name, + "metrics": self.metrics, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +34,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListMailboxProviderStat200ResponseInnerStatsInner( - type=payload.get('type'), - name=payload.get('name'), - metrics=payload.get('metrics') - ) - + type=payload.get("type"), + name=payload.get("name"), + metrics=payload.get("metrics"), + ) diff --git a/sendgrid/rest/api/stats/v3/models/list_stat200_response_inner.py b/sendgrid/rest/api/stats/v3/models/list_stat200_response_inner.py index 8578f110..d05bd4af 100644 --- a/sendgrid/rest/api/stats/v3/models/list_stat200_response_inner.py +++ b/sendgrid/rest/api/stats/v3/models/list_stat200_response_inner.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.stats.v3.models.list_stat200_response_inner_stats_inner import ListStat200ResponseInnerStatsInner - +from sendgrid.rest.api.stats.v3.models.list_stat200_response_inner_stats_inner import ( + ListStat200ResponseInnerStatsInner, +) class ListStat200ResponseInner: def __init__( - self, - var_date: Optional[str]=None, - stats: Optional[List[ListStat200ResponseInnerStatsInner]]=None + self, + var_date: Optional[str] = None, + stats: Optional[List[ListStat200ResponseInnerStatsInner]] = None, ): - self.var_date=var_date - self.stats=stats + self.var_date = var_date + self.stats = stats def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "date": self.var_date, - "stats": self.stats - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"date": self.var_date, "stats": self.stats}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +28,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListStat200ResponseInner( - var_date=payload.get('date'), - stats=payload.get('stats') - ) - + var_date=payload.get("date"), stats=payload.get("stats") + ) diff --git a/sendgrid/rest/api/stats/v3/models/list_stat200_response_inner_stats_inner.py b/sendgrid/rest/api/stats/v3/models/list_stat200_response_inner_stats_inner.py index da9ae917..532b6ce1 100644 --- a/sendgrid/rest/api/stats/v3/models/list_stat200_response_inner_stats_inner.py +++ b/sendgrid/rest/api/stats/v3/models/list_stat200_response_inner_stats_inner.py @@ -1,23 +1,20 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.stats.v3.models.stats_advanced_global_stats import StatsAdvancedGlobalStats - +from sendgrid.rest.api.stats.v3.models.stats_advanced_global_stats import ( + StatsAdvancedGlobalStats, +) class ListStat200ResponseInnerStatsInner: - def __init__( - self, - metrics: Optional[StatsAdvancedGlobalStats]=None - ): - self.metrics=metrics + def __init__(self, metrics: Optional[StatsAdvancedGlobalStats] = None): + self.metrics = metrics def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "metrics": self.metrics - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"metrics": self.metrics}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +22,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListStat200ResponseInnerStatsInner( - metrics=payload.get('metrics') - ) - + return ListStat200ResponseInnerStatsInner(metrics=payload.get("metrics")) diff --git a/sendgrid/rest/api/stats/v3/models/sort_by_direction.py b/sendgrid/rest/api/stats/v3/models/sort_by_direction.py index 76757c62..b544b184 100644 --- a/sendgrid/rest/api/stats/v3/models/sort_by_direction.py +++ b/sendgrid/rest/api/stats/v3/models/sort_by_direction.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class SortByDirection(Enum): - DESC='desc' - ASC='asc' - + DESC = "desc" + ASC = "asc" diff --git a/sendgrid/rest/api/stats/v3/models/stats_advanced_global_stats.py b/sendgrid/rest/api/stats/v3/models/stats_advanced_global_stats.py index 3619c662..00e8aceb 100644 --- a/sendgrid/rest/api/stats/v3/models/stats_advanced_global_stats.py +++ b/sendgrid/rest/api/stats/v3/models/stats_advanced_global_stats.py @@ -1,67 +1,67 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class StatsAdvancedGlobalStats: def __init__( - self, - clicks: Optional[int]=None, - unique_clicks: Optional[int]=None, - opens: Optional[int]=None, - unique_opens: Optional[int]=None, - blocks: Optional[int]=None, - bounce_drops: Optional[int]=None, - bounces: Optional[int]=None, - deferred: Optional[int]=None, - delivered: Optional[int]=None, - invalid_emails: Optional[int]=None, - processed: Optional[int]=None, - requests: Optional[int]=None, - spam_report_drops: Optional[int]=None, - spam_reports: Optional[int]=None, - unsubscribe_drops: Optional[int]=None, - unsubscribes: Optional[int]=None + self, + clicks: Optional[int] = None, + unique_clicks: Optional[int] = None, + opens: Optional[int] = None, + unique_opens: Optional[int] = None, + blocks: Optional[int] = None, + bounce_drops: Optional[int] = None, + bounces: Optional[int] = None, + deferred: Optional[int] = None, + delivered: Optional[int] = None, + invalid_emails: Optional[int] = None, + processed: Optional[int] = None, + requests: Optional[int] = None, + spam_report_drops: Optional[int] = None, + spam_reports: Optional[int] = None, + unsubscribe_drops: Optional[int] = None, + unsubscribes: Optional[int] = None, ): - self.clicks=clicks - self.unique_clicks=unique_clicks - self.opens=opens - self.unique_opens=unique_opens - self.blocks=blocks - self.bounce_drops=bounce_drops - self.bounces=bounces - self.deferred=deferred - self.delivered=delivered - self.invalid_emails=invalid_emails - self.processed=processed - self.requests=requests - self.spam_report_drops=spam_report_drops - self.spam_reports=spam_reports - self.unsubscribe_drops=unsubscribe_drops - self.unsubscribes=unsubscribes + self.clicks = clicks + self.unique_clicks = unique_clicks + self.opens = opens + self.unique_opens = unique_opens + self.blocks = blocks + self.bounce_drops = bounce_drops + self.bounces = bounces + self.deferred = deferred + self.delivered = delivered + self.invalid_emails = invalid_emails + self.processed = processed + self.requests = requests + self.spam_report_drops = spam_report_drops + self.spam_reports = spam_reports + self.unsubscribe_drops = unsubscribe_drops + self.unsubscribes = unsubscribes def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "clicks": self.clicks, - "unique_clicks": self.unique_clicks, - "opens": self.opens, - "unique_opens": self.unique_opens, - "blocks": self.blocks, - "bounce_drops": self.bounce_drops, - "bounces": self.bounces, - "deferred": self.deferred, - "delivered": self.delivered, - "invalid_emails": self.invalid_emails, - "processed": self.processed, - "requests": self.requests, - "spam_report_drops": self.spam_report_drops, - "spam_reports": self.spam_reports, - "unsubscribe_drops": self.unsubscribe_drops, - "unsubscribes": self.unsubscribes - }.items() if value is not None} + "clicks": self.clicks, + "unique_clicks": self.unique_clicks, + "opens": self.opens, + "unique_opens": self.unique_opens, + "blocks": self.blocks, + "bounce_drops": self.bounce_drops, + "bounces": self.bounces, + "deferred": self.deferred, + "delivered": self.delivered, + "invalid_emails": self.invalid_emails, + "processed": self.processed, + "requests": self.requests, + "spam_report_drops": self.spam_report_drops, + "spam_reports": self.spam_reports, + "unsubscribe_drops": self.unsubscribe_drops, + "unsubscribes": self.unsubscribes, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -70,21 +70,20 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return StatsAdvancedGlobalStats( - clicks=payload.get('clicks'), - unique_clicks=payload.get('unique_clicks'), - opens=payload.get('opens'), - unique_opens=payload.get('unique_opens'), - blocks=payload.get('blocks'), - bounce_drops=payload.get('bounce_drops'), - bounces=payload.get('bounces'), - deferred=payload.get('deferred'), - delivered=payload.get('delivered'), - invalid_emails=payload.get('invalid_emails'), - processed=payload.get('processed'), - requests=payload.get('requests'), - spam_report_drops=payload.get('spam_report_drops'), - spam_reports=payload.get('spam_reports'), - unsubscribe_drops=payload.get('unsubscribe_drops'), - unsubscribes=payload.get('unsubscribes') - ) - + clicks=payload.get("clicks"), + unique_clicks=payload.get("unique_clicks"), + opens=payload.get("opens"), + unique_opens=payload.get("unique_opens"), + blocks=payload.get("blocks"), + bounce_drops=payload.get("bounce_drops"), + bounces=payload.get("bounces"), + deferred=payload.get("deferred"), + delivered=payload.get("delivered"), + invalid_emails=payload.get("invalid_emails"), + processed=payload.get("processed"), + requests=payload.get("requests"), + spam_report_drops=payload.get("spam_report_drops"), + spam_reports=payload.get("spam_reports"), + unsubscribe_drops=payload.get("unsubscribe_drops"), + unsubscribes=payload.get("unsubscribes"), + ) diff --git a/sendgrid/rest/api/subusers/v3/__init__.py b/sendgrid/rest/api/subusers/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/subusers/v3/__init__.py +++ b/sendgrid/rest/api/subusers/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/subusers/v3/create_subuser.py b/sendgrid/rest/api/subusers/v3/create_subuser.py index 6bc290a9..74611f55 100644 --- a/sendgrid/rest/api/subusers/v3/create_subuser.py +++ b/sendgrid/rest/api/subusers/v3/create_subuser.py @@ -12,47 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse from typing import Optional -from sendgrid.rest.api.subusers.v3.models.create_subuser_request import CreateSubuserRequest -from sendgrid.rest.api.subusers.v3.models.subuser_post import SubuserPost +from sendgrid.rest.api.subusers.v3.models.create_subuser_request import ( + CreateSubuserRequest, +) + class CreateSubuser: def __init__(self, client) -> None: self.client = client - + def send( self, - create_subuser_request: Optional[CreateSubuserRequest] = None, - + create_subuser_request: Optional[CreateSubuserRequest] = None, ): - path='/v3/subusers' + path = "/v3/subusers" data = None if create_subuser_request: data = create_subuser_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/subusers/v3/delete_subuser.py b/sendgrid/rest/api/subusers/v3/delete_subuser.py index c079419a..bde1d0f1 100644 --- a/sendgrid/rest/api/subusers/v3/delete_subuser.py +++ b/sendgrid/rest/api/subusers/v3/delete_subuser.py @@ -12,47 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated class DeleteSubuser: def __init__(self, client) -> None: self.client = client - + def send( self, - subuser_name: str, - + subuser_name: str, ): - path='/v3/subusers/{subuser_name}' + path = "/v3/subusers/{subuser_name}" path = path.format( - subuser_name=subuser_name, + subuser_name=subuser_name, ) data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/subusers/v3/get_subuser_credit.py b/sendgrid/rest/api/subusers/v3/get_subuser_credit.py index 421dfcf8..9702c21a 100644 --- a/sendgrid/rest/api/subusers/v3/get_subuser_credit.py +++ b/sendgrid/rest/api/subusers/v3/get_subuser_credit.py @@ -12,48 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.subusers.v3.models.subuser_credits import SubuserCredits class GetSubuserCredit: def __init__(self, client) -> None: self.client = client - + def send( self, - subuser_name: str, - + subuser_name: str, ): - path='/v3/subusers/{subuser_name}/credits' + path = "/v3/subusers/{subuser_name}/credits" path = path.format( - subuser_name=subuser_name, + subuser_name=subuser_name, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/subusers/v3/list_monthly_stat.py b/sendgrid/rest/api/subusers/v3/list_monthly_stat.py index e9e8d873..9a44c1ba 100644 --- a/sendgrid/rest/api/subusers/v3/list_monthly_stat.py +++ b/sendgrid/rest/api/subusers/v3/list_monthly_stat.py @@ -12,53 +12,48 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.subusers.v3.models.sort_by_direction1 import SortByDirection1 from sendgrid.rest.api.subusers.v3.models.sort_by_metric import SortByMetric -from sendgrid.rest.api.subusers.v3.models.subuser_stats import SubuserStats + class ListMonthlyStat: def __init__(self, client) -> None: self.client = client - + def send( self, - var_date: Optional[str] = None, - subuser: Optional[str] = None, - sort_by_metric: Optional[SortByMetric] = None, - sort_by_direction: Optional[SortByDirection1] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - + var_date: Optional[str] = None, + subuser: Optional[str] = None, + sort_by_metric: Optional[SortByMetric] = None, + sort_by_direction: Optional[SortByDirection1] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, ): - path='/v3/subusers/stats/monthly' + path = "/v3/subusers/stats/monthly" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/subusers/v3/list_reputation.py b/sendgrid/rest/api/subusers/v3/list_reputation.py index 755562a3..ed46f1de 100644 --- a/sendgrid/rest/api/subusers/v3/list_reputation.py +++ b/sendgrid/rest/api/subusers/v3/list_reputation.py @@ -12,45 +12,41 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr from typing import Optional -from sendgrid.rest.api.subusers.v3.models.list_reputation200_response_inner import ListReputation200ResponseInner + class ListReputation: def __init__(self, client) -> None: self.client = client - + def send( self, - usernames: Optional[str] = None, - + usernames: Optional[str] = None, ): - path='/v3/subusers/reputations' + path = "/v3/subusers/reputations" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/subusers/v3/list_stat.py b/sendgrid/rest/api/subusers/v3/list_stat.py index f693c762..7c52676a 100644 --- a/sendgrid/rest/api/subusers/v3/list_stat.py +++ b/sendgrid/rest/api/subusers/v3/list_stat.py @@ -12,52 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.subusers.v3.models.aggregated_by import AggregatedBy -from sendgrid.rest.api.subusers.v3.models.category_stats import CategoryStats + class ListStat: def __init__(self, client) -> None: self.client = client - + def send( self, - limit: Optional[int] = None, - offset: Optional[int] = None, - aggregated_by: Optional[AggregatedBy] = None, - subusers: Optional[str] = None, - start_date: Optional[str] = None, - end_date: Optional[str] = None, - + limit: Optional[int] = None, + offset: Optional[int] = None, + aggregated_by: Optional[AggregatedBy] = None, + subusers: Optional[str] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, ): - path='/v3/subusers/stats' + path = "/v3/subusers/stats" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/subusers/v3/list_stat_sum.py b/sendgrid/rest/api/subusers/v3/list_stat_sum.py index 81a9543f..77d68eeb 100644 --- a/sendgrid/rest/api/subusers/v3/list_stat_sum.py +++ b/sendgrid/rest/api/subusers/v3/list_stat_sum.py @@ -12,53 +12,48 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.subusers.v3.models.category_stats import CategoryStats from sendgrid.rest.api.subusers.v3.models.sort_by_direction2 import SortByDirection2 + class ListStatSum: def __init__(self, client) -> None: self.client = client - + def send( self, - sort_by_direction: Optional[SortByDirection2] = None, - start_date: Optional[str] = None, - end_date: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - aggregated_by: Optional[str] = None, - sort_by_metric: Optional[str] = None, - + sort_by_direction: Optional[SortByDirection2] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + aggregated_by: Optional[str] = None, + sort_by_metric: Optional[str] = None, ): - path='/v3/subusers/stats/sums' + path = "/v3/subusers/stats/sums" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/subusers/v3/list_subuser.py b/sendgrid/rest/api/subusers/v3/list_subuser.py index ed4053cf..ddf93767 100644 --- a/sendgrid/rest/api/subusers/v3/list_subuser.py +++ b/sendgrid/rest/api/subusers/v3/list_subuser.py @@ -12,51 +12,46 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictBool, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.subusers.v3.models.region import Region -from sendgrid.rest.api.subusers.v3.models.subuser import Subuser + class ListSubuser: def __init__(self, client) -> None: self.client = client - + def send( self, - username: Optional[str] = None, - limit: Optional[int] = None, - region: Optional[Region] = None, - include_region: Optional[bool] = None, - offset: Optional[int] = None, - + username: Optional[str] = None, + limit: Optional[int] = None, + region: Optional[Region] = None, + include_region: Optional[bool] = None, + offset: Optional[int] = None, ): - path='/v3/subusers' + path = "/v3/subusers" data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/subusers/v3/list_subuser_monthly_stat.py b/sendgrid/rest/api/subusers/v3/list_subuser_monthly_stat.py index a5a38df4..9bec5757 100644 --- a/sendgrid/rest/api/subusers/v3/list_subuser_monthly_stat.py +++ b/sendgrid/rest/api/subusers/v3/list_subuser_monthly_stat.py @@ -12,55 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.subusers.v3.models.sort_by_direction import SortByDirection -from sendgrid.rest.api.subusers.v3.models.subuser_stats import SubuserStats + class ListSubuserMonthlyStat: def __init__(self, client) -> None: self.client = client - + def send( self, - subuser_name: str, - var_date: Optional[str] = None, - sort_by_metric: Optional[str] = None, - sort_by_direction: Optional[SortByDirection] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - + subuser_name: str, + var_date: Optional[str] = None, + sort_by_metric: Optional[str] = None, + sort_by_direction: Optional[SortByDirection] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, ): - path='/v3/subusers/{subuser_name}/stats/monthly' + path = "/v3/subusers/{subuser_name}/stats/monthly" path = path.format( - subuser_name=subuser_name, + subuser_name=subuser_name, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/subusers/v3/models/__init__.py b/sendgrid/rest/api/subusers/v3/models/__init__.py index 0bf372d1..2c035ef0 100644 --- a/sendgrid/rest/api/subusers/v3/models/__init__.py +++ b/sendgrid/rest/api/subusers/v3/models/__init__.py @@ -11,16 +11,25 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.subusers.v3.models.aggregated_by import AggregatedBy from sendgrid.rest.api.subusers.v3.models.category_stats import CategoryStats -from sendgrid.rest.api.subusers.v3.models.category_stats_stats_inner import CategoryStatsStatsInner -from sendgrid.rest.api.subusers.v3.models.category_stats_stats_inner_metrics import CategoryStatsStatsInnerMetrics -from sendgrid.rest.api.subusers.v3.models.create_subuser_request import CreateSubuserRequest +from sendgrid.rest.api.subusers.v3.models.category_stats_stats_inner import ( + CategoryStatsStatsInner, +) +from sendgrid.rest.api.subusers.v3.models.category_stats_stats_inner_metrics import ( + CategoryStatsStatsInnerMetrics, +) +from sendgrid.rest.api.subusers.v3.models.create_subuser_request import ( + CreateSubuserRequest, +) from sendgrid.rest.api.subusers.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.subusers.v3.models.error_response_errors_inner import ErrorResponseErrorsInner -from sendgrid.rest.api.subusers.v3.models.list_reputation200_response_inner import ListReputation200ResponseInner +from sendgrid.rest.api.subusers.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) +from sendgrid.rest.api.subusers.v3.models.list_reputation200_response_inner import ( + ListReputation200ResponseInner, +) from sendgrid.rest.api.subusers.v3.models.region import Region from sendgrid.rest.api.subusers.v3.models.region1 import Region1 from sendgrid.rest.api.subusers.v3.models.region2 import Region2 @@ -33,17 +42,67 @@ from sendgrid.rest.api.subusers.v3.models.sort_by_metric import SortByMetric from sendgrid.rest.api.subusers.v3.models.subuser import Subuser from sendgrid.rest.api.subusers.v3.models.subuser_credits import SubuserCredits -from sendgrid.rest.api.subusers.v3.models.subuser_credits_request import SubuserCreditsRequest +from sendgrid.rest.api.subusers.v3.models.subuser_credits_request import ( + SubuserCreditsRequest, +) from sendgrid.rest.api.subusers.v3.models.subuser_post import SubuserPost -from sendgrid.rest.api.subusers.v3.models.subuser_post_credit_allocation import SubuserPostCreditAllocation +from sendgrid.rest.api.subusers.v3.models.subuser_post_credit_allocation import ( + SubuserPostCreditAllocation, +) from sendgrid.rest.api.subusers.v3.models.subuser_stats import SubuserStats -from sendgrid.rest.api.subusers.v3.models.subuser_stats_stats_inner import SubuserStatsStatsInner -from sendgrid.rest.api.subusers.v3.models.subuser_stats_stats_inner_metrics import SubuserStatsStatsInnerMetrics +from sendgrid.rest.api.subusers.v3.models.subuser_stats_stats_inner import ( + SubuserStatsStatsInner, +) +from sendgrid.rest.api.subusers.v3.models.subuser_stats_stats_inner_metrics import ( + SubuserStatsStatsInnerMetrics, +) from sendgrid.rest.api.subusers.v3.models.type import Type from sendgrid.rest.api.subusers.v3.models.type1 import Type1 -from sendgrid.rest.api.subusers.v3.models.update_subuser_ip200_response import UpdateSubuserIp200Response -from sendgrid.rest.api.subusers.v3.models.update_subuser_remaining_credit_request import UpdateSubuserRemainingCreditRequest -from sendgrid.rest.api.subusers.v3.models.update_subuser_request import UpdateSubuserRequest -from sendgrid.rest.api.subusers.v3.models.update_subuser_website_access_request import UpdateSubuserWebsiteAccessRequest -__all__ = [ 'AggregatedBy', 'CategoryStats', 'CategoryStatsStatsInner', 'CategoryStatsStatsInnerMetrics', 'CreateSubuserRequest', 'ErrorResponse', 'ErrorResponseErrorsInner', 'ListReputation200ResponseInner', 'Region', 'Region1', 'Region2', 'Region3', 'ResetFrequency', 'ResetFrequency1', 'SortByDirection', 'SortByDirection1', 'SortByDirection2', 'SortByMetric', 'Subuser', 'SubuserCredits', 'SubuserCreditsRequest', 'SubuserPost', 'SubuserPostCreditAllocation', 'SubuserStats', 'SubuserStatsStatsInner', 'SubuserStatsStatsInnerMetrics', 'Type', 'Type1', 'UpdateSubuserIp200Response', 'UpdateSubuserRemainingCreditRequest', 'UpdateSubuserRequest', 'UpdateSubuserWebsiteAccessRequest' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.subusers.v3.models.update_subuser_ip200_response import ( + UpdateSubuserIp200Response, +) +from sendgrid.rest.api.subusers.v3.models.update_subuser_remaining_credit_request import ( + UpdateSubuserRemainingCreditRequest, +) +from sendgrid.rest.api.subusers.v3.models.update_subuser_request import ( + UpdateSubuserRequest, +) +from sendgrid.rest.api.subusers.v3.models.update_subuser_website_access_request import ( + UpdateSubuserWebsiteAccessRequest, +) + +__all__ = [ + "AggregatedBy", + "CategoryStats", + "CategoryStatsStatsInner", + "CategoryStatsStatsInnerMetrics", + "CreateSubuserRequest", + "ErrorResponse", + "ErrorResponseErrorsInner", + "ListReputation200ResponseInner", + "Region", + "Region1", + "Region2", + "Region3", + "ResetFrequency", + "ResetFrequency1", + "SortByDirection", + "SortByDirection1", + "SortByDirection2", + "SortByMetric", + "Subuser", + "SubuserCredits", + "SubuserCreditsRequest", + "SubuserPost", + "SubuserPostCreditAllocation", + "SubuserStats", + "SubuserStatsStatsInner", + "SubuserStatsStatsInnerMetrics", + "Type", + "Type1", + "UpdateSubuserIp200Response", + "UpdateSubuserRemainingCreditRequest", + "UpdateSubuserRequest", + "UpdateSubuserWebsiteAccessRequest", +] +# Testing code diff --git a/sendgrid/rest/api/subusers/v3/models/aggregated_by.py b/sendgrid/rest/api/subusers/v3/models/aggregated_by.py index 03766c63..8139656a 100644 --- a/sendgrid/rest/api/subusers/v3/models/aggregated_by.py +++ b/sendgrid/rest/api/subusers/v3/models/aggregated_by.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class AggregatedBy(Enum): - DAY='day' - WEEK='week' - MONTH='month' - + DAY = "day" + WEEK = "week" + MONTH = "month" diff --git a/sendgrid/rest/api/subusers/v3/models/category_stats.py b/sendgrid/rest/api/subusers/v3/models/category_stats.py index cf443d54..4b76b372 100644 --- a/sendgrid/rest/api/subusers/v3/models/category_stats.py +++ b/sendgrid/rest/api/subusers/v3/models/category_stats.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.subusers.v3.models.category_stats_stats_inner import CategoryStatsStatsInner - +from sendgrid.rest.api.subusers.v3.models.category_stats_stats_inner import ( + CategoryStatsStatsInner, +) class CategoryStats: def __init__( - self, - var_date: Optional[str]=None, - stats: Optional[List[CategoryStatsStatsInner]]=None + self, + var_date: Optional[str] = None, + stats: Optional[List[CategoryStatsStatsInner]] = None, ): - self.var_date=var_date - self.stats=stats + self.var_date = var_date + self.stats = stats def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "date": self.var_date, - "stats": self.stats - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"date": self.var_date, "stats": self.stats}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return CategoryStats( - var_date=payload.get('date'), - stats=payload.get('stats') - ) - + return CategoryStats(var_date=payload.get("date"), stats=payload.get("stats")) diff --git a/sendgrid/rest/api/subusers/v3/models/category_stats_stats_inner.py b/sendgrid/rest/api/subusers/v3/models/category_stats_stats_inner.py index d722d927..9b3ebc05 100644 --- a/sendgrid/rest/api/subusers/v3/models/category_stats_stats_inner.py +++ b/sendgrid/rest/api/subusers/v3/models/category_stats_stats_inner.py @@ -1,29 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.subusers.v3.models.category_stats_stats_inner_metrics import CategoryStatsStatsInnerMetrics - +from sendgrid.rest.api.subusers.v3.models.category_stats_stats_inner_metrics import ( + CategoryStatsStatsInnerMetrics, +) class CategoryStatsStatsInner: def __init__( - self, - metrics: Optional[CategoryStatsStatsInnerMetrics]=None, - name: Optional[str]=None, - type: Optional[str]=None + self, + metrics: Optional[CategoryStatsStatsInnerMetrics] = None, + name: Optional[str] = None, + type: Optional[str] = None, ): - self.metrics=metrics - self.name=name - self.type=type + self.metrics = metrics + self.name = name + self.type = type def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "metrics": self.metrics, - "name": self.name, - "type": self.type - }.items() if value is not None} + "metrics": self.metrics, + "name": self.name, + "type": self.type, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -32,8 +34,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CategoryStatsStatsInner( - metrics=payload.get('metrics'), - name=payload.get('name'), - type=payload.get('type') - ) - + metrics=payload.get("metrics"), + name=payload.get("name"), + type=payload.get("type"), + ) diff --git a/sendgrid/rest/api/subusers/v3/models/category_stats_stats_inner_metrics.py b/sendgrid/rest/api/subusers/v3/models/category_stats_stats_inner_metrics.py index 3c6de1c5..e0fda7ef 100644 --- a/sendgrid/rest/api/subusers/v3/models/category_stats_stats_inner_metrics.py +++ b/sendgrid/rest/api/subusers/v3/models/category_stats_stats_inner_metrics.py @@ -1,67 +1,67 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CategoryStatsStatsInnerMetrics: def __init__( - self, - blocks: Optional[int]=None, - bounce_drops: Optional[int]=None, - bounces: Optional[int]=None, - clicks: Optional[int]=None, - deferred: Optional[int]=None, - delivered: Optional[int]=None, - invalid_emails: Optional[int]=None, - opens: Optional[int]=None, - processed: Optional[int]=None, - requests: Optional[int]=None, - spam_report_drops: Optional[int]=None, - spam_reports: Optional[int]=None, - unique_clicks: Optional[int]=None, - unique_opens: Optional[int]=None, - unsubscribe_drops: Optional[int]=None, - unsubscribes: Optional[int]=None + self, + blocks: Optional[int] = None, + bounce_drops: Optional[int] = None, + bounces: Optional[int] = None, + clicks: Optional[int] = None, + deferred: Optional[int] = None, + delivered: Optional[int] = None, + invalid_emails: Optional[int] = None, + opens: Optional[int] = None, + processed: Optional[int] = None, + requests: Optional[int] = None, + spam_report_drops: Optional[int] = None, + spam_reports: Optional[int] = None, + unique_clicks: Optional[int] = None, + unique_opens: Optional[int] = None, + unsubscribe_drops: Optional[int] = None, + unsubscribes: Optional[int] = None, ): - self.blocks=blocks - self.bounce_drops=bounce_drops - self.bounces=bounces - self.clicks=clicks - self.deferred=deferred - self.delivered=delivered - self.invalid_emails=invalid_emails - self.opens=opens - self.processed=processed - self.requests=requests - self.spam_report_drops=spam_report_drops - self.spam_reports=spam_reports - self.unique_clicks=unique_clicks - self.unique_opens=unique_opens - self.unsubscribe_drops=unsubscribe_drops - self.unsubscribes=unsubscribes + self.blocks = blocks + self.bounce_drops = bounce_drops + self.bounces = bounces + self.clicks = clicks + self.deferred = deferred + self.delivered = delivered + self.invalid_emails = invalid_emails + self.opens = opens + self.processed = processed + self.requests = requests + self.spam_report_drops = spam_report_drops + self.spam_reports = spam_reports + self.unique_clicks = unique_clicks + self.unique_opens = unique_opens + self.unsubscribe_drops = unsubscribe_drops + self.unsubscribes = unsubscribes def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "blocks": self.blocks, - "bounce_drops": self.bounce_drops, - "bounces": self.bounces, - "clicks": self.clicks, - "deferred": self.deferred, - "delivered": self.delivered, - "invalid_emails": self.invalid_emails, - "opens": self.opens, - "processed": self.processed, - "requests": self.requests, - "spam_report_drops": self.spam_report_drops, - "spam_reports": self.spam_reports, - "unique_clicks": self.unique_clicks, - "unique_opens": self.unique_opens, - "unsubscribe_drops": self.unsubscribe_drops, - "unsubscribes": self.unsubscribes - }.items() if value is not None} + "blocks": self.blocks, + "bounce_drops": self.bounce_drops, + "bounces": self.bounces, + "clicks": self.clicks, + "deferred": self.deferred, + "delivered": self.delivered, + "invalid_emails": self.invalid_emails, + "opens": self.opens, + "processed": self.processed, + "requests": self.requests, + "spam_report_drops": self.spam_report_drops, + "spam_reports": self.spam_reports, + "unique_clicks": self.unique_clicks, + "unique_opens": self.unique_opens, + "unsubscribe_drops": self.unsubscribe_drops, + "unsubscribes": self.unsubscribes, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -70,21 +70,20 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CategoryStatsStatsInnerMetrics( - blocks=payload.get('blocks'), - bounce_drops=payload.get('bounce_drops'), - bounces=payload.get('bounces'), - clicks=payload.get('clicks'), - deferred=payload.get('deferred'), - delivered=payload.get('delivered'), - invalid_emails=payload.get('invalid_emails'), - opens=payload.get('opens'), - processed=payload.get('processed'), - requests=payload.get('requests'), - spam_report_drops=payload.get('spam_report_drops'), - spam_reports=payload.get('spam_reports'), - unique_clicks=payload.get('unique_clicks'), - unique_opens=payload.get('unique_opens'), - unsubscribe_drops=payload.get('unsubscribe_drops'), - unsubscribes=payload.get('unsubscribes') - ) - + blocks=payload.get("blocks"), + bounce_drops=payload.get("bounce_drops"), + bounces=payload.get("bounces"), + clicks=payload.get("clicks"), + deferred=payload.get("deferred"), + delivered=payload.get("delivered"), + invalid_emails=payload.get("invalid_emails"), + opens=payload.get("opens"), + processed=payload.get("processed"), + requests=payload.get("requests"), + spam_report_drops=payload.get("spam_report_drops"), + spam_reports=payload.get("spam_reports"), + unique_clicks=payload.get("unique_clicks"), + unique_opens=payload.get("unique_opens"), + unsubscribe_drops=payload.get("unsubscribe_drops"), + unsubscribes=payload.get("unsubscribes"), + ) diff --git a/sendgrid/rest/api/subusers/v3/models/create_subuser_request.py b/sendgrid/rest/api/subusers/v3/models/create_subuser_request.py index 79d6c1b3..092297a8 100644 --- a/sendgrid/rest/api/subusers/v3/models/create_subuser_request.py +++ b/sendgrid/rest/api/subusers/v3/models/create_subuser_request.py @@ -1,38 +1,38 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.subusers.v3.models.region1 import Region1 - class CreateSubuserRequest: def __init__( - self, - username: Optional[str]=None, - email: Optional[str]=None, - password: Optional[str]=None, - ips: Optional[List[str]]=None, - region: Optional[Region1]=None, - include_region: Optional[bool]=None + self, + username: Optional[str] = None, + email: Optional[str] = None, + password: Optional[str] = None, + ips: Optional[List[str]] = None, + region: Optional[Region1] = None, + include_region: Optional[bool] = None, ): - self.username=username - self.email=email - self.password=password - self.ips=ips - self.region=region - self.include_region=include_region + self.username = username + self.email = email + self.password = password + self.ips = ips + self.region = region + self.include_region = include_region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "username": self.username, - "email": self.email, - "password": self.password, - "ips": self.ips, - "region": self.region, - "include_region": self.include_region - }.items() if value is not None} + "username": self.username, + "email": self.email, + "password": self.password, + "ips": self.ips, + "region": self.region, + "include_region": self.include_region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -41,11 +41,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateSubuserRequest( - username=payload.get('username'), - email=payload.get('email'), - password=payload.get('password'), - ips=payload.get('ips'), - region=payload.get('region'), - include_region=payload.get('include_region') - ) - + username=payload.get("username"), + email=payload.get("email"), + password=payload.get("password"), + ips=payload.get("ips"), + region=payload.get("region"), + include_region=payload.get("include_region"), + ) diff --git a/sendgrid/rest/api/subusers/v3/models/error_response.py b/sendgrid/rest/api/subusers/v3/models/error_response.py index f7f279c4..ff833b62 100644 --- a/sendgrid/rest/api/subusers/v3/models/error_response.py +++ b/sendgrid/rest/api/subusers/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.subusers.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.subusers.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/subusers/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/subusers/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/subusers/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/subusers/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/subusers/v3/models/list_reputation200_response_inner.py b/sendgrid/rest/api/subusers/v3/models/list_reputation200_response_inner.py index 8971f286..343153db 100644 --- a/sendgrid/rest/api/subusers/v3/models/list_reputation200_response_inner.py +++ b/sendgrid/rest/api/subusers/v3/models/list_reputation200_response_inner.py @@ -1,25 +1,23 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListReputation200ResponseInner: def __init__( - self, - reputation: Optional[float]=None, - username: Optional[str]=None + self, reputation: Optional[float] = None, username: Optional[str] = None ): - self.reputation=reputation - self.username=username + self.reputation = reputation + self.username = username def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "reputation": self.reputation, - "username": self.username - }.items() if value is not None} + "reputation": self.reputation, + "username": self.username, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +26,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListReputation200ResponseInner( - reputation=payload.get('reputation'), - username=payload.get('username') - ) - + reputation=payload.get("reputation"), username=payload.get("username") + ) diff --git a/sendgrid/rest/api/subusers/v3/models/region.py b/sendgrid/rest/api/subusers/v3/models/region.py index daf34a88..b945d019 100644 --- a/sendgrid/rest/api/subusers/v3/models/region.py +++ b/sendgrid/rest/api/subusers/v3/models/region.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Region(Enum): - ALL='all' - GLOBAL='global' - EU='eu' - + ALL = "all" + GLOBAL = "global" + EU = "eu" diff --git a/sendgrid/rest/api/subusers/v3/models/region1.py b/sendgrid/rest/api/subusers/v3/models/region1.py index 747f4fac..7d52f3be 100644 --- a/sendgrid/rest/api/subusers/v3/models/region1.py +++ b/sendgrid/rest/api/subusers/v3/models/region1.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Region1(Enum): - GLOBAL='global' - EU='eu' - + GLOBAL = "global" + EU = "eu" diff --git a/sendgrid/rest/api/subusers/v3/models/region2.py b/sendgrid/rest/api/subusers/v3/models/region2.py index bb8f30a1..3d4e02a3 100644 --- a/sendgrid/rest/api/subusers/v3/models/region2.py +++ b/sendgrid/rest/api/subusers/v3/models/region2.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Region2(Enum): - GLOBAL='global' - EU='eu' - + GLOBAL = "global" + EU = "eu" diff --git a/sendgrid/rest/api/subusers/v3/models/region3.py b/sendgrid/rest/api/subusers/v3/models/region3.py index 7d5c723e..ca8097fc 100644 --- a/sendgrid/rest/api/subusers/v3/models/region3.py +++ b/sendgrid/rest/api/subusers/v3/models/region3.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Region3(Enum): - GLOBAL='global' - EU='eu' - + GLOBAL = "global" + EU = "eu" diff --git a/sendgrid/rest/api/subusers/v3/models/reset_frequency.py b/sendgrid/rest/api/subusers/v3/models/reset_frequency.py index 3a7d412b..b9eeebd1 100644 --- a/sendgrid/rest/api/subusers/v3/models/reset_frequency.py +++ b/sendgrid/rest/api/subusers/v3/models/reset_frequency.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class ResetFrequency(Enum): - MONTHLY='monthly' - WEEKLY='weekly' - DAILY='daily' - + MONTHLY = "monthly" + WEEKLY = "weekly" + DAILY = "daily" diff --git a/sendgrid/rest/api/subusers/v3/models/reset_frequency1.py b/sendgrid/rest/api/subusers/v3/models/reset_frequency1.py index e36b3426..cf6847a2 100644 --- a/sendgrid/rest/api/subusers/v3/models/reset_frequency1.py +++ b/sendgrid/rest/api/subusers/v3/models/reset_frequency1.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class ResetFrequency1(Enum): - MONTHLY='monthly' - WEEKLY='weekly' - DAILY='daily' - + MONTHLY = "monthly" + WEEKLY = "weekly" + DAILY = "daily" diff --git a/sendgrid/rest/api/subusers/v3/models/sort_by_direction.py b/sendgrid/rest/api/subusers/v3/models/sort_by_direction.py index 76757c62..b544b184 100644 --- a/sendgrid/rest/api/subusers/v3/models/sort_by_direction.py +++ b/sendgrid/rest/api/subusers/v3/models/sort_by_direction.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class SortByDirection(Enum): - DESC='desc' - ASC='asc' - + DESC = "desc" + ASC = "asc" diff --git a/sendgrid/rest/api/subusers/v3/models/sort_by_direction1.py b/sendgrid/rest/api/subusers/v3/models/sort_by_direction1.py index 5956f4b3..5a2d4075 100644 --- a/sendgrid/rest/api/subusers/v3/models/sort_by_direction1.py +++ b/sendgrid/rest/api/subusers/v3/models/sort_by_direction1.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class SortByDirection1(Enum): - DESC='desc' - ASC='asc' - + DESC = "desc" + ASC = "asc" diff --git a/sendgrid/rest/api/subusers/v3/models/sort_by_direction2.py b/sendgrid/rest/api/subusers/v3/models/sort_by_direction2.py index ca7daea5..6fd0319f 100644 --- a/sendgrid/rest/api/subusers/v3/models/sort_by_direction2.py +++ b/sendgrid/rest/api/subusers/v3/models/sort_by_direction2.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class SortByDirection2(Enum): - DESC='desc' - ASC='asc' - + DESC = "desc" + ASC = "asc" diff --git a/sendgrid/rest/api/subusers/v3/models/sort_by_metric.py b/sendgrid/rest/api/subusers/v3/models/sort_by_metric.py index c91dd673..2280cdd6 100644 --- a/sendgrid/rest/api/subusers/v3/models/sort_by_metric.py +++ b/sendgrid/rest/api/subusers/v3/models/sort_by_metric.py @@ -1,18 +1,14 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class SortByMetric(Enum): - BLOCKS='blocks' - BOUNCES='bounces' - CLICKS='clicks' - DELIVERED='delivered' - OPENS='opens' - REQUESTS='requests' - UNIQUE_CLICKS='unique_clicks' - UNIQUE_OPENS='unique_opens' - UNSUBSCRIBES='unsubscribes' - + BLOCKS = "blocks" + BOUNCES = "bounces" + CLICKS = "clicks" + DELIVERED = "delivered" + OPENS = "opens" + REQUESTS = "requests" + UNIQUE_CLICKS = "unique_clicks" + UNIQUE_OPENS = "unique_opens" + UNSUBSCRIBES = "unsubscribes" diff --git a/sendgrid/rest/api/subusers/v3/models/subuser.py b/sendgrid/rest/api/subusers/v3/models/subuser.py index 4a748875..44c1e9db 100644 --- a/sendgrid/rest/api/subusers/v3/models/subuser.py +++ b/sendgrid/rest/api/subusers/v3/models/subuser.py @@ -1,35 +1,35 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.subusers.v3.models.region2 import Region2 - class Subuser: def __init__( - self, - disabled: Optional[bool]=None, - id: Optional[float]=None, - username: Optional[str]=None, - email: Optional[str]=None, - region: Optional[Region2]=None + self, + disabled: Optional[bool] = None, + id: Optional[float] = None, + username: Optional[str] = None, + email: Optional[str] = None, + region: Optional[Region2] = None, ): - self.disabled=disabled - self.id=id - self.username=username - self.email=email - self.region=region + self.disabled = disabled + self.id = id + self.username = username + self.email = email + self.region = region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "disabled": self.disabled, - "id": self.id, - "username": self.username, - "email": self.email, - "region": self.region - }.items() if value is not None} + "disabled": self.disabled, + "id": self.id, + "username": self.username, + "email": self.email, + "region": self.region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -38,10 +38,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Subuser( - disabled=payload.get('disabled'), - id=payload.get('id'), - username=payload.get('username'), - email=payload.get('email'), - region=payload.get('region') - ) - + disabled=payload.get("disabled"), + id=payload.get("id"), + username=payload.get("username"), + email=payload.get("email"), + region=payload.get("region"), + ) diff --git a/sendgrid/rest/api/subusers/v3/models/subuser_credits.py b/sendgrid/rest/api/subusers/v3/models/subuser_credits.py index 7d7f1f2f..a11a7721 100644 --- a/sendgrid/rest/api/subusers/v3/models/subuser_credits.py +++ b/sendgrid/rest/api/subusers/v3/models/subuser_credits.py @@ -1,36 +1,36 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.subusers.v3.models.reset_frequency import ResetFrequency from sendgrid.rest.api.subusers.v3.models.type import Type - class SubuserCredits: def __init__( - self, - type: Optional[Type]=None, - reset_frequency: Optional[ResetFrequency]=None, - remain: Optional[int]=None, - total: Optional[int]=None, - used: Optional[int]=None + self, + type: Optional[Type] = None, + reset_frequency: Optional[ResetFrequency] = None, + remain: Optional[int] = None, + total: Optional[int] = None, + used: Optional[int] = None, ): - self.type=type - self.reset_frequency=reset_frequency - self.remain=remain - self.total=total - self.used=used + self.type = type + self.reset_frequency = reset_frequency + self.remain = remain + self.total = total + self.used = used def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "type": self.type, - "reset_frequency": self.reset_frequency, - "remain": self.remain, - "total": self.total, - "used": self.used - }.items() if value is not None} + "type": self.type, + "reset_frequency": self.reset_frequency, + "remain": self.remain, + "total": self.total, + "used": self.used, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -39,10 +39,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SubuserCredits( - type=payload.get('type'), - reset_frequency=payload.get('reset_frequency'), - remain=payload.get('remain'), - total=payload.get('total'), - used=payload.get('used') - ) - + type=payload.get("type"), + reset_frequency=payload.get("reset_frequency"), + remain=payload.get("remain"), + total=payload.get("total"), + used=payload.get("used"), + ) diff --git a/sendgrid/rest/api/subusers/v3/models/subuser_credits_request.py b/sendgrid/rest/api/subusers/v3/models/subuser_credits_request.py index 94596d4b..5558fd0f 100644 --- a/sendgrid/rest/api/subusers/v3/models/subuser_credits_request.py +++ b/sendgrid/rest/api/subusers/v3/models/subuser_credits_request.py @@ -1,30 +1,30 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.subusers.v3.models.reset_frequency1 import ResetFrequency1 from sendgrid.rest.api.subusers.v3.models.type1 import Type1 - class SubuserCreditsRequest: def __init__( - self, - type: Optional[Type1]=None, - reset_frequency: Optional[ResetFrequency1]=None, - total: Optional[int]=None + self, + type: Optional[Type1] = None, + reset_frequency: Optional[ResetFrequency1] = None, + total: Optional[int] = None, ): - self.type=type - self.reset_frequency=reset_frequency - self.total=total + self.type = type + self.reset_frequency = reset_frequency + self.total = total def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "type": self.type, - "reset_frequency": self.reset_frequency, - "total": self.total - }.items() if value is not None} + "type": self.type, + "reset_frequency": self.reset_frequency, + "total": self.total, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -33,8 +33,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SubuserCreditsRequest( - type=payload.get('type'), - reset_frequency=payload.get('reset_frequency'), - total=payload.get('total') - ) - + type=payload.get("type"), + reset_frequency=payload.get("reset_frequency"), + total=payload.get("total"), + ) diff --git a/sendgrid/rest/api/subusers/v3/models/subuser_post.py b/sendgrid/rest/api/subusers/v3/models/subuser_post.py index ba399da6..cb56fe85 100644 --- a/sendgrid/rest/api/subusers/v3/models/subuser_post.py +++ b/sendgrid/rest/api/subusers/v3/models/subuser_post.py @@ -1,36 +1,38 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.subusers.v3.models.region3 import Region3 -from sendgrid.rest.api.subusers.v3.models.subuser_post_credit_allocation import SubuserPostCreditAllocation - +from sendgrid.rest.api.subusers.v3.models.subuser_post_credit_allocation import ( + SubuserPostCreditAllocation, +) class SubuserPost: def __init__( - self, - username: Optional[str]=None, - user_id: Optional[float]=None, - email: Optional[str]=None, - credit_allocation: Optional[SubuserPostCreditAllocation]=None, - region: Optional[Region3]=None + self, + username: Optional[str] = None, + user_id: Optional[float] = None, + email: Optional[str] = None, + credit_allocation: Optional[SubuserPostCreditAllocation] = None, + region: Optional[Region3] = None, ): - self.username=username - self.user_id=user_id - self.email=email - self.credit_allocation=credit_allocation - self.region=region + self.username = username + self.user_id = user_id + self.email = email + self.credit_allocation = credit_allocation + self.region = region def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "username": self.username, - "user_id": self.user_id, - "email": self.email, - "credit_allocation": self.credit_allocation, - "region": self.region - }.items() if value is not None} + "username": self.username, + "user_id": self.user_id, + "email": self.email, + "credit_allocation": self.credit_allocation, + "region": self.region, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -39,10 +41,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SubuserPost( - username=payload.get('username'), - user_id=payload.get('user_id'), - email=payload.get('email'), - credit_allocation=payload.get('credit_allocation'), - region=payload.get('region') - ) - + username=payload.get("username"), + user_id=payload.get("user_id"), + email=payload.get("email"), + credit_allocation=payload.get("credit_allocation"), + region=payload.get("region"), + ) diff --git a/sendgrid/rest/api/subusers/v3/models/subuser_post_credit_allocation.py b/sendgrid/rest/api/subusers/v3/models/subuser_post_credit_allocation.py index 4c0bf7c7..cb07a046 100644 --- a/sendgrid/rest/api/subusers/v3/models/subuser_post_credit_allocation.py +++ b/sendgrid/rest/api/subusers/v3/models/subuser_post_credit_allocation.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SubuserPostCreditAllocation: - def __init__( - self, - type: Optional[str]=None - ): - self.type=type + def __init__(self, type: Optional[str] = None): + self.type = type def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "type": self.type - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"type": self.type}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SubuserPostCreditAllocation( - type=payload.get('type') - ) - + return SubuserPostCreditAllocation(type=payload.get("type")) diff --git a/sendgrid/rest/api/subusers/v3/models/subuser_stats.py b/sendgrid/rest/api/subusers/v3/models/subuser_stats.py index 64f60262..0ba8c39b 100644 --- a/sendgrid/rest/api/subusers/v3/models/subuser_stats.py +++ b/sendgrid/rest/api/subusers/v3/models/subuser_stats.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.subusers.v3.models.subuser_stats_stats_inner import SubuserStatsStatsInner - +from sendgrid.rest.api.subusers.v3.models.subuser_stats_stats_inner import ( + SubuserStatsStatsInner, +) class SubuserStats: def __init__( - self, - var_date: Optional[str]=None, - stats: Optional[List[SubuserStatsStatsInner]]=None + self, + var_date: Optional[str] = None, + stats: Optional[List[SubuserStatsStatsInner]] = None, ): - self.var_date=var_date - self.stats=stats + self.var_date = var_date + self.stats = stats def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "date": self.var_date, - "stats": self.stats - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"date": self.var_date, "stats": self.stats}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return SubuserStats( - var_date=payload.get('date'), - stats=payload.get('stats') - ) - + return SubuserStats(var_date=payload.get("date"), stats=payload.get("stats")) diff --git a/sendgrid/rest/api/subusers/v3/models/subuser_stats_stats_inner.py b/sendgrid/rest/api/subusers/v3/models/subuser_stats_stats_inner.py index e3c3888e..c6f69c3d 100644 --- a/sendgrid/rest/api/subusers/v3/models/subuser_stats_stats_inner.py +++ b/sendgrid/rest/api/subusers/v3/models/subuser_stats_stats_inner.py @@ -1,35 +1,37 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.subusers.v3.models.subuser_stats_stats_inner_metrics import SubuserStatsStatsInnerMetrics - +from sendgrid.rest.api.subusers.v3.models.subuser_stats_stats_inner_metrics import ( + SubuserStatsStatsInnerMetrics, +) class SubuserStatsStatsInner: def __init__( - self, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - metrics: Optional[SubuserStatsStatsInnerMetrics]=None, - name: Optional[str]=None, - type: Optional[str]=None + self, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + metrics: Optional[SubuserStatsStatsInnerMetrics] = None, + name: Optional[str] = None, + type: Optional[str] = None, ): - self.first_name=first_name - self.last_name=last_name - self.metrics=metrics - self.name=name - self.type=type + self.first_name = first_name + self.last_name = last_name + self.metrics = metrics + self.name = name + self.type = type def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "first_name": self.first_name, - "last_name": self.last_name, - "metrics": self.metrics, - "name": self.name, - "type": self.type - }.items() if value is not None} + "first_name": self.first_name, + "last_name": self.last_name, + "metrics": self.metrics, + "name": self.name, + "type": self.type, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -38,10 +40,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SubuserStatsStatsInner( - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - metrics=payload.get('metrics'), - name=payload.get('name'), - type=payload.get('type') - ) - + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + metrics=payload.get("metrics"), + name=payload.get("name"), + type=payload.get("type"), + ) diff --git a/sendgrid/rest/api/subusers/v3/models/subuser_stats_stats_inner_metrics.py b/sendgrid/rest/api/subusers/v3/models/subuser_stats_stats_inner_metrics.py index e02e1fb0..c8df613f 100644 --- a/sendgrid/rest/api/subusers/v3/models/subuser_stats_stats_inner_metrics.py +++ b/sendgrid/rest/api/subusers/v3/models/subuser_stats_stats_inner_metrics.py @@ -1,67 +1,67 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SubuserStatsStatsInnerMetrics: def __init__( - self, - blocks: Optional[int]=None, - bounce_drops: Optional[int]=None, - bounces: Optional[int]=None, - clicks: Optional[int]=None, - deferred: Optional[int]=None, - delivered: Optional[int]=None, - invalid_emails: Optional[int]=None, - opens: Optional[int]=None, - processed: Optional[int]=None, - requests: Optional[int]=None, - spam_report_drops: Optional[int]=None, - spam_reports: Optional[int]=None, - unique_clicks: Optional[int]=None, - unique_opens: Optional[int]=None, - unsubscribe_drops: Optional[int]=None, - unsubscribes: Optional[int]=None + self, + blocks: Optional[int] = None, + bounce_drops: Optional[int] = None, + bounces: Optional[int] = None, + clicks: Optional[int] = None, + deferred: Optional[int] = None, + delivered: Optional[int] = None, + invalid_emails: Optional[int] = None, + opens: Optional[int] = None, + processed: Optional[int] = None, + requests: Optional[int] = None, + spam_report_drops: Optional[int] = None, + spam_reports: Optional[int] = None, + unique_clicks: Optional[int] = None, + unique_opens: Optional[int] = None, + unsubscribe_drops: Optional[int] = None, + unsubscribes: Optional[int] = None, ): - self.blocks=blocks - self.bounce_drops=bounce_drops - self.bounces=bounces - self.clicks=clicks - self.deferred=deferred - self.delivered=delivered - self.invalid_emails=invalid_emails - self.opens=opens - self.processed=processed - self.requests=requests - self.spam_report_drops=spam_report_drops - self.spam_reports=spam_reports - self.unique_clicks=unique_clicks - self.unique_opens=unique_opens - self.unsubscribe_drops=unsubscribe_drops - self.unsubscribes=unsubscribes + self.blocks = blocks + self.bounce_drops = bounce_drops + self.bounces = bounces + self.clicks = clicks + self.deferred = deferred + self.delivered = delivered + self.invalid_emails = invalid_emails + self.opens = opens + self.processed = processed + self.requests = requests + self.spam_report_drops = spam_report_drops + self.spam_reports = spam_reports + self.unique_clicks = unique_clicks + self.unique_opens = unique_opens + self.unsubscribe_drops = unsubscribe_drops + self.unsubscribes = unsubscribes def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "blocks": self.blocks, - "bounce_drops": self.bounce_drops, - "bounces": self.bounces, - "clicks": self.clicks, - "deferred": self.deferred, - "delivered": self.delivered, - "invalid_emails": self.invalid_emails, - "opens": self.opens, - "processed": self.processed, - "requests": self.requests, - "spam_report_drops": self.spam_report_drops, - "spam_reports": self.spam_reports, - "unique_clicks": self.unique_clicks, - "unique_opens": self.unique_opens, - "unsubscribe_drops": self.unsubscribe_drops, - "unsubscribes": self.unsubscribes - }.items() if value is not None} + "blocks": self.blocks, + "bounce_drops": self.bounce_drops, + "bounces": self.bounces, + "clicks": self.clicks, + "deferred": self.deferred, + "delivered": self.delivered, + "invalid_emails": self.invalid_emails, + "opens": self.opens, + "processed": self.processed, + "requests": self.requests, + "spam_report_drops": self.spam_report_drops, + "spam_reports": self.spam_reports, + "unique_clicks": self.unique_clicks, + "unique_opens": self.unique_opens, + "unsubscribe_drops": self.unsubscribe_drops, + "unsubscribes": self.unsubscribes, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -70,21 +70,20 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SubuserStatsStatsInnerMetrics( - blocks=payload.get('blocks'), - bounce_drops=payload.get('bounce_drops'), - bounces=payload.get('bounces'), - clicks=payload.get('clicks'), - deferred=payload.get('deferred'), - delivered=payload.get('delivered'), - invalid_emails=payload.get('invalid_emails'), - opens=payload.get('opens'), - processed=payload.get('processed'), - requests=payload.get('requests'), - spam_report_drops=payload.get('spam_report_drops'), - spam_reports=payload.get('spam_reports'), - unique_clicks=payload.get('unique_clicks'), - unique_opens=payload.get('unique_opens'), - unsubscribe_drops=payload.get('unsubscribe_drops'), - unsubscribes=payload.get('unsubscribes') - ) - + blocks=payload.get("blocks"), + bounce_drops=payload.get("bounce_drops"), + bounces=payload.get("bounces"), + clicks=payload.get("clicks"), + deferred=payload.get("deferred"), + delivered=payload.get("delivered"), + invalid_emails=payload.get("invalid_emails"), + opens=payload.get("opens"), + processed=payload.get("processed"), + requests=payload.get("requests"), + spam_report_drops=payload.get("spam_report_drops"), + spam_reports=payload.get("spam_reports"), + unique_clicks=payload.get("unique_clicks"), + unique_opens=payload.get("unique_opens"), + unsubscribe_drops=payload.get("unsubscribe_drops"), + unsubscribes=payload.get("unsubscribes"), + ) diff --git a/sendgrid/rest/api/subusers/v3/models/type.py b/sendgrid/rest/api/subusers/v3/models/type.py index 6c1f2d39..a9130bef 100644 --- a/sendgrid/rest/api/subusers/v3/models/type.py +++ b/sendgrid/rest/api/subusers/v3/models/type.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Type(Enum): - UNLIMITED='unlimited' - RECURRING='recurring' - NONRECURRING='nonrecurring' - + UNLIMITED = "unlimited" + RECURRING = "recurring" + NONRECURRING = "nonrecurring" diff --git a/sendgrid/rest/api/subusers/v3/models/type1.py b/sendgrid/rest/api/subusers/v3/models/type1.py index 00c17432..3eb5a2aa 100644 --- a/sendgrid/rest/api/subusers/v3/models/type1.py +++ b/sendgrid/rest/api/subusers/v3/models/type1.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Type1(Enum): - UNLIMITED='unlimited' - RECURRING='recurring' - NONRECURRING='nonrecurring' - + UNLIMITED = "unlimited" + RECURRING = "recurring" + NONRECURRING = "nonrecurring" diff --git a/sendgrid/rest/api/subusers/v3/models/update_subuser_ip200_response.py b/sendgrid/rest/api/subusers/v3/models/update_subuser_ip200_response.py index 362e7010..9b76c97b 100644 --- a/sendgrid/rest/api/subusers/v3/models/update_subuser_ip200_response.py +++ b/sendgrid/rest/api/subusers/v3/models/update_subuser_ip200_response.py @@ -1,22 +1,17 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateSubuserIp200Response: - def __init__( - self, - ips: Optional[List[str]]=None - ): - self.ips=ips + def __init__(self, ips: Optional[List[str]] = None): + self.ips = ips def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "ips": self.ips - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"ips": self.ips}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateSubuserIp200Response( - ips=payload.get('ips') - ) - + return UpdateSubuserIp200Response(ips=payload.get("ips")) diff --git a/sendgrid/rest/api/subusers/v3/models/update_subuser_remaining_credit_request.py b/sendgrid/rest/api/subusers/v3/models/update_subuser_remaining_credit_request.py index 83b4ec95..0bdaf23d 100644 --- a/sendgrid/rest/api/subusers/v3/models/update_subuser_remaining_credit_request.py +++ b/sendgrid/rest/api/subusers/v3/models/update_subuser_remaining_credit_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateSubuserRemainingCreditRequest: - def __init__( - self, - allocation_update: Optional[int]=None - ): - self.allocation_update=allocation_update + def __init__(self, allocation_update: Optional[int] = None): + self.allocation_update = allocation_update def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "allocation_update": self.allocation_update - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"allocation_update": self.allocation_update}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,6 +20,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateSubuserRemainingCreditRequest( - allocation_update=payload.get('allocation_update') - ) - + allocation_update=payload.get("allocation_update") + ) diff --git a/sendgrid/rest/api/subusers/v3/models/update_subuser_request.py b/sendgrid/rest/api/subusers/v3/models/update_subuser_request.py index ebcad2ed..982a3b72 100644 --- a/sendgrid/rest/api/subusers/v3/models/update_subuser_request.py +++ b/sendgrid/rest/api/subusers/v3/models/update_subuser_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateSubuserRequest: - def __init__( - self, - disabled: Optional[bool]=None - ): - self.disabled=disabled + def __init__(self, disabled: Optional[bool] = None): + self.disabled = disabled def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "disabled": self.disabled - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"disabled": self.disabled}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateSubuserRequest( - disabled=payload.get('disabled') - ) - + return UpdateSubuserRequest(disabled=payload.get("disabled")) diff --git a/sendgrid/rest/api/subusers/v3/models/update_subuser_website_access_request.py b/sendgrid/rest/api/subusers/v3/models/update_subuser_website_access_request.py index a5c0b328..8f3ff0d9 100644 --- a/sendgrid/rest/api/subusers/v3/models/update_subuser_website_access_request.py +++ b/sendgrid/rest/api/subusers/v3/models/update_subuser_website_access_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateSubuserWebsiteAccessRequest: - def __init__( - self, - disabled: Optional[bool]=None - ): - self.disabled=disabled + def __init__(self, disabled: Optional[bool] = None): + self.disabled = disabled def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "disabled": self.disabled - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"disabled": self.disabled}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateSubuserWebsiteAccessRequest( - disabled=payload.get('disabled') - ) - + return UpdateSubuserWebsiteAccessRequest(disabled=payload.get("disabled")) diff --git a/sendgrid/rest/api/subusers/v3/update_subuser.py b/sendgrid/rest/api/subusers/v3/update_subuser.py index 084b7490..89720ad9 100644 --- a/sendgrid/rest/api/subusers/v3/update_subuser.py +++ b/sendgrid/rest/api/subusers/v3/update_subuser.py @@ -12,52 +12,50 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.subusers.v3.models.update_subuser_request import UpdateSubuserRequest +from sendgrid.rest.api.subusers.v3.models.update_subuser_request import ( + UpdateSubuserRequest, +) + class UpdateSubuser: def __init__(self, client) -> None: self.client = client - + def send( self, - subuser_name: str, - update_subuser_request: Optional[UpdateSubuserRequest] = None, - + subuser_name: str, + update_subuser_request: Optional[UpdateSubuserRequest] = None, ): - path='/v3/subusers/{subuser_name}' + path = "/v3/subusers/{subuser_name}" path = path.format( - subuser_name=subuser_name, + subuser_name=subuser_name, ) data = None if update_subuser_request: data = update_subuser_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/subusers/v3/update_subuser_credit.py b/sendgrid/rest/api/subusers/v3/update_subuser_credit.py index 438876c1..d3f95802 100644 --- a/sendgrid/rest/api/subusers/v3/update_subuser_credit.py +++ b/sendgrid/rest/api/subusers/v3/update_subuser_credit.py @@ -12,52 +12,49 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.subusers.v3.models.subuser_credits import SubuserCredits -from sendgrid.rest.api.subusers.v3.models.subuser_credits_request import SubuserCreditsRequest +from sendgrid.rest.api.subusers.v3.models.subuser_credits_request import ( + SubuserCreditsRequest, +) + class UpdateSubuserCredit: def __init__(self, client) -> None: self.client = client - + def send( self, - subuser_name: str, - subuser_credits_request: Optional[SubuserCreditsRequest] = None, - + subuser_name: str, + subuser_credits_request: Optional[SubuserCreditsRequest] = None, ): - path='/v3/subusers/{subuser_name}/credits' + path = "/v3/subusers/{subuser_name}/credits" path = path.format( - subuser_name=subuser_name, + subuser_name=subuser_name, ) data = None if subuser_credits_request: data = subuser_credits_request.to_dict() - request = Request( - method='PUT', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/subusers/v3/update_subuser_ip.py b/sendgrid/rest/api/subusers/v3/update_subuser_ip.py index 8d077064..d9d18442 100644 --- a/sendgrid/rest/api/subusers/v3/update_subuser_ip.py +++ b/sendgrid/rest/api/subusers/v3/update_subuser_ip.py @@ -12,52 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import List, Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import List, Optional -from typing_extensions import Annotated -from sendgrid.rest.api.subusers.v3.models.update_subuser_ip200_response import UpdateSubuserIp200Response + class UpdateSubuserIp: def __init__(self, client) -> None: self.client = client - + def send( self, - subuser_name: str, - request_body: Optional[List[str]] = None, - + subuser_name: str, + request_body: Optional[List[str]] = None, ): - path='/v3/subusers/{subuser_name}/ips' + path = "/v3/subusers/{subuser_name}/ips" path = path.format( - subuser_name=subuser_name, + subuser_name=subuser_name, ) data = None if request_body: data = request_body.to_dict() - request = Request( - method='PUT', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/subusers/v3/update_subuser_remaining_credit.py b/sendgrid/rest/api/subusers/v3/update_subuser_remaining_credit.py index e019a63c..e4d386e7 100644 --- a/sendgrid/rest/api/subusers/v3/update_subuser_remaining_credit.py +++ b/sendgrid/rest/api/subusers/v3/update_subuser_remaining_credit.py @@ -12,52 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing_extensions import Annotated -from sendgrid.rest.api.subusers.v3.models.subuser_credits import SubuserCredits -from sendgrid.rest.api.subusers.v3.models.update_subuser_remaining_credit_request import UpdateSubuserRemainingCreditRequest +from sendgrid.rest.api.subusers.v3.models.update_subuser_remaining_credit_request import ( + UpdateSubuserRemainingCreditRequest, +) + class UpdateSubuserRemainingCredit: def __init__(self, client) -> None: self.client = client - + def send( self, - subuser_name: str, - update_subuser_remaining_credit_request: Optional[UpdateSubuserRemainingCreditRequest] = None, - + subuser_name: str, + update_subuser_remaining_credit_request: Optional[ + UpdateSubuserRemainingCreditRequest + ] = None, ): - path='/v3/subusers/{subuser_name}/credits/remaining' + path = "/v3/subusers/{subuser_name}/credits/remaining" path = path.format( - subuser_name=subuser_name, + subuser_name=subuser_name, ) data = None if update_subuser_remaining_credit_request: data = update_subuser_remaining_credit_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/subusers/v3/update_subuser_website_access.py b/sendgrid/rest/api/subusers/v3/update_subuser_website_access.py index 9d4ca334..602c2058 100644 --- a/sendgrid/rest/api/subusers/v3/update_subuser_website_access.py +++ b/sendgrid/rest/api/subusers/v3/update_subuser_website_access.py @@ -12,51 +12,52 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import StrictStr from typing import Optional -from sendgrid.rest.api.subusers.v3.models.update_subuser_website_access_request import UpdateSubuserWebsiteAccessRequest +from sendgrid.rest.api.subusers.v3.models.update_subuser_website_access_request import ( + UpdateSubuserWebsiteAccessRequest, +) + class UpdateSubuserWebsiteAccess: def __init__(self, client) -> None: self.client = client - + def send( self, - subuser_name: str, - update_subuser_website_access_request: Optional[UpdateSubuserWebsiteAccessRequest] = None, - + subuser_name: str, + update_subuser_website_access_request: Optional[ + UpdateSubuserWebsiteAccessRequest + ] = None, ): - path='/v3/subusers/{subuser_name}/website_access' + path = "/v3/subusers/{subuser_name}/website_access" path = path.format( - subuser_name=subuser_name, + subuser_name=subuser_name, ) data = None if update_subuser_website_access_request: data = update_subuser_website_access_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/__init__.py b/sendgrid/rest/api/suppressions/v3/__init__.py new file mode 100644 index 00000000..46409041 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/__init__.py @@ -0,0 +1 @@ +# TODO diff --git a/sendgrid/rest/api/suppressions/v3/add_suppression_to_asm_group.py b/sendgrid/rest/api/suppressions/v3/add_suppression_to_asm_group.py new file mode 100644 index 00000000..c6c05cad --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/add_suppression_to_asm_group.py @@ -0,0 +1,69 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.suppressions.v3.models.suppressions_request import ( + SuppressionsRequest, +) + + +class AddSuppressionToAsmGroup: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + group_id: str, + on_behalf_of: Optional[str] = None, + suppressions_request: Optional[SuppressionsRequest] = None, + ): + path = "/v3/asm/groups/{group_id}/suppressions" + path = path.format( + group_id=group_id, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + headers["Content-Type"] = "application/json" + data = None + if suppressions_request: + data = suppressions_request.to_dict() + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/creat_asm_group.py b/sendgrid/rest/api/suppressions/v3/creat_asm_group.py new file mode 100644 index 00000000..6419005d --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/creat_asm_group.py @@ -0,0 +1,67 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.suppressions.v3.models.suppression_group_request_base_props import ( + SuppressionGroupRequestBaseProps, +) + + +class CreatAsmGroup: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + suppression_group_request_base_props: Optional[ + SuppressionGroupRequestBaseProps + ] = None, + ): + path = "/v3/asm/groups" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + headers["Content-Type"] = "application/json" + data = None + if suppression_group_request_base_props: + data = suppression_group_request_base_props.to_dict() + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/create_global_suppression.py b/sendgrid/rest/api/suppressions/v3/create_global_suppression.py new file mode 100644 index 00000000..acb2df6b --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/create_global_suppression.py @@ -0,0 +1,65 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.suppressions.v3.models.suppressions_request import ( + SuppressionsRequest, +) + + +class CreateGlobalSuppression: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + suppressions_request: Optional[SuppressionsRequest] = None, + ): + path = "/v3/asm/suppressions/global" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + headers["Content-Type"] = "application/json" + data = None + if suppressions_request: + data = suppressions_request.to_dict() + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/delete_asm_group.py b/sendgrid/rest/api/suppressions/v3/delete_asm_group.py new file mode 100644 index 00000000..af65ba7c --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/delete_asm_group.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class DeleteAsmGroup: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + group_id: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/asm/groups/{group_id}" + path = path.format( + group_id=group_id, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/delete_global_suppression.py b/sendgrid/rest/api/suppressions/v3/delete_global_suppression.py new file mode 100644 index 00000000..77c1ac79 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/delete_global_suppression.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class DeleteGlobalSuppression: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + email: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/asm/suppressions/global/{email}" + path = path.format( + email=email, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/delete_invalid_email.py b/sendgrid/rest/api/suppressions/v3/delete_invalid_email.py new file mode 100644 index 00000000..cbac5d9f --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/delete_invalid_email.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class DeleteInvalidEmail: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + email: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/suppression/invalid_emails/{email}" + path = path.format( + email=email, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/delete_invalid_emails.py b/sendgrid/rest/api/suppressions/v3/delete_invalid_emails.py new file mode 100644 index 00000000..685f2cfd --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/delete_invalid_emails.py @@ -0,0 +1,65 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.suppressions.v3.models.delete_invalid_emails_request import ( + DeleteInvalidEmailsRequest, +) + + +class DeleteInvalidEmails: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + delete_invalid_emails_request: Optional[DeleteInvalidEmailsRequest] = None, + ): + path = "/v3/suppression/invalid_emails" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + headers["Content-Type"] = "application/json" + data = None + if delete_invalid_emails_request: + data = delete_invalid_emails_request.to_dict() + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/delete_spam_report.py b/sendgrid/rest/api/suppressions/v3/delete_spam_report.py new file mode 100644 index 00000000..f0a07d7b --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/delete_spam_report.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class DeleteSpamReport: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + email: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/suppression/spam_reports/{email}" + path = path.format( + email=email, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/delete_spam_reports.py b/sendgrid/rest/api/suppressions/v3/delete_spam_reports.py new file mode 100644 index 00000000..f5c40461 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/delete_spam_reports.py @@ -0,0 +1,65 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.suppressions.v3.models.delete_spam_reports_request import ( + DeleteSpamReportsRequest, +) + + +class DeleteSpamReports: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + delete_spam_reports_request: Optional[DeleteSpamReportsRequest] = None, + ): + path = "/v3/suppression/spam_reports" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + headers["Content-Type"] = "application/json" + data = None + if delete_spam_reports_request: + data = delete_spam_reports_request.to_dict() + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/delete_suppression_block.py b/sendgrid/rest/api/suppressions/v3/delete_suppression_block.py new file mode 100644 index 00000000..c598d4b2 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/delete_suppression_block.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class DeleteSuppressionBlock: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + email: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/suppression/blocks/{email}" + path = path.format( + email=email, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/delete_suppression_blocks.py b/sendgrid/rest/api/suppressions/v3/delete_suppression_blocks.py new file mode 100644 index 00000000..7692fbf4 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/delete_suppression_blocks.py @@ -0,0 +1,67 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.suppressions.v3.models.delete_suppression_blocks_request import ( + DeleteSuppressionBlocksRequest, +) + + +class DeleteSuppressionBlocks: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + delete_suppression_blocks_request: Optional[ + DeleteSuppressionBlocksRequest + ] = None, + ): + path = "/v3/suppression/blocks" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + headers["Content-Type"] = "application/json" + data = None + if delete_suppression_blocks_request: + data = delete_suppression_blocks_request.to_dict() + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/delete_suppression_bounce.py b/sendgrid/rest/api/suppressions/v3/delete_suppression_bounce.py new file mode 100644 index 00000000..f68874c6 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/delete_suppression_bounce.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class DeleteSuppressionBounce: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + email: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/suppression/bounces/{email}" + path = path.format( + email=email, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/delete_suppression_bounces.py b/sendgrid/rest/api/suppressions/v3/delete_suppression_bounces.py new file mode 100644 index 00000000..efee93ad --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/delete_suppression_bounces.py @@ -0,0 +1,67 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.suppressions.v3.models.delete_suppression_bounces_request import ( + DeleteSuppressionBouncesRequest, +) + + +class DeleteSuppressionBounces: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + delete_suppression_bounces_request: Optional[ + DeleteSuppressionBouncesRequest + ] = None, + ): + path = "/v3/suppression/bounces" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + headers["Content-Type"] = "application/json" + data = None + if delete_suppression_bounces_request: + data = delete_suppression_bounces_request.to_dict() + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/delete_suppression_from_asm_group.py b/sendgrid/rest/api/suppressions/v3/delete_suppression_from_asm_group.py new file mode 100644 index 00000000..cff47619 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/delete_suppression_from_asm_group.py @@ -0,0 +1,64 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class DeleteSuppressionFromAsmGroup: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + group_id: str, + email: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/asm/groups/{group_id}/suppressions/{email}" + path = path.format( + group_id=group_id, + email=email, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/get_asm_group.py b/sendgrid/rest/api/suppressions/v3/get_asm_group.py new file mode 100644 index 00000000..8aa511cb --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/get_asm_group.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class GetAsmGroup: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + group_id: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/asm/groups/{group_id}" + path = path.format( + group_id=group_id, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/get_asm_suppression.py b/sendgrid/rest/api/suppressions/v3/get_asm_suppression.py new file mode 100644 index 00000000..4e87cffe --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/get_asm_suppression.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class GetAsmSuppression: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + email: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/asm/suppressions/{email}" + path = path.format( + email=email, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/get_global_suppression.py b/sendgrid/rest/api/suppressions/v3/get_global_suppression.py new file mode 100644 index 00000000..e31f194a --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/get_global_suppression.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class GetGlobalSuppression: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + email: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/asm/suppressions/global/{email}" + path = path.format( + email=email, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/get_invalid_email.py b/sendgrid/rest/api/suppressions/v3/get_invalid_email.py new file mode 100644 index 00000000..8bf6d88b --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/get_invalid_email.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class GetInvalidEmail: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + email: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/suppression/invalid_emails/{email}" + path = path.format( + email=email, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/get_spam_report.py b/sendgrid/rest/api/suppressions/v3/get_spam_report.py new file mode 100644 index 00000000..837eb1ab --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/get_spam_report.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class GetSpamReport: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + email: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/suppression/spam_reports/{email}" + path = path.format( + email=email, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/get_suppression_block.py b/sendgrid/rest/api/suppressions/v3/get_suppression_block.py new file mode 100644 index 00000000..ffc6fa88 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/get_suppression_block.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class GetSuppressionBlock: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + email: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/suppression/blocks/{email}" + path = path.format( + email=email, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/get_suppression_bounces.py b/sendgrid/rest/api/suppressions/v3/get_suppression_bounces.py new file mode 100644 index 00000000..d5c5f957 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/get_suppression_bounces.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class GetSuppressionBounces: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + email: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/suppression/bounces/{email}" + path = path.format( + email=email, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/get_suppression_bounces_classifications.py b/sendgrid/rest/api/suppressions/v3/get_suppression_bounces_classifications.py new file mode 100644 index 00000000..cf3d52f8 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/get_suppression_bounces_classifications.py @@ -0,0 +1,68 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.suppressions.v3.models.accept1 import Accept1 +from sendgrid.rest.api.suppressions.v3.models.classification1 import Classification1 + + +class GetSuppressionBouncesClassifications: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + classification: Classification1, + accept: Optional[Accept1] = None, + on_behalf_of: Optional[str] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, + ): + path = "/v3/suppression/bounces/classifications/{classification}" + path = path.format( + classification=classification, + ) + + headers = values.of( + { + "Accept": accept, + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/list_asm_group.py b/sendgrid/rest/api/suppressions/v3/list_asm_group.py new file mode 100644 index 00000000..daa2faf6 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/list_asm_group.py @@ -0,0 +1,59 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class ListAsmGroup: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + id: Optional[int] = None, + ): + path = "/v3/asm/groups" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/list_asm_suppression.py b/sendgrid/rest/api/suppressions/v3/list_asm_suppression.py new file mode 100644 index 00000000..a06fab62 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/list_asm_suppression.py @@ -0,0 +1,58 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class ListAsmSuppression: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/asm/suppressions" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/list_global_suppression.py b/sendgrid/rest/api/suppressions/v3/list_global_suppression.py new file mode 100644 index 00000000..4beb29d9 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/list_global_suppression.py @@ -0,0 +1,63 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class ListGlobalSuppression: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + start_time: Optional[int] = None, + end_time: Optional[int] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + email: Optional[str] = None, + ): + path = "/v3/suppression/unsubscribes" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/list_invalid_email.py b/sendgrid/rest/api/suppressions/v3/list_invalid_email.py new file mode 100644 index 00000000..0afa43b9 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/list_invalid_email.py @@ -0,0 +1,63 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class ListInvalidEmail: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + start_time: Optional[int] = None, + end_time: Optional[int] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + email: Optional[str] = None, + ): + path = "/v3/suppression/invalid_emails" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/list_spam_report.py b/sendgrid/rest/api/suppressions/v3/list_spam_report.py new file mode 100644 index 00000000..4ca3a828 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/list_spam_report.py @@ -0,0 +1,63 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class ListSpamReport: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + start_time: Optional[int] = None, + end_time: Optional[int] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + email: Optional[str] = None, + ): + path = "/v3/suppression/spam_reports" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/list_suppression_block.py b/sendgrid/rest/api/suppressions/v3/list_suppression_block.py new file mode 100644 index 00000000..5ff80179 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/list_suppression_block.py @@ -0,0 +1,63 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class ListSuppressionBlock: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + on_behalf_of: Optional[str] = None, + start_time: Optional[int] = None, + end_time: Optional[int] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + email: Optional[str] = None, + ): + path = "/v3/suppression/blocks" + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/list_suppression_bounces.py b/sendgrid/rest/api/suppressions/v3/list_suppression_bounces.py new file mode 100644 index 00000000..94e471a0 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/list_suppression_bounces.py @@ -0,0 +1,65 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class ListSuppressionBounces: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + accept: Optional[str] = None, + on_behalf_of: Optional[str] = None, + start_time: Optional[int] = None, + end_time: Optional[int] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + email: Optional[str] = None, + ): + path = "/v3/suppression/bounces" + + headers = values.of( + { + "Accept": accept, + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/list_suppression_bounces_classifications.py b/sendgrid/rest/api/suppressions/v3/list_suppression_bounces_classifications.py new file mode 100644 index 00000000..5cbd9f42 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/list_suppression_bounces_classifications.py @@ -0,0 +1,63 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.suppressions.v3.models.accept import Accept + + +class ListSuppressionBouncesClassifications: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + accept: Optional[Accept] = None, + on_behalf_of: Optional[str] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, + ): + path = "/v3/suppression/bounces/classifications" + + headers = values.of( + { + "Accept": accept, + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/list_suppression_from_asm_group.py b/sendgrid/rest/api/suppressions/v3/list_suppression_from_asm_group.py new file mode 100644 index 00000000..b8605edf --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/list_suppression_from_asm_group.py @@ -0,0 +1,62 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class ListSuppressionFromAsmGroup: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + group_id: str, + on_behalf_of: Optional[str] = None, + ): + path = "/v3/asm/groups/{group_id}/suppressions" + path = path.format( + group_id=group_id, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/__init__.py b/sendgrid/rest/api/suppressions/v3/models/__init__.py new file mode 100644 index 00000000..b86040e3 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/__init__.py @@ -0,0 +1,134 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +# import models into model package +from sendgrid.rest.api.suppressions.v3.models.accept import Accept +from sendgrid.rest.api.suppressions.v3.models.accept1 import Accept1 +from sendgrid.rest.api.suppressions.v3.models.add_suppression_to_asm_group201_response import ( + AddSuppressionToAsmGroup201Response, +) +from sendgrid.rest.api.suppressions.v3.models.blocks_response_inner import ( + BlocksResponseInner, +) +from sendgrid.rest.api.suppressions.v3.models.bounce_response import BounceResponse +from sendgrid.rest.api.suppressions.v3.models.classification import Classification +from sendgrid.rest.api.suppressions.v3.models.classification1 import Classification1 +from sendgrid.rest.api.suppressions.v3.models.creat_asm_group201_response import ( + CreatAsmGroup201Response, +) +from sendgrid.rest.api.suppressions.v3.models.create_global_suppression201_response import ( + CreateGlobalSuppression201Response, +) +from sendgrid.rest.api.suppressions.v3.models.delete_invalid_emails_request import ( + DeleteInvalidEmailsRequest, +) +from sendgrid.rest.api.suppressions.v3.models.delete_spam_reports_request import ( + DeleteSpamReportsRequest, +) +from sendgrid.rest.api.suppressions.v3.models.delete_suppression_blocks_request import ( + DeleteSuppressionBlocksRequest, +) +from sendgrid.rest.api.suppressions.v3.models.delete_suppression_bounces_request import ( + DeleteSuppressionBouncesRequest, +) +from sendgrid.rest.api.suppressions.v3.models.error_response import ErrorResponse +from sendgrid.rest.api.suppressions.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) +from sendgrid.rest.api.suppressions.v3.models.get_asm_group200_response import ( + GetAsmGroup200Response, +) +from sendgrid.rest.api.suppressions.v3.models.get_asm_suppression200_response import ( + GetAsmSuppression200Response, +) +from sendgrid.rest.api.suppressions.v3.models.get_asm_suppression200_response_suppressions_inner import ( + GetAsmSuppression200ResponseSuppressionsInner, +) +from sendgrid.rest.api.suppressions.v3.models.get_suppression_bounces_classifications200_response import ( + GetSuppressionBouncesClassifications200Response, +) +from sendgrid.rest.api.suppressions.v3.models.get_suppression_bounces_classifications200_response_result_inner import ( + GetSuppressionBouncesClassifications200ResponseResultInner, +) +from sendgrid.rest.api.suppressions.v3.models.get_suppression_bounces_classifications200_response_result_inner_stats_inner import ( + GetSuppressionBouncesClassifications200ResponseResultInnerStatsInner, +) +from sendgrid.rest.api.suppressions.v3.models.invalid_email import InvalidEmail +from sendgrid.rest.api.suppressions.v3.models.list_asm_suppression200_response_inner import ( + ListAsmSuppression200ResponseInner, +) +from sendgrid.rest.api.suppressions.v3.models.list_global_suppression200_response_inner import ( + ListGlobalSuppression200ResponseInner, +) +from sendgrid.rest.api.suppressions.v3.models.list_suppression_bounces_classifications200_response import ( + ListSuppressionBouncesClassifications200Response, +) +from sendgrid.rest.api.suppressions.v3.models.list_suppression_bounces_classifications200_response_result_inner import ( + ListSuppressionBouncesClassifications200ResponseResultInner, +) +from sendgrid.rest.api.suppressions.v3.models.list_suppression_bounces_classifications200_response_result_inner_stats_inner import ( + ListSuppressionBouncesClassifications200ResponseResultInnerStatsInner, +) +from sendgrid.rest.api.suppressions.v3.models.retrieve_a_global_suppression_response import ( + RetrieveAGlobalSuppressionResponse, +) +from sendgrid.rest.api.suppressions.v3.models.spam_reports_response_inner import ( + SpamReportsResponseInner, +) +from sendgrid.rest.api.suppressions.v3.models.suppression_group import SuppressionGroup +from sendgrid.rest.api.suppressions.v3.models.suppression_group_request_base_props import ( + SuppressionGroupRequestBaseProps, +) +from sendgrid.rest.api.suppressions.v3.models.suppressions_request import ( + SuppressionsRequest, +) +from sendgrid.rest.api.suppressions.v3.models.update_asm_group_request import ( + UpdateAsmGroupRequest, +) + +__all__ = [ + "Accept", + "Accept1", + "AddSuppressionToAsmGroup201Response", + "BlocksResponseInner", + "BounceResponse", + "Classification", + "Classification1", + "CreatAsmGroup201Response", + "CreateGlobalSuppression201Response", + "DeleteInvalidEmailsRequest", + "DeleteSpamReportsRequest", + "DeleteSuppressionBlocksRequest", + "DeleteSuppressionBouncesRequest", + "ErrorResponse", + "ErrorResponseErrorsInner", + "GetAsmGroup200Response", + "GetAsmSuppression200Response", + "GetAsmSuppression200ResponseSuppressionsInner", + "GetSuppressionBouncesClassifications200Response", + "GetSuppressionBouncesClassifications200ResponseResultInner", + "GetSuppressionBouncesClassifications200ResponseResultInnerStatsInner", + "InvalidEmail", + "ListAsmSuppression200ResponseInner", + "ListGlobalSuppression200ResponseInner", + "ListSuppressionBouncesClassifications200Response", + "ListSuppressionBouncesClassifications200ResponseResultInner", + "ListSuppressionBouncesClassifications200ResponseResultInnerStatsInner", + "RetrieveAGlobalSuppressionResponse", + "SpamReportsResponseInner", + "SuppressionGroup", + "SuppressionGroupRequestBaseProps", + "SuppressionsRequest", + "UpdateAsmGroupRequest", +] +# Testing code diff --git a/sendgrid/rest/api/suppressions/v3/models/accept.py b/sendgrid/rest/api/suppressions/v3/models/accept.py new file mode 100644 index 00000000..a6f78784 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/accept.py @@ -0,0 +1,7 @@ +from enum import Enum +from enum import Enum + + +class Accept(Enum): + APPLICATION_SLASH_JSON = "application/json" + TEXT_SLASH_CSV = "text/csv" diff --git a/sendgrid/rest/api/suppressions/v3/models/accept1.py b/sendgrid/rest/api/suppressions/v3/models/accept1.py new file mode 100644 index 00000000..d0e6ff97 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/accept1.py @@ -0,0 +1,7 @@ +from enum import Enum +from enum import Enum + + +class Accept1(Enum): + APPLICATION_SLASH_JSON = "application/json" + TEXT_SLASH_CSV = "text/csv" diff --git a/sendgrid/rest/api/suppressions/v3/models/add_suppression_to_asm_group201_response.py b/sendgrid/rest/api/suppressions/v3/models/add_suppression_to_asm_group201_response.py new file mode 100644 index 00000000..8b007fdb --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/add_suppression_to_asm_group201_response.py @@ -0,0 +1,24 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class AddSuppressionToAsmGroup201Response: + def __init__(self, recipient_emails: Optional[List[str]] = None): + self.recipient_emails = recipient_emails + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"recipient_emails": self.recipient_emails}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return AddSuppressionToAsmGroup201Response( + recipient_emails=payload.get("recipient_emails") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/blocks_response_inner.py b/sendgrid/rest/api/suppressions/v3/models/blocks_response_inner.py new file mode 100644 index 00000000..f1cbb579 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/blocks_response_inner.py @@ -0,0 +1,41 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class BlocksResponseInner: + def __init__( + self, + created: Optional[int] = None, + email: Optional[str] = None, + reason: Optional[str] = None, + status: Optional[str] = None, + ): + self.created = created + self.email = email + self.reason = reason + self.status = status + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "created": self.created, + "email": self.email, + "reason": self.reason, + "status": self.status, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return BlocksResponseInner( + created=payload.get("created"), + email=payload.get("email"), + reason=payload.get("reason"), + status=payload.get("status"), + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/bounce_response.py b/sendgrid/rest/api/suppressions/v3/models/bounce_response.py new file mode 100644 index 00000000..2f70cade --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/bounce_response.py @@ -0,0 +1,41 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class BounceResponse: + def __init__( + self, + created: Optional[float] = None, + email: Optional[str] = None, + reason: Optional[str] = None, + status: Optional[str] = None, + ): + self.created = created + self.email = email + self.reason = reason + self.status = status + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "created": self.created, + "email": self.email, + "reason": self.reason, + "status": self.status, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return BounceResponse( + created=payload.get("created"), + email=payload.get("email"), + reason=payload.get("reason"), + status=payload.get("status"), + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/classification.py b/sendgrid/rest/api/suppressions/v3/models/classification.py new file mode 100644 index 00000000..2577d2cd --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/classification.py @@ -0,0 +1,12 @@ +from enum import Enum +from enum import Enum + + +class Classification(Enum): + CONTENT = "Content" + FREQUENCY_OR_VOLUME_TOO_HIGH = "Frequency or Volume Too High" + INVALID_ADDRESS = "Invalid Address" + MAILBOX_UNAVAILABLE = "Mailbox Unavailable" + REPUTATION = "Reputation" + TECHNICAL_FAILURE = "Technical Failure" + UNCLASSIFIED = "Unclassified" diff --git a/sendgrid/rest/api/suppressions/v3/models/classification1.py b/sendgrid/rest/api/suppressions/v3/models/classification1.py new file mode 100644 index 00000000..0dbc3499 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/classification1.py @@ -0,0 +1,12 @@ +from enum import Enum +from enum import Enum + + +class Classification1(Enum): + CONTENT = "Content" + FREQUENCY_OR_VOLUME_TOO_HIGH = "Frequency or Volume Too High" + INVALID_ADDRESS = "Invalid Address" + MAILBOX_UNAVAILABLE = "Mailbox Unavailable" + REPUTATION = "Reputation" + TECHNICAL_FAILURE = "Technical Failure" + UNCLASSIFIED = "Unclassified" diff --git a/sendgrid/rest/api/suppressions/v3/models/creat_asm_group201_response.py b/sendgrid/rest/api/suppressions/v3/models/creat_asm_group201_response.py new file mode 100644 index 00000000..07e3fcce --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/creat_asm_group201_response.py @@ -0,0 +1,41 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class CreatAsmGroup201Response: + def __init__( + self, + id: Optional[int] = None, + name: Optional[str] = None, + description: Optional[str] = None, + is_default: Optional[bool] = None, + ): + self.id = id + self.name = name + self.description = description + self.is_default = is_default + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "id": self.id, + "name": self.name, + "description": self.description, + "is_default": self.is_default, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return CreatAsmGroup201Response( + id=payload.get("id"), + name=payload.get("name"), + description=payload.get("description"), + is_default=payload.get("is_default"), + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/create_global_suppression201_response.py b/sendgrid/rest/api/suppressions/v3/models/create_global_suppression201_response.py new file mode 100644 index 00000000..0dbe683c --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/create_global_suppression201_response.py @@ -0,0 +1,24 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class CreateGlobalSuppression201Response: + def __init__(self, recipient_emails: Optional[List[str]] = None): + self.recipient_emails = recipient_emails + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"recipient_emails": self.recipient_emails}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return CreateGlobalSuppression201Response( + recipient_emails=payload.get("recipient_emails") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/delete_invalid_emails_request.py b/sendgrid/rest/api/suppressions/v3/models/delete_invalid_emails_request.py new file mode 100644 index 00000000..d1db04b9 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/delete_invalid_emails_request.py @@ -0,0 +1,30 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class DeleteInvalidEmailsRequest: + def __init__( + self, delete_all: Optional[bool] = None, emails: Optional[List[str]] = None + ): + self.delete_all = delete_all + self.emails = emails + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "delete_all": self.delete_all, + "emails": self.emails, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return DeleteInvalidEmailsRequest( + delete_all=payload.get("delete_all"), emails=payload.get("emails") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/delete_spam_reports_request.py b/sendgrid/rest/api/suppressions/v3/models/delete_spam_reports_request.py new file mode 100644 index 00000000..02449a8c --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/delete_spam_reports_request.py @@ -0,0 +1,30 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class DeleteSpamReportsRequest: + def __init__( + self, delete_all: Optional[bool] = None, emails: Optional[List[str]] = None + ): + self.delete_all = delete_all + self.emails = emails + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "delete_all": self.delete_all, + "emails": self.emails, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return DeleteSpamReportsRequest( + delete_all=payload.get("delete_all"), emails=payload.get("emails") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/delete_suppression_blocks_request.py b/sendgrid/rest/api/suppressions/v3/models/delete_suppression_blocks_request.py new file mode 100644 index 00000000..d60ba730 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/delete_suppression_blocks_request.py @@ -0,0 +1,30 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class DeleteSuppressionBlocksRequest: + def __init__( + self, delete_all: Optional[bool] = None, emails: Optional[List[str]] = None + ): + self.delete_all = delete_all + self.emails = emails + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "delete_all": self.delete_all, + "emails": self.emails, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return DeleteSuppressionBlocksRequest( + delete_all=payload.get("delete_all"), emails=payload.get("emails") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/delete_suppression_bounces_request.py b/sendgrid/rest/api/suppressions/v3/models/delete_suppression_bounces_request.py new file mode 100644 index 00000000..0bc37918 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/delete_suppression_bounces_request.py @@ -0,0 +1,30 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class DeleteSuppressionBouncesRequest: + def __init__( + self, delete_all: Optional[bool] = None, emails: Optional[List[str]] = None + ): + self.delete_all = delete_all + self.emails = emails + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "delete_all": self.delete_all, + "emails": self.emails, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return DeleteSuppressionBouncesRequest( + delete_all=payload.get("delete_all"), emails=payload.get("emails") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/error_response.py b/sendgrid/rest/api/suppressions/v3/models/error_response.py new file mode 100644 index 00000000..df4e0aed --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/error_response.py @@ -0,0 +1,30 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.suppressions.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) + + +class ErrorResponse: + def __init__( + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, + ): + self.errors = errors + self.id = id + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/suppressions/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/suppressions/v3/models/error_response_errors_inner.py new file mode 100644 index 00000000..4cbf78ef --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/error_response_errors_inner.py @@ -0,0 +1,37 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class ErrorResponseErrorsInner: + def __init__( + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, + ): + self.message = message + self.field = field + self.help = help + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ErrorResponseErrorsInner( + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/get_asm_group200_response.py b/sendgrid/rest/api/suppressions/v3/models/get_asm_group200_response.py new file mode 100644 index 00000000..07ab3655 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/get_asm_group200_response.py @@ -0,0 +1,49 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class GetAsmGroup200Response: + def __init__( + self, + name: Optional[str] = None, + description: Optional[str] = None, + is_default: Optional[bool] = None, + id: Optional[int] = None, + unsubscribes: Optional[int] = None, + last_email_sent_at: Optional[str] = None, + ): + self.name = name + self.description = description + self.is_default = is_default + self.id = id + self.unsubscribes = unsubscribes + self.last_email_sent_at = last_email_sent_at + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "name": self.name, + "description": self.description, + "is_default": self.is_default, + "id": self.id, + "unsubscribes": self.unsubscribes, + "last_email_sent_at": self.last_email_sent_at, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return GetAsmGroup200Response( + name=payload.get("name"), + description=payload.get("description"), + is_default=payload.get("is_default"), + id=payload.get("id"), + unsubscribes=payload.get("unsubscribes"), + last_email_sent_at=payload.get("last_email_sent_at"), + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/get_asm_suppression200_response.py b/sendgrid/rest/api/suppressions/v3/models/get_asm_suppression200_response.py new file mode 100644 index 00000000..53ed4c87 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/get_asm_suppression200_response.py @@ -0,0 +1,30 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.suppressions.v3.models.get_asm_suppression200_response_suppressions_inner import ( + GetAsmSuppression200ResponseSuppressionsInner, +) + + +class GetAsmSuppression200Response: + def __init__( + self, + suppressions: Optional[ + List[GetAsmSuppression200ResponseSuppressionsInner] + ] = None, + ): + self.suppressions = suppressions + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"suppressions": self.suppressions}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return GetAsmSuppression200Response(suppressions=payload.get("suppressions")) diff --git a/sendgrid/rest/api/suppressions/v3/models/get_asm_suppression200_response_suppressions_inner.py b/sendgrid/rest/api/suppressions/v3/models/get_asm_suppression200_response_suppressions_inner.py new file mode 100644 index 00000000..d7588164 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/get_asm_suppression200_response_suppressions_inner.py @@ -0,0 +1,45 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class GetAsmSuppression200ResponseSuppressionsInner: + def __init__( + self, + description: Optional[str] = None, + id: Optional[int] = None, + is_default: Optional[bool] = None, + name: Optional[str] = None, + suppressed: Optional[bool] = None, + ): + self.description = description + self.id = id + self.is_default = is_default + self.name = name + self.suppressed = suppressed + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "description": self.description, + "id": self.id, + "is_default": self.is_default, + "name": self.name, + "suppressed": self.suppressed, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return GetAsmSuppression200ResponseSuppressionsInner( + description=payload.get("description"), + id=payload.get("id"), + is_default=payload.get("is_default"), + name=payload.get("name"), + suppressed=payload.get("suppressed"), + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/get_suppression_bounces_classifications200_response.py b/sendgrid/rest/api/suppressions/v3/models/get_suppression_bounces_classifications200_response.py new file mode 100644 index 00000000..00f1b5ec --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/get_suppression_bounces_classifications200_response.py @@ -0,0 +1,32 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.suppressions.v3.models.get_suppression_bounces_classifications200_response_result_inner import ( + GetSuppressionBouncesClassifications200ResponseResultInner, +) + + +class GetSuppressionBouncesClassifications200Response: + def __init__( + self, + result: Optional[ + List[GetSuppressionBouncesClassifications200ResponseResultInner] + ] = None, + ): + self.result = result + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return GetSuppressionBouncesClassifications200Response( + result=payload.get("result") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/get_suppression_bounces_classifications200_response_result_inner.py b/sendgrid/rest/api/suppressions/v3/models/get_suppression_bounces_classifications200_response_result_inner.py new file mode 100644 index 00000000..0da82f83 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/get_suppression_bounces_classifications200_response_result_inner.py @@ -0,0 +1,34 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.suppressions.v3.models.get_suppression_bounces_classifications200_response_result_inner_stats_inner import ( + GetSuppressionBouncesClassifications200ResponseResultInnerStatsInner, +) + + +class GetSuppressionBouncesClassifications200ResponseResultInner: + def __init__( + self, + var_date: Optional[str] = None, + stats: Optional[ + List[GetSuppressionBouncesClassifications200ResponseResultInnerStatsInner] + ] = None, + ): + self.var_date = var_date + self.stats = stats + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"date": self.var_date, "stats": self.stats}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return GetSuppressionBouncesClassifications200ResponseResultInner( + var_date=payload.get("date"), stats=payload.get("stats") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/get_suppression_bounces_classifications200_response_result_inner_stats_inner.py b/sendgrid/rest/api/suppressions/v3/models/get_suppression_bounces_classifications200_response_result_inner_stats_inner.py new file mode 100644 index 00000000..2c2ac758 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/get_suppression_bounces_classifications200_response_result_inner_stats_inner.py @@ -0,0 +1,25 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class GetSuppressionBouncesClassifications200ResponseResultInnerStatsInner: + def __init__(self, domain: Optional[str] = None, count: Optional[int] = None): + self.domain = domain + self.count = count + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"domain": self.domain, "count": self.count}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return GetSuppressionBouncesClassifications200ResponseResultInnerStatsInner( + domain=payload.get("domain"), count=payload.get("count") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/invalid_email.py b/sendgrid/rest/api/suppressions/v3/models/invalid_email.py new file mode 100644 index 00000000..52725925 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/invalid_email.py @@ -0,0 +1,37 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class InvalidEmail: + def __init__( + self, + created: Optional[int] = None, + email: Optional[str] = None, + reason: Optional[str] = None, + ): + self.created = created + self.email = email + self.reason = reason + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "created": self.created, + "email": self.email, + "reason": self.reason, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return InvalidEmail( + created=payload.get("created"), + email=payload.get("email"), + reason=payload.get("reason"), + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/list_asm_suppression200_response_inner.py b/sendgrid/rest/api/suppressions/v3/models/list_asm_suppression200_response_inner.py new file mode 100644 index 00000000..b7170511 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/list_asm_suppression200_response_inner.py @@ -0,0 +1,41 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class ListAsmSuppression200ResponseInner: + def __init__( + self, + email: Optional[str] = None, + group_id: Optional[int] = None, + group_name: Optional[str] = None, + created_at: Optional[int] = None, + ): + self.email = email + self.group_id = group_id + self.group_name = group_name + self.created_at = created_at + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "email": self.email, + "group_id": self.group_id, + "group_name": self.group_name, + "created_at": self.created_at, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListAsmSuppression200ResponseInner( + email=payload.get("email"), + group_id=payload.get("group_id"), + group_name=payload.get("group_name"), + created_at=payload.get("created_at"), + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/list_global_suppression200_response_inner.py b/sendgrid/rest/api/suppressions/v3/models/list_global_suppression200_response_inner.py new file mode 100644 index 00000000..ac814144 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/list_global_suppression200_response_inner.py @@ -0,0 +1,25 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class ListGlobalSuppression200ResponseInner: + def __init__(self, created: Optional[int] = None, email: Optional[str] = None): + self.created = created + self.email = email + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"created": self.created, "email": self.email}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListGlobalSuppression200ResponseInner( + created=payload.get("created"), email=payload.get("email") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/list_suppression_bounces_classifications200_response.py b/sendgrid/rest/api/suppressions/v3/models/list_suppression_bounces_classifications200_response.py new file mode 100644 index 00000000..15632a39 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/list_suppression_bounces_classifications200_response.py @@ -0,0 +1,32 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.suppressions.v3.models.list_suppression_bounces_classifications200_response_result_inner import ( + ListSuppressionBouncesClassifications200ResponseResultInner, +) + + +class ListSuppressionBouncesClassifications200Response: + def __init__( + self, + result: Optional[ + List[ListSuppressionBouncesClassifications200ResponseResultInner] + ] = None, + ): + self.result = result + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListSuppressionBouncesClassifications200Response( + result=payload.get("result") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/list_suppression_bounces_classifications200_response_result_inner.py b/sendgrid/rest/api/suppressions/v3/models/list_suppression_bounces_classifications200_response_result_inner.py new file mode 100644 index 00000000..aba82ca9 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/list_suppression_bounces_classifications200_response_result_inner.py @@ -0,0 +1,34 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.suppressions.v3.models.list_suppression_bounces_classifications200_response_result_inner_stats_inner import ( + ListSuppressionBouncesClassifications200ResponseResultInnerStatsInner, +) + + +class ListSuppressionBouncesClassifications200ResponseResultInner: + def __init__( + self, + var_date: Optional[str] = None, + stats: Optional[ + List[ListSuppressionBouncesClassifications200ResponseResultInnerStatsInner] + ] = None, + ): + self.var_date = var_date + self.stats = stats + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"date": self.var_date, "stats": self.stats}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListSuppressionBouncesClassifications200ResponseResultInner( + var_date=payload.get("date"), stats=payload.get("stats") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/list_suppression_bounces_classifications200_response_result_inner_stats_inner.py b/sendgrid/rest/api/suppressions/v3/models/list_suppression_bounces_classifications200_response_result_inner_stats_inner.py new file mode 100644 index 00000000..83ccbec6 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/list_suppression_bounces_classifications200_response_result_inner_stats_inner.py @@ -0,0 +1,33 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.suppressions.v3.models.classification import Classification + + +class ListSuppressionBouncesClassifications200ResponseResultInnerStatsInner: + def __init__( + self, + classification: Optional[Classification] = None, + count: Optional[int] = None, + ): + self.classification = classification + self.count = count + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "classification": self.classification, + "count": self.count, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListSuppressionBouncesClassifications200ResponseResultInnerStatsInner( + classification=payload.get("classification"), count=payload.get("count") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/retrieve_a_global_suppression_response.py b/sendgrid/rest/api/suppressions/v3/models/retrieve_a_global_suppression_response.py new file mode 100644 index 00000000..da71559c --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/retrieve_a_global_suppression_response.py @@ -0,0 +1,24 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class RetrieveAGlobalSuppressionResponse: + def __init__(self, recipient_email: Optional[str] = None): + self.recipient_email = recipient_email + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"recipient_email": self.recipient_email}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return RetrieveAGlobalSuppressionResponse( + recipient_email=payload.get("recipient_email") + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/spam_reports_response_inner.py b/sendgrid/rest/api/suppressions/v3/models/spam_reports_response_inner.py new file mode 100644 index 00000000..bc3ed173 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/spam_reports_response_inner.py @@ -0,0 +1,37 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class SpamReportsResponseInner: + def __init__( + self, + created: Optional[int] = None, + email: Optional[str] = None, + ip: Optional[str] = None, + ): + self.created = created + self.email = email + self.ip = ip + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "created": self.created, + "email": self.email, + "ip": self.ip, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SpamReportsResponseInner( + created=payload.get("created"), + email=payload.get("email"), + ip=payload.get("ip"), + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/suppression_group.py b/sendgrid/rest/api/suppressions/v3/models/suppression_group.py new file mode 100644 index 00000000..4f2b5a9b --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/suppression_group.py @@ -0,0 +1,49 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class SuppressionGroup: + def __init__( + self, + id: Optional[float] = None, + name: Optional[str] = None, + description: Optional[str] = None, + last_email_sent_at: Optional[int] = None, + is_default: Optional[bool] = None, + unsubscribes: Optional[int] = None, + ): + self.id = id + self.name = name + self.description = description + self.last_email_sent_at = last_email_sent_at + self.is_default = is_default + self.unsubscribes = unsubscribes + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "id": self.id, + "name": self.name, + "description": self.description, + "last_email_sent_at": self.last_email_sent_at, + "is_default": self.is_default, + "unsubscribes": self.unsubscribes, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SuppressionGroup( + id=payload.get("id"), + name=payload.get("name"), + description=payload.get("description"), + last_email_sent_at=payload.get("last_email_sent_at"), + is_default=payload.get("is_default"), + unsubscribes=payload.get("unsubscribes"), + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/suppression_group_request_base_props.py b/sendgrid/rest/api/suppressions/v3/models/suppression_group_request_base_props.py new file mode 100644 index 00000000..3c1f69f8 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/suppression_group_request_base_props.py @@ -0,0 +1,37 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class SuppressionGroupRequestBaseProps: + def __init__( + self, + name: Optional[str] = None, + description: Optional[str] = None, + is_default: Optional[bool] = None, + ): + self.name = name + self.description = description + self.is_default = is_default + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "name": self.name, + "description": self.description, + "is_default": self.is_default, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SuppressionGroupRequestBaseProps( + name=payload.get("name"), + description=payload.get("description"), + is_default=payload.get("is_default"), + ) diff --git a/sendgrid/rest/api/suppressions/v3/models/suppressions_request.py b/sendgrid/rest/api/suppressions/v3/models/suppressions_request.py new file mode 100644 index 00000000..a00814d0 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/suppressions_request.py @@ -0,0 +1,22 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class SuppressionsRequest: + def __init__(self, recipient_emails: Optional[List[str]] = None): + self.recipient_emails = recipient_emails + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"recipient_emails": self.recipient_emails}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return SuppressionsRequest(recipient_emails=payload.get("recipient_emails")) diff --git a/sendgrid/rest/api/suppressions/v3/models/update_asm_group_request.py b/sendgrid/rest/api/suppressions/v3/models/update_asm_group_request.py new file mode 100644 index 00000000..bf00152b --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/models/update_asm_group_request.py @@ -0,0 +1,37 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class UpdateAsmGroupRequest: + def __init__( + self, + name: Optional[str] = None, + description: Optional[str] = None, + is_default: Optional[bool] = None, + ): + self.name = name + self.description = description + self.is_default = is_default + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "name": self.name, + "description": self.description, + "is_default": self.is_default, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return UpdateAsmGroupRequest( + name=payload.get("name"), + description=payload.get("description"), + is_default=payload.get("is_default"), + ) diff --git a/sendgrid/rest/api/suppressions/v3/search_suppression_from_asm_group.py b/sendgrid/rest/api/suppressions/v3/search_suppression_from_asm_group.py new file mode 100644 index 00000000..434e3d6f --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/search_suppression_from_asm_group.py @@ -0,0 +1,69 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.suppressions.v3.models.suppressions_request import ( + SuppressionsRequest, +) + + +class SearchSuppressionFromAsmGroup: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + group_id: str, + on_behalf_of: Optional[str] = None, + suppressions_request: Optional[SuppressionsRequest] = None, + ): + path = "/v3/asm/groups/{group_id}/suppressions/search" + path = path.format( + group_id=group_id, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + headers["Content-Type"] = "application/json" + data = None + if suppressions_request: + data = suppressions_request.to_dict() + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/suppressions/v3/update_asm_group.py b/sendgrid/rest/api/suppressions/v3/update_asm_group.py new file mode 100644 index 00000000..3eb21b90 --- /dev/null +++ b/sendgrid/rest/api/suppressions/v3/update_asm_group.py @@ -0,0 +1,69 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Suppressions API + The Twilio SendGrid Suppressions API allows you to manage your Suppressions or Unsubscribes and Suppression or Unsubscribe groups. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. You can have global suppressions, which represent addresses that have been unsubscribed from all of your emails. You can also have suppression groups, also known as ASM groups, which represent categories or groups of emails that your recipients can unsubscribe from, rather than unsubscribing from all of your messages. SendGrid automatically suppresses emails sent to users for a variety of reasons, including blocks, bounces, invalid email addresses, spam reports, and unsubscribes. SendGrid suppresses these messages to help you maintain the best possible sender reputation by attempting to prevent unwanted mail. You may also add addresses to your suppressions. See [**Suppressions**](https://docs.sendgrid.com/for-developers/sending-email/suppressions) for more information. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.base import values +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.suppressions.v3.models.update_asm_group_request import ( + UpdateAsmGroupRequest, +) + + +class UpdateAsmGroup: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + group_id: str, + on_behalf_of: Optional[str] = None, + update_asm_group_request: Optional[UpdateAsmGroupRequest] = None, + ): + path = "/v3/asm/groups/{group_id}" + path = path.format( + group_id=group_id, + ) + + headers = values.of( + { + "on-behalf-of": on_behalf_of, + } + ) + headers["Content-Type"] = "application/json" + data = None + if update_asm_group_request: + data = update_asm_group_request.to_dict() + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/teammates/v3/__init__.py b/sendgrid/rest/api/teammates/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/teammates/v3/__init__.py +++ b/sendgrid/rest/api/teammates/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/teammates/v3/delete_pending_teammate.py b/sendgrid/rest/api/teammates/v3/delete_pending_teammate.py index 926443ad..cec40e54 100644 --- a/sendgrid/rest/api/teammates/v3/delete_pending_teammate.py +++ b/sendgrid/rest/api/teammates/v3/delete_pending_teammate.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeletePendingTeammate: def __init__(self, client) -> None: self.client = client - + def send( self, - token: str, - on_behalf_of: Optional[str] = None, - + token: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/teammates/pending/{token}' + path = "/v3/teammates/pending/{token}" path = path.format( - token=token, + token=token, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/teammates/v3/delete_teammate.py b/sendgrid/rest/api/teammates/v3/delete_teammate.py index 1db657b3..de80d160 100644 --- a/sendgrid/rest/api/teammates/v3/delete_teammate.py +++ b/sendgrid/rest/api/teammates/v3/delete_teammate.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteTeammate: def __init__(self, client) -> None: self.client = client - + def send( self, - username: str, - on_behalf_of: Optional[str] = None, - + username: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/teammates/{username}' + path = "/v3/teammates/{username}" path = path.format( - username=username, + username=username, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/teammates/v3/get_teammate.py b/sendgrid/rest/api/teammates/v3/get_teammate.py index 1e2efa9b..86a409be 100644 --- a/sendgrid/rest/api/teammates/v3/get_teammate.py +++ b/sendgrid/rest/api/teammates/v3/get_teammate.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.teammates.v3.models.get_teammate200_response import GetTeammate200Response + class GetTeammate: def __init__(self, client) -> None: self.client = client - + def send( self, - username: str, - on_behalf_of: Optional[str] = None, - + username: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/teammates/{username}' + path = "/v3/teammates/{username}" path = path.format( - username=username, + username=username, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/teammates/v3/invite_teammate.py b/sendgrid/rest/api/teammates/v3/invite_teammate.py index bdb2291d..a30f61ee 100644 --- a/sendgrid/rest/api/teammates/v3/invite_teammate.py +++ b/sendgrid/rest/api/teammates/v3/invite_teammate.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.teammates.v3.models.invite_teammate201_response import InviteTeammate201Response -from sendgrid.rest.api.teammates.v3.models.invite_teammate_request import InviteTeammateRequest +from sendgrid.rest.api.teammates.v3.models.invite_teammate_request import ( + InviteTeammateRequest, +) + class InviteTeammate: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - invite_teammate_request: Optional[InviteTeammateRequest] = None, - + on_behalf_of: Optional[str] = None, + invite_teammate_request: Optional[InviteTeammateRequest] = None, ): - path='/v3/teammates' + path = "/v3/teammates" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if invite_teammate_request: data = invite_teammate_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/teammates/v3/list_pending_teammate.py b/sendgrid/rest/api/teammates/v3/list_pending_teammate.py index bf2a70a0..e2f6be71 100644 --- a/sendgrid/rest/api/teammates/v3/list_pending_teammate.py +++ b/sendgrid/rest/api/teammates/v3/list_pending_teammate.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.teammates.v3.models.list_pending_teammate200_response import ListPendingTeammate200Response + class ListPendingTeammate: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/teammates/pending' + path = "/v3/teammates/pending" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/teammates/v3/list_subuser_by_template.py b/sendgrid/rest/api/teammates/v3/list_subuser_by_template.py index c95037b4..1ad7bb5b 100644 --- a/sendgrid/rest/api/teammates/v3/list_subuser_by_template.py +++ b/sendgrid/rest/api/teammates/v3/list_subuser_by_template.py @@ -12,52 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from sendgrid.base import values +from typing import Optional from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictInt, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response import ListSubuserByTemplate200Response + class ListSubuserByTemplate: def __init__(self, client) -> None: self.client = client - + def send( self, - teammate_name: str, - after_subuser_id: Optional[int] = None, - limit: Optional[int] = None, - username: Optional[str] = None, - + teammate_name: str, + after_subuser_id: Optional[int] = None, + limit: Optional[int] = None, + username: Optional[str] = None, ): - path='/v3/teammates/{teammate_name}/subuser_access' + path = "/v3/teammates/{teammate_name}/subuser_access" path = path.format( - teammate_name=teammate_name, + teammate_name=teammate_name, ) data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/teammates/v3/list_teammate.py b/sendgrid/rest/api/teammates/v3/list_teammate.py index 5be790b1..5c15719c 100644 --- a/sendgrid/rest/api/teammates/v3/list_teammate.py +++ b/sendgrid/rest/api/teammates/v3/list_teammate.py @@ -12,52 +12,49 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.teammates.v3.models.list_teammate200_response import ListTeammate200Response + class ListTeammate: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - limit: Optional[int] = None, - offset: Optional[int] = None, - + on_behalf_of: Optional[str] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, ): - path='/v3/teammates' + path = "/v3/teammates" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/teammates/v3/models/__init__.py b/sendgrid/rest/api/teammates/v3/models/__init__.py index 80376b90..1050f5a2 100644 --- a/sendgrid/rest/api/teammates/v3/models/__init__.py +++ b/sendgrid/rest/api/teammates/v3/models/__init__.py @@ -11,29 +11,88 @@ Do not edit the class manually. """ - # import models into model package -from sendgrid.rest.api.teammates.v3.models.get_teammate200_response import GetTeammate200Response -from sendgrid.rest.api.teammates.v3.models.invite_teammate201_response import InviteTeammate201Response -from sendgrid.rest.api.teammates.v3.models.invite_teammate400_response import InviteTeammate400Response -from sendgrid.rest.api.teammates.v3.models.invite_teammate400_response_errors_inner import InviteTeammate400ResponseErrorsInner -from sendgrid.rest.api.teammates.v3.models.invite_teammate_request import InviteTeammateRequest -from sendgrid.rest.api.teammates.v3.models.list_pending_teammate200_response import ListPendingTeammate200Response -from sendgrid.rest.api.teammates.v3.models.list_pending_teammate200_response_result_inner import ListPendingTeammate200ResponseResultInner -from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response import ListSubuserByTemplate200Response -from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response_metadata import ListSubuserByTemplate200ResponseMetadata -from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response_metadata_next_params import ListSubuserByTemplate200ResponseMetadataNextParams -from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response_subuser_access_inner import ListSubuserByTemplate200ResponseSubuserAccessInner -from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template400_response import ListSubuserByTemplate400Response -from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template400_response_errors_inner import ListSubuserByTemplate400ResponseErrorsInner -from sendgrid.rest.api.teammates.v3.models.list_teammate200_response import ListTeammate200Response -from sendgrid.rest.api.teammates.v3.models.list_teammate200_response_result_inner import ListTeammate200ResponseResultInner +from sendgrid.rest.api.teammates.v3.models.get_teammate200_response import ( + GetTeammate200Response, +) +from sendgrid.rest.api.teammates.v3.models.invite_teammate201_response import ( + InviteTeammate201Response, +) +from sendgrid.rest.api.teammates.v3.models.invite_teammate400_response import ( + InviteTeammate400Response, +) +from sendgrid.rest.api.teammates.v3.models.invite_teammate400_response_errors_inner import ( + InviteTeammate400ResponseErrorsInner, +) +from sendgrid.rest.api.teammates.v3.models.invite_teammate_request import ( + InviteTeammateRequest, +) +from sendgrid.rest.api.teammates.v3.models.list_pending_teammate200_response import ( + ListPendingTeammate200Response, +) +from sendgrid.rest.api.teammates.v3.models.list_pending_teammate200_response_result_inner import ( + ListPendingTeammate200ResponseResultInner, +) +from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response import ( + ListSubuserByTemplate200Response, +) +from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response_metadata import ( + ListSubuserByTemplate200ResponseMetadata, +) +from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response_metadata_next_params import ( + ListSubuserByTemplate200ResponseMetadataNextParams, +) +from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response_subuser_access_inner import ( + ListSubuserByTemplate200ResponseSubuserAccessInner, +) +from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template400_response import ( + ListSubuserByTemplate400Response, +) +from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template400_response_errors_inner import ( + ListSubuserByTemplate400ResponseErrorsInner, +) +from sendgrid.rest.api.teammates.v3.models.list_teammate200_response import ( + ListTeammate200Response, +) +from sendgrid.rest.api.teammates.v3.models.list_teammate200_response_result_inner import ( + ListTeammate200ResponseResultInner, +) from sendgrid.rest.api.teammates.v3.models.permission_type import PermissionType -from sendgrid.rest.api.teammates.v3.models.resend_teammate_invite200_response import ResendTeammateInvite200Response -from sendgrid.rest.api.teammates.v3.models.update_teammate200_response import UpdateTeammate200Response -from sendgrid.rest.api.teammates.v3.models.update_teammate_request import UpdateTeammateRequest +from sendgrid.rest.api.teammates.v3.models.resend_teammate_invite200_response import ( + ResendTeammateInvite200Response, +) +from sendgrid.rest.api.teammates.v3.models.update_teammate200_response import ( + UpdateTeammate200Response, +) +from sendgrid.rest.api.teammates.v3.models.update_teammate_request import ( + UpdateTeammateRequest, +) from sendgrid.rest.api.teammates.v3.models.user_type import UserType from sendgrid.rest.api.teammates.v3.models.user_type1 import UserType1 from sendgrid.rest.api.teammates.v3.models.user_type2 import UserType2 -__all__ = [ 'GetTeammate200Response', 'InviteTeammate201Response', 'InviteTeammate400Response', 'InviteTeammate400ResponseErrorsInner', 'InviteTeammateRequest', 'ListPendingTeammate200Response', 'ListPendingTeammate200ResponseResultInner', 'ListSubuserByTemplate200Response', 'ListSubuserByTemplate200ResponseMetadata', 'ListSubuserByTemplate200ResponseMetadataNextParams', 'ListSubuserByTemplate200ResponseSubuserAccessInner', 'ListSubuserByTemplate400Response', 'ListSubuserByTemplate400ResponseErrorsInner', 'ListTeammate200Response', 'ListTeammate200ResponseResultInner', 'PermissionType', 'ResendTeammateInvite200Response', 'UpdateTeammate200Response', 'UpdateTeammateRequest', 'UserType', 'UserType1', 'UserType2' ] -# Testing code \ No newline at end of file + +__all__ = [ + "GetTeammate200Response", + "InviteTeammate201Response", + "InviteTeammate400Response", + "InviteTeammate400ResponseErrorsInner", + "InviteTeammateRequest", + "ListPendingTeammate200Response", + "ListPendingTeammate200ResponseResultInner", + "ListSubuserByTemplate200Response", + "ListSubuserByTemplate200ResponseMetadata", + "ListSubuserByTemplate200ResponseMetadataNextParams", + "ListSubuserByTemplate200ResponseSubuserAccessInner", + "ListSubuserByTemplate400Response", + "ListSubuserByTemplate400ResponseErrorsInner", + "ListTeammate200Response", + "ListTeammate200ResponseResultInner", + "PermissionType", + "ResendTeammateInvite200Response", + "UpdateTeammate200Response", + "UpdateTeammateRequest", + "UserType", + "UserType1", + "UserType2", +] +# Testing code diff --git a/sendgrid/rest/api/teammates/v3/models/get_teammate200_response.py b/sendgrid/rest/api/teammates/v3/models/get_teammate200_response.py index c28df1b1..4f2eb1e1 100644 --- a/sendgrid/rest/api/teammates/v3/models/get_teammate200_response.py +++ b/sendgrid/rest/api/teammates/v3/models/get_teammate200_response.py @@ -1,65 +1,65 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.teammates.v3.models.user_type1 import UserType1 - class GetTeammate200Response: def __init__( - self, - username: Optional[str]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - email: Optional[str]=None, - scopes: Optional[List[object]]=None, - user_type: Optional[UserType1]=None, - is_admin: Optional[bool]=None, - phone: Optional[str]=None, - website: Optional[str]=None, - address: Optional[str]=None, - address2: Optional[str]=None, - city: Optional[str]=None, - state: Optional[str]=None, - zip: Optional[str]=None, - country: Optional[str]=None + self, + username: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + email: Optional[str] = None, + scopes: Optional[List[object]] = None, + user_type: Optional[UserType1] = None, + is_admin: Optional[bool] = None, + phone: Optional[str] = None, + website: Optional[str] = None, + address: Optional[str] = None, + address2: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + zip: Optional[str] = None, + country: Optional[str] = None, ): - self.username=username - self.first_name=first_name - self.last_name=last_name - self.email=email - self.scopes=scopes - self.user_type=user_type - self.is_admin=is_admin - self.phone=phone - self.website=website - self.address=address - self.address2=address2 - self.city=city - self.state=state - self.zip=zip - self.country=country + self.username = username + self.first_name = first_name + self.last_name = last_name + self.email = email + self.scopes = scopes + self.user_type = user_type + self.is_admin = is_admin + self.phone = phone + self.website = website + self.address = address + self.address2 = address2 + self.city = city + self.state = state + self.zip = zip + self.country = country def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "username": self.username, - "first_name": self.first_name, - "last_name": self.last_name, - "email": self.email, - "scopes": self.scopes, - "user_type": self.user_type, - "is_admin": self.is_admin, - "phone": self.phone, - "website": self.website, - "address": self.address, - "address2": self.address2, - "city": self.city, - "state": self.state, - "zip": self.zip, - "country": self.country - }.items() if value is not None} + "username": self.username, + "first_name": self.first_name, + "last_name": self.last_name, + "email": self.email, + "scopes": self.scopes, + "user_type": self.user_type, + "is_admin": self.is_admin, + "phone": self.phone, + "website": self.website, + "address": self.address, + "address2": self.address2, + "city": self.city, + "state": self.state, + "zip": self.zip, + "country": self.country, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -68,20 +68,19 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetTeammate200Response( - username=payload.get('username'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - email=payload.get('email'), - scopes=payload.get('scopes'), - user_type=payload.get('user_type'), - is_admin=payload.get('is_admin'), - phone=payload.get('phone'), - website=payload.get('website'), - address=payload.get('address'), - address2=payload.get('address2'), - city=payload.get('city'), - state=payload.get('state'), - zip=payload.get('zip'), - country=payload.get('country') - ) - + username=payload.get("username"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + email=payload.get("email"), + scopes=payload.get("scopes"), + user_type=payload.get("user_type"), + is_admin=payload.get("is_admin"), + phone=payload.get("phone"), + website=payload.get("website"), + address=payload.get("address"), + address2=payload.get("address2"), + city=payload.get("city"), + state=payload.get("state"), + zip=payload.get("zip"), + country=payload.get("country"), + ) diff --git a/sendgrid/rest/api/teammates/v3/models/invite_teammate201_response.py b/sendgrid/rest/api/teammates/v3/models/invite_teammate201_response.py index 776774c9..bad25559 100644 --- a/sendgrid/rest/api/teammates/v3/models/invite_teammate201_response.py +++ b/sendgrid/rest/api/teammates/v3/models/invite_teammate201_response.py @@ -1,31 +1,31 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class InviteTeammate201Response: def __init__( - self, - token: Optional[str]=None, - email: Optional[str]=None, - scopes: Optional[List[object]]=None, - is_admin: Optional[bool]=None + self, + token: Optional[str] = None, + email: Optional[str] = None, + scopes: Optional[List[object]] = None, + is_admin: Optional[bool] = None, ): - self.token=token - self.email=email - self.scopes=scopes - self.is_admin=is_admin + self.token = token + self.email = email + self.scopes = scopes + self.is_admin = is_admin def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "token": self.token, - "email": self.email, - "scopes": self.scopes, - "is_admin": self.is_admin - }.items() if value is not None} + "token": self.token, + "email": self.email, + "scopes": self.scopes, + "is_admin": self.is_admin, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return InviteTeammate201Response( - token=payload.get('token'), - email=payload.get('email'), - scopes=payload.get('scopes'), - is_admin=payload.get('is_admin') - ) - + token=payload.get("token"), + email=payload.get("email"), + scopes=payload.get("scopes"), + is_admin=payload.get("is_admin"), + ) diff --git a/sendgrid/rest/api/teammates/v3/models/invite_teammate400_response.py b/sendgrid/rest/api/teammates/v3/models/invite_teammate400_response.py index ea987f0b..8fffb6a8 100644 --- a/sendgrid/rest/api/teammates/v3/models/invite_teammate400_response.py +++ b/sendgrid/rest/api/teammates/v3/models/invite_teammate400_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.teammates.v3.models.invite_teammate400_response_errors_inner import InviteTeammate400ResponseErrorsInner - +from sendgrid.rest.api.teammates.v3.models.invite_teammate400_response_errors_inner import ( + InviteTeammate400ResponseErrorsInner, +) class InviteTeammate400Response: def __init__( - self, - errors: Optional[List[InviteTeammate400ResponseErrorsInner]]=None + self, errors: Optional[List[InviteTeammate400ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return InviteTeammate400Response( - errors=payload.get('errors') - ) - + return InviteTeammate400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/teammates/v3/models/invite_teammate400_response_errors_inner.py b/sendgrid/rest/api/teammates/v3/models/invite_teammate400_response_errors_inner.py index cfdfaced..5161b1c1 100644 --- a/sendgrid/rest/api/teammates/v3/models/invite_teammate400_response_errors_inner.py +++ b/sendgrid/rest/api/teammates/v3/models/invite_teammate400_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class InviteTeammate400ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None - ): - self.message=message - self.field=field + def __init__(self, message: Optional[str] = None, field: Optional[str] = None): + self.message = message + self.field = field def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message, - "field": self.field - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message, "field": self.field}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return InviteTeammate400ResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field') - ) - + message=payload.get("message"), field=payload.get("field") + ) diff --git a/sendgrid/rest/api/teammates/v3/models/invite_teammate_request.py b/sendgrid/rest/api/teammates/v3/models/invite_teammate_request.py index 4073d779..d3ad502e 100644 --- a/sendgrid/rest/api/teammates/v3/models/invite_teammate_request.py +++ b/sendgrid/rest/api/teammates/v3/models/invite_teammate_request.py @@ -1,28 +1,28 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class InviteTeammateRequest: def __init__( - self, - email: Optional[str]=None, - scopes: Optional[List[str]]=None, - is_admin: Optional[bool]=None + self, + email: Optional[str] = None, + scopes: Optional[List[str]] = None, + is_admin: Optional[bool] = None, ): - self.email=email - self.scopes=scopes - self.is_admin=is_admin + self.email = email + self.scopes = scopes + self.is_admin = is_admin def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "email": self.email, - "scopes": self.scopes, - "is_admin": self.is_admin - }.items() if value is not None} + "email": self.email, + "scopes": self.scopes, + "is_admin": self.is_admin, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return InviteTeammateRequest( - email=payload.get('email'), - scopes=payload.get('scopes'), - is_admin=payload.get('is_admin') - ) - + email=payload.get("email"), + scopes=payload.get("scopes"), + is_admin=payload.get("is_admin"), + ) diff --git a/sendgrid/rest/api/teammates/v3/models/list_pending_teammate200_response.py b/sendgrid/rest/api/teammates/v3/models/list_pending_teammate200_response.py index e1daadb4..93aa4bed 100644 --- a/sendgrid/rest/api/teammates/v3/models/list_pending_teammate200_response.py +++ b/sendgrid/rest/api/teammates/v3/models/list_pending_teammate200_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.teammates.v3.models.list_pending_teammate200_response_result_inner import ListPendingTeammate200ResponseResultInner - +from sendgrid.rest.api.teammates.v3.models.list_pending_teammate200_response_result_inner import ( + ListPendingTeammate200ResponseResultInner, +) class ListPendingTeammate200Response: def __init__( - self, - result: Optional[List[ListPendingTeammate200ResponseResultInner]]=None + self, result: Optional[List[ListPendingTeammate200ResponseResultInner]] = None ): - self.result=result + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListPendingTeammate200Response( - result=payload.get('result') - ) - + return ListPendingTeammate200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/teammates/v3/models/list_pending_teammate200_response_result_inner.py b/sendgrid/rest/api/teammates/v3/models/list_pending_teammate200_response_result_inner.py index 5377ba55..81fb1004 100644 --- a/sendgrid/rest/api/teammates/v3/models/list_pending_teammate200_response_result_inner.py +++ b/sendgrid/rest/api/teammates/v3/models/list_pending_teammate200_response_result_inner.py @@ -1,34 +1,34 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListPendingTeammate200ResponseResultInner: def __init__( - self, - email: Optional[str]=None, - scopes: Optional[List[str]]=None, - is_admin: Optional[bool]=None, - token: Optional[str]=None, - expiration_date: Optional[int]=None + self, + email: Optional[str] = None, + scopes: Optional[List[str]] = None, + is_admin: Optional[bool] = None, + token: Optional[str] = None, + expiration_date: Optional[int] = None, ): - self.email=email - self.scopes=scopes - self.is_admin=is_admin - self.token=token - self.expiration_date=expiration_date + self.email = email + self.scopes = scopes + self.is_admin = is_admin + self.token = token + self.expiration_date = expiration_date def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "email": self.email, - "scopes": self.scopes, - "is_admin": self.is_admin, - "token": self.token, - "expiration_date": self.expiration_date - }.items() if value is not None} + "email": self.email, + "scopes": self.scopes, + "is_admin": self.is_admin, + "token": self.token, + "expiration_date": self.expiration_date, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -37,10 +37,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListPendingTeammate200ResponseResultInner( - email=payload.get('email'), - scopes=payload.get('scopes'), - is_admin=payload.get('is_admin'), - token=payload.get('token'), - expiration_date=payload.get('expiration_date') - ) - + email=payload.get("email"), + scopes=payload.get("scopes"), + is_admin=payload.get("is_admin"), + token=payload.get("token"), + expiration_date=payload.get("expiration_date"), + ) diff --git a/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response.py b/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response.py index dfa096fe..719129ce 100644 --- a/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response.py +++ b/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response.py @@ -1,30 +1,36 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response_metadata import ListSubuserByTemplate200ResponseMetadata -from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response_subuser_access_inner import ListSubuserByTemplate200ResponseSubuserAccessInner - +from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response_metadata import ( + ListSubuserByTemplate200ResponseMetadata, +) +from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response_subuser_access_inner import ( + ListSubuserByTemplate200ResponseSubuserAccessInner, +) class ListSubuserByTemplate200Response: def __init__( - self, - has_restricted_subuser_access: Optional[bool]=None, - subuser_access: Optional[List[ListSubuserByTemplate200ResponseSubuserAccessInner]]=None, - metadata: Optional[ListSubuserByTemplate200ResponseMetadata]=None + self, + has_restricted_subuser_access: Optional[bool] = None, + subuser_access: Optional[ + List[ListSubuserByTemplate200ResponseSubuserAccessInner] + ] = None, + metadata: Optional[ListSubuserByTemplate200ResponseMetadata] = None, ): - self.has_restricted_subuser_access=has_restricted_subuser_access - self.subuser_access=subuser_access - self.metadata=metadata + self.has_restricted_subuser_access = has_restricted_subuser_access + self.subuser_access = subuser_access + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "has_restricted_subuser_access": self.has_restricted_subuser_access, - "subuser_access": self.subuser_access, - "_metadata": self.metadata - }.items() if value is not None} + "has_restricted_subuser_access": self.has_restricted_subuser_access, + "subuser_access": self.subuser_access, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -33,8 +39,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListSubuserByTemplate200Response( - has_restricted_subuser_access=payload.get('has_restricted_subuser_access'), - subuser_access=payload.get('subuser_access'), - metadata=payload.get('_metadata') - ) - + has_restricted_subuser_access=payload.get("has_restricted_subuser_access"), + subuser_access=payload.get("subuser_access"), + metadata=payload.get("_metadata"), + ) diff --git a/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response_metadata.py b/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response_metadata.py index 717b6c61..cdce7291 100644 --- a/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response_metadata.py +++ b/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response_metadata.py @@ -1,23 +1,25 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response_metadata_next_params import ListSubuserByTemplate200ResponseMetadataNextParams - +from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template200_response_metadata_next_params import ( + ListSubuserByTemplate200ResponseMetadataNextParams, +) class ListSubuserByTemplate200ResponseMetadata: def __init__( - self, - next_params: Optional[ListSubuserByTemplate200ResponseMetadataNextParams]=None + self, + next_params: Optional[ + ListSubuserByTemplate200ResponseMetadataNextParams + ] = None, ): - self.next_params=next_params + self.next_params = next_params def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "next_params": self.next_params - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"next_params": self.next_params}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -26,6 +28,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListSubuserByTemplate200ResponseMetadata( - next_params=payload.get('next_params') - ) - + next_params=payload.get("next_params") + ) diff --git a/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response_metadata_next_params.py b/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response_metadata_next_params.py index 4374e308..3f5837cd 100644 --- a/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response_metadata_next_params.py +++ b/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response_metadata_next_params.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListSubuserByTemplate200ResponseMetadataNextParams: def __init__( - self, - limit: Optional[int]=None, - after_subuser_id: Optional[int]=None, - username: Optional[str]=None + self, + limit: Optional[int] = None, + after_subuser_id: Optional[int] = None, + username: Optional[str] = None, ): - self.limit=limit - self.after_subuser_id=after_subuser_id - self.username=username + self.limit = limit + self.after_subuser_id = after_subuser_id + self.username = username def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "limit": self.limit, - "after_subuser_id": self.after_subuser_id, - "username": self.username - }.items() if value is not None} + "limit": self.limit, + "after_subuser_id": self.after_subuser_id, + "username": self.username, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListSubuserByTemplate200ResponseMetadataNextParams( - limit=payload.get('limit'), - after_subuser_id=payload.get('after_subuser_id'), - username=payload.get('username') - ) - + limit=payload.get("limit"), + after_subuser_id=payload.get("after_subuser_id"), + username=payload.get("username"), + ) diff --git a/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response_subuser_access_inner.py b/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response_subuser_access_inner.py index 7981c03d..30643286 100644 --- a/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response_subuser_access_inner.py +++ b/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template200_response_subuser_access_inner.py @@ -1,38 +1,38 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.teammates.v3.models.permission_type import PermissionType - class ListSubuserByTemplate200ResponseSubuserAccessInner: def __init__( - self, - id: Optional[int]=None, - username: Optional[str]=None, - email: Optional[str]=None, - disabled: Optional[bool]=None, - permission_type: Optional[PermissionType]=None, - scopes: Optional[List[str]]=None + self, + id: Optional[int] = None, + username: Optional[str] = None, + email: Optional[str] = None, + disabled: Optional[bool] = None, + permission_type: Optional[PermissionType] = None, + scopes: Optional[List[str]] = None, ): - self.id=id - self.username=username - self.email=email - self.disabled=disabled - self.permission_type=permission_type - self.scopes=scopes + self.id = id + self.username = username + self.email = email + self.disabled = disabled + self.permission_type = permission_type + self.scopes = scopes def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "username": self.username, - "email": self.email, - "disabled": self.disabled, - "permission_type": self.permission_type, - "scopes": self.scopes - }.items() if value is not None} + "id": self.id, + "username": self.username, + "email": self.email, + "disabled": self.disabled, + "permission_type": self.permission_type, + "scopes": self.scopes, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -41,11 +41,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListSubuserByTemplate200ResponseSubuserAccessInner( - id=payload.get('id'), - username=payload.get('username'), - email=payload.get('email'), - disabled=payload.get('disabled'), - permission_type=payload.get('permission_type'), - scopes=payload.get('scopes') - ) - + id=payload.get("id"), + username=payload.get("username"), + email=payload.get("email"), + disabled=payload.get("disabled"), + permission_type=payload.get("permission_type"), + scopes=payload.get("scopes"), + ) diff --git a/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template400_response.py b/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template400_response.py index 00d9b679..8d58e93d 100644 --- a/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template400_response.py +++ b/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template400_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template400_response_errors_inner import ListSubuserByTemplate400ResponseErrorsInner - +from sendgrid.rest.api.teammates.v3.models.list_subuser_by_template400_response_errors_inner import ( + ListSubuserByTemplate400ResponseErrorsInner, +) class ListSubuserByTemplate400Response: def __init__( - self, - errors: Optional[List[ListSubuserByTemplate400ResponseErrorsInner]]=None + self, errors: Optional[List[ListSubuserByTemplate400ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListSubuserByTemplate400Response( - errors=payload.get('errors') - ) - + return ListSubuserByTemplate400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template400_response_errors_inner.py b/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template400_response_errors_inner.py index fa87965f..7ebf5a15 100644 --- a/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template400_response_errors_inner.py +++ b/sendgrid/rest/api/teammates/v3/models/list_subuser_by_template400_response_errors_inner.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListSubuserByTemplate400ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None - ): - self.message=message - self.field=field + def __init__(self, message: Optional[str] = None, field: Optional[str] = None): + self.message = message + self.field = field def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message, - "field": self.field - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message, "field": self.field}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListSubuserByTemplate400ResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field') - ) - + message=payload.get("message"), field=payload.get("field") + ) diff --git a/sendgrid/rest/api/teammates/v3/models/list_teammate200_response.py b/sendgrid/rest/api/teammates/v3/models/list_teammate200_response.py index 1d144db5..7d5389a9 100644 --- a/sendgrid/rest/api/teammates/v3/models/list_teammate200_response.py +++ b/sendgrid/rest/api/teammates/v3/models/list_teammate200_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.teammates.v3.models.list_teammate200_response_result_inner import ListTeammate200ResponseResultInner - +from sendgrid.rest.api.teammates.v3.models.list_teammate200_response_result_inner import ( + ListTeammate200ResponseResultInner, +) class ListTeammate200Response: def __init__( - self, - result: Optional[List[ListTeammate200ResponseResultInner]]=None + self, result: Optional[List[ListTeammate200ResponseResultInner]] = None ): - self.result=result + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListTeammate200Response( - result=payload.get('result') - ) - + return ListTeammate200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/teammates/v3/models/list_teammate200_response_result_inner.py b/sendgrid/rest/api/teammates/v3/models/list_teammate200_response_result_inner.py index 881f9384..ca9a5c2d 100644 --- a/sendgrid/rest/api/teammates/v3/models/list_teammate200_response_result_inner.py +++ b/sendgrid/rest/api/teammates/v3/models/list_teammate200_response_result_inner.py @@ -1,62 +1,62 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.teammates.v3.models.user_type import UserType - class ListTeammate200ResponseResultInner: def __init__( - self, - username: Optional[str]=None, - email: Optional[str]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - user_type: Optional[UserType]=None, - is_admin: Optional[bool]=None, - phone: Optional[str]=None, - website: Optional[str]=None, - address: Optional[str]=None, - address2: Optional[str]=None, - city: Optional[str]=None, - state: Optional[str]=None, - zip: Optional[str]=None, - country: Optional[str]=None + self, + username: Optional[str] = None, + email: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + user_type: Optional[UserType] = None, + is_admin: Optional[bool] = None, + phone: Optional[str] = None, + website: Optional[str] = None, + address: Optional[str] = None, + address2: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + zip: Optional[str] = None, + country: Optional[str] = None, ): - self.username=username - self.email=email - self.first_name=first_name - self.last_name=last_name - self.user_type=user_type - self.is_admin=is_admin - self.phone=phone - self.website=website - self.address=address - self.address2=address2 - self.city=city - self.state=state - self.zip=zip - self.country=country + self.username = username + self.email = email + self.first_name = first_name + self.last_name = last_name + self.user_type = user_type + self.is_admin = is_admin + self.phone = phone + self.website = website + self.address = address + self.address2 = address2 + self.city = city + self.state = state + self.zip = zip + self.country = country def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "username": self.username, - "email": self.email, - "first_name": self.first_name, - "last_name": self.last_name, - "user_type": self.user_type, - "is_admin": self.is_admin, - "phone": self.phone, - "website": self.website, - "address": self.address, - "address2": self.address2, - "city": self.city, - "state": self.state, - "zip": self.zip, - "country": self.country - }.items() if value is not None} + "username": self.username, + "email": self.email, + "first_name": self.first_name, + "last_name": self.last_name, + "user_type": self.user_type, + "is_admin": self.is_admin, + "phone": self.phone, + "website": self.website, + "address": self.address, + "address2": self.address2, + "city": self.city, + "state": self.state, + "zip": self.zip, + "country": self.country, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -65,19 +65,18 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListTeammate200ResponseResultInner( - username=payload.get('username'), - email=payload.get('email'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - user_type=payload.get('user_type'), - is_admin=payload.get('is_admin'), - phone=payload.get('phone'), - website=payload.get('website'), - address=payload.get('address'), - address2=payload.get('address2'), - city=payload.get('city'), - state=payload.get('state'), - zip=payload.get('zip'), - country=payload.get('country') - ) - + username=payload.get("username"), + email=payload.get("email"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + user_type=payload.get("user_type"), + is_admin=payload.get("is_admin"), + phone=payload.get("phone"), + website=payload.get("website"), + address=payload.get("address"), + address2=payload.get("address2"), + city=payload.get("city"), + state=payload.get("state"), + zip=payload.get("zip"), + country=payload.get("country"), + ) diff --git a/sendgrid/rest/api/teammates/v3/models/permission_type.py b/sendgrid/rest/api/teammates/v3/models/permission_type.py index 26e64ef6..14aced3d 100644 --- a/sendgrid/rest/api/teammates/v3/models/permission_type.py +++ b/sendgrid/rest/api/teammates/v3/models/permission_type.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class PermissionType(Enum): - ADMIN='admin' - RESTRICTED='restricted' - + ADMIN = "admin" + RESTRICTED = "restricted" diff --git a/sendgrid/rest/api/teammates/v3/models/resend_teammate_invite200_response.py b/sendgrid/rest/api/teammates/v3/models/resend_teammate_invite200_response.py index 753dee04..9ae58498 100644 --- a/sendgrid/rest/api/teammates/v3/models/resend_teammate_invite200_response.py +++ b/sendgrid/rest/api/teammates/v3/models/resend_teammate_invite200_response.py @@ -1,31 +1,31 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ResendTeammateInvite200Response: def __init__( - self, - token: Optional[str]=None, - email: Optional[str]=None, - scopes: Optional[List[str]]=None, - is_admin: Optional[bool]=None + self, + token: Optional[str] = None, + email: Optional[str] = None, + scopes: Optional[List[str]] = None, + is_admin: Optional[bool] = None, ): - self.token=token - self.email=email - self.scopes=scopes - self.is_admin=is_admin + self.token = token + self.email = email + self.scopes = scopes + self.is_admin = is_admin def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "token": self.token, - "email": self.email, - "scopes": self.scopes, - "is_admin": self.is_admin - }.items() if value is not None} + "token": self.token, + "email": self.email, + "scopes": self.scopes, + "is_admin": self.is_admin, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ResendTeammateInvite200Response( - token=payload.get('token'), - email=payload.get('email'), - scopes=payload.get('scopes'), - is_admin=payload.get('is_admin') - ) - + token=payload.get("token"), + email=payload.get("email"), + scopes=payload.get("scopes"), + is_admin=payload.get("is_admin"), + ) diff --git a/sendgrid/rest/api/teammates/v3/models/update_teammate200_response.py b/sendgrid/rest/api/teammates/v3/models/update_teammate200_response.py index d35fde79..badfa52b 100644 --- a/sendgrid/rest/api/teammates/v3/models/update_teammate200_response.py +++ b/sendgrid/rest/api/teammates/v3/models/update_teammate200_response.py @@ -1,65 +1,65 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.teammates.v3.models.user_type2 import UserType2 - class UpdateTeammate200Response: def __init__( - self, - username: Optional[str]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - email: Optional[str]=None, - scopes: Optional[List[str]]=None, - user_type: Optional[UserType2]=None, - is_admin: Optional[bool]=None, - phone: Optional[str]=None, - website: Optional[str]=None, - address: Optional[str]=None, - address2: Optional[str]=None, - city: Optional[str]=None, - state: Optional[str]=None, - zip: Optional[str]=None, - country: Optional[str]=None + self, + username: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + email: Optional[str] = None, + scopes: Optional[List[str]] = None, + user_type: Optional[UserType2] = None, + is_admin: Optional[bool] = None, + phone: Optional[str] = None, + website: Optional[str] = None, + address: Optional[str] = None, + address2: Optional[str] = None, + city: Optional[str] = None, + state: Optional[str] = None, + zip: Optional[str] = None, + country: Optional[str] = None, ): - self.username=username - self.first_name=first_name - self.last_name=last_name - self.email=email - self.scopes=scopes - self.user_type=user_type - self.is_admin=is_admin - self.phone=phone - self.website=website - self.address=address - self.address2=address2 - self.city=city - self.state=state - self.zip=zip - self.country=country + self.username = username + self.first_name = first_name + self.last_name = last_name + self.email = email + self.scopes = scopes + self.user_type = user_type + self.is_admin = is_admin + self.phone = phone + self.website = website + self.address = address + self.address2 = address2 + self.city = city + self.state = state + self.zip = zip + self.country = country def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "username": self.username, - "first_name": self.first_name, - "last_name": self.last_name, - "email": self.email, - "scopes": self.scopes, - "user_type": self.user_type, - "is_admin": self.is_admin, - "phone": self.phone, - "website": self.website, - "address": self.address, - "address2": self.address2, - "city": self.city, - "state": self.state, - "zip": self.zip, - "country": self.country - }.items() if value is not None} + "username": self.username, + "first_name": self.first_name, + "last_name": self.last_name, + "email": self.email, + "scopes": self.scopes, + "user_type": self.user_type, + "is_admin": self.is_admin, + "phone": self.phone, + "website": self.website, + "address": self.address, + "address2": self.address2, + "city": self.city, + "state": self.state, + "zip": self.zip, + "country": self.country, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -68,20 +68,19 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateTeammate200Response( - username=payload.get('username'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - email=payload.get('email'), - scopes=payload.get('scopes'), - user_type=payload.get('user_type'), - is_admin=payload.get('is_admin'), - phone=payload.get('phone'), - website=payload.get('website'), - address=payload.get('address'), - address2=payload.get('address2'), - city=payload.get('city'), - state=payload.get('state'), - zip=payload.get('zip'), - country=payload.get('country') - ) - + username=payload.get("username"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + email=payload.get("email"), + scopes=payload.get("scopes"), + user_type=payload.get("user_type"), + is_admin=payload.get("is_admin"), + phone=payload.get("phone"), + website=payload.get("website"), + address=payload.get("address"), + address2=payload.get("address2"), + city=payload.get("city"), + state=payload.get("state"), + zip=payload.get("zip"), + country=payload.get("country"), + ) diff --git a/sendgrid/rest/api/teammates/v3/models/update_teammate_request.py b/sendgrid/rest/api/teammates/v3/models/update_teammate_request.py index 9c52decf..0e479afa 100644 --- a/sendgrid/rest/api/teammates/v3/models/update_teammate_request.py +++ b/sendgrid/rest/api/teammates/v3/models/update_teammate_request.py @@ -1,25 +1,20 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateTeammateRequest: def __init__( - self, - scopes: Optional[List[str]]=None, - is_admin: Optional[bool]=None + self, scopes: Optional[List[str]] = None, is_admin: Optional[bool] = None ): - self.scopes=scopes - self.is_admin=is_admin + self.scopes = scopes + self.is_admin = is_admin def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "scopes": self.scopes, - "is_admin": self.is_admin - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"scopes": self.scopes, "is_admin": self.is_admin}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +23,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdateTeammateRequest( - scopes=payload.get('scopes'), - is_admin=payload.get('is_admin') - ) - + scopes=payload.get("scopes"), is_admin=payload.get("is_admin") + ) diff --git a/sendgrid/rest/api/teammates/v3/models/user_type.py b/sendgrid/rest/api/teammates/v3/models/user_type.py index 4d1bc2f2..c57452aa 100644 --- a/sendgrid/rest/api/teammates/v3/models/user_type.py +++ b/sendgrid/rest/api/teammates/v3/models/user_type.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class UserType(Enum): - ADMIN='admin' - OWNER='owner' - TEAMMATE='teammate' - + ADMIN = "admin" + OWNER = "owner" + TEAMMATE = "teammate" diff --git a/sendgrid/rest/api/teammates/v3/models/user_type1.py b/sendgrid/rest/api/teammates/v3/models/user_type1.py index 27bb10cf..a6466dbb 100644 --- a/sendgrid/rest/api/teammates/v3/models/user_type1.py +++ b/sendgrid/rest/api/teammates/v3/models/user_type1.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class UserType1(Enum): - ADMIN='admin' - OWNER='owner' - TEAMMATE='teammate' - + ADMIN = "admin" + OWNER = "owner" + TEAMMATE = "teammate" diff --git a/sendgrid/rest/api/teammates/v3/models/user_type2.py b/sendgrid/rest/api/teammates/v3/models/user_type2.py index 1a6fcb13..01e9dae5 100644 --- a/sendgrid/rest/api/teammates/v3/models/user_type2.py +++ b/sendgrid/rest/api/teammates/v3/models/user_type2.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class UserType2(Enum): - ADMIN='admin' - OWNER='owner' - TEAMMATE='teammate' - + ADMIN = "admin" + OWNER = "owner" + TEAMMATE = "teammate" diff --git a/sendgrid/rest/api/teammates/v3/resend_teammate_invite.py b/sendgrid/rest/api/teammates/v3/resend_teammate_invite.py index 050acbb0..fb2de11f 100644 --- a/sendgrid/rest/api/teammates/v3/resend_teammate_invite.py +++ b/sendgrid/rest/api/teammates/v3/resend_teammate_invite.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.teammates.v3.models.resend_teammate_invite200_response import ResendTeammateInvite200Response + class ResendTeammateInvite: def __init__(self, client) -> None: self.client = client - + def send( self, - token: str, - on_behalf_of: Optional[str] = None, - + token: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/teammates/pending/{token}/resend' + path = "/v3/teammates/pending/{token}/resend" path = path.format( - token=token, + token=token, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='POST', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/teammates/v3/update_teammate.py b/sendgrid/rest/api/teammates/v3/update_teammate.py index b22268f9..3bf167b9 100644 --- a/sendgrid/rest/api/teammates/v3/update_teammate.py +++ b/sendgrid/rest/api/teammates/v3/update_teammate.py @@ -12,59 +12,58 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.teammates.v3.models.update_teammate200_response import UpdateTeammate200Response -from sendgrid.rest.api.teammates.v3.models.update_teammate_request import UpdateTeammateRequest +from sendgrid.rest.api.teammates.v3.models.update_teammate_request import ( + UpdateTeammateRequest, +) + class UpdateTeammate: def __init__(self, client) -> None: self.client = client - + def send( self, - username: str, - on_behalf_of: Optional[str] = None, - update_teammate_request: Optional[UpdateTeammateRequest] = None, - + username: str, + on_behalf_of: Optional[str] = None, + update_teammate_request: Optional[UpdateTeammateRequest] = None, ): - path='/v3/teammates/{username}' + path = "/v3/teammates/{username}" path = path.format( - username=username, + username=username, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_teammate_request: data = update_teammate_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/templates/v3/__init__.py b/sendgrid/rest/api/templates/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/templates/v3/__init__.py +++ b/sendgrid/rest/api/templates/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/templates/v3/activate_template_version.py b/sendgrid/rest/api/templates/v3/activate_template_version.py index f3fbe9ea..bd93c2f8 100644 --- a/sendgrid/rest/api/templates/v3/activate_template_version.py +++ b/sendgrid/rest/api/templates/v3/activate_template_version.py @@ -12,56 +12,53 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.templates.v3.models.transactional_template_version_output import TransactionalTemplateVersionOutput + class ActivateTemplateVersion: def __init__(self, client) -> None: self.client = client - + def send( self, - template_id: str, - version_id: str, - on_behalf_of: Optional[str] = None, - + template_id: str, + version_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/templates/{template_id}/versions/{version_id}/activate' + path = "/v3/templates/{template_id}/versions/{version_id}/activate" path = path.format( - template_id=template_id, - version_id=version_id, + template_id=template_id, + version_id=version_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='POST', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/templates/v3/create_template.py b/sendgrid/rest/api/templates/v3/create_template.py index 97cbfe2f..0e5afd87 100644 --- a/sendgrid/rest/api/templates/v3/create_template.py +++ b/sendgrid/rest/api/templates/v3/create_template.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.templates.v3.models.create_template_request import CreateTemplateRequest -from sendgrid.rest.api.templates.v3.models.transactional_template import TransactionalTemplate +from sendgrid.rest.api.templates.v3.models.create_template_request import ( + CreateTemplateRequest, +) + class CreateTemplate: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - create_template_request: Optional[CreateTemplateRequest] = None, - + on_behalf_of: Optional[str] = None, + create_template_request: Optional[CreateTemplateRequest] = None, ): - path='/v3/templates' + path = "/v3/templates" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if create_template_request: data = create_template_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/templates/v3/create_template_version.py b/sendgrid/rest/api/templates/v3/create_template_version.py index 46ac1c72..247c52d5 100644 --- a/sendgrid/rest/api/templates/v3/create_template_version.py +++ b/sendgrid/rest/api/templates/v3/create_template_version.py @@ -12,59 +12,60 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.templates.v3.models.transactional_template_version_create import TransactionalTemplateVersionCreate -from sendgrid.rest.api.templates.v3.models.transactional_template_version_output import TransactionalTemplateVersionOutput +from sendgrid.rest.api.templates.v3.models.transactional_template_version_create import ( + TransactionalTemplateVersionCreate, +) + class CreateTemplateVersion: def __init__(self, client) -> None: self.client = client - + def send( self, - template_id: str, - on_behalf_of: Optional[str] = None, - transactional_template_version_create: Optional[TransactionalTemplateVersionCreate] = None, - + template_id: str, + on_behalf_of: Optional[str] = None, + transactional_template_version_create: Optional[ + TransactionalTemplateVersionCreate + ] = None, ): - path='/v3/templates/{template_id}/versions' + path = "/v3/templates/{template_id}/versions" path = path.format( - template_id=template_id, + template_id=template_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if transactional_template_version_create: data = transactional_template_version_create.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/templates/v3/delete_template.py b/sendgrid/rest/api/templates/v3/delete_template.py index 0e19e8a6..4dedc0e2 100644 --- a/sendgrid/rest/api/templates/v3/delete_template.py +++ b/sendgrid/rest/api/templates/v3/delete_template.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteTemplate: def __init__(self, client) -> None: self.client = client - + def send( self, - template_id: str, - on_behalf_of: Optional[str] = None, - + template_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/templates/{template_id}' + path = "/v3/templates/{template_id}" path = path.format( - template_id=template_id, + template_id=template_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/templates/v3/delete_template_version.py b/sendgrid/rest/api/templates/v3/delete_template_version.py index 2b651c74..cf1c1a2b 100644 --- a/sendgrid/rest/api/templates/v3/delete_template_version.py +++ b/sendgrid/rest/api/templates/v3/delete_template_version.py @@ -12,55 +12,53 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteTemplateVersion: def __init__(self, client) -> None: self.client = client - + def send( self, - template_id: str, - version_id: str, - on_behalf_of: Optional[str] = None, - + template_id: str, + version_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/templates/{template_id}/versions/{version_id}' + path = "/v3/templates/{template_id}/versions/{version_id}" path = path.format( - template_id=template_id, - version_id=version_id, + template_id=template_id, + version_id=version_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/templates/v3/duplicate_template.py b/sendgrid/rest/api/templates/v3/duplicate_template.py index 5487d28f..05d51b38 100644 --- a/sendgrid/rest/api/templates/v3/duplicate_template.py +++ b/sendgrid/rest/api/templates/v3/duplicate_template.py @@ -12,59 +12,58 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.templates.v3.models.duplicate_template_request import DuplicateTemplateRequest -from sendgrid.rest.api.templates.v3.models.transactional_template import TransactionalTemplate +from sendgrid.rest.api.templates.v3.models.duplicate_template_request import ( + DuplicateTemplateRequest, +) + class DuplicateTemplate: def __init__(self, client) -> None: self.client = client - + def send( self, - template_id: str, - on_behalf_of: Optional[str] = None, - duplicate_template_request: Optional[DuplicateTemplateRequest] = None, - + template_id: str, + on_behalf_of: Optional[str] = None, + duplicate_template_request: Optional[DuplicateTemplateRequest] = None, ): - path='/v3/templates/{template_id}' + path = "/v3/templates/{template_id}" path = path.format( - template_id=template_id, + template_id=template_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if duplicate_template_request: data = duplicate_template_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/templates/v3/get_template.py b/sendgrid/rest/api/templates/v3/get_template.py index 28549bf4..35d06eac 100644 --- a/sendgrid/rest/api/templates/v3/get_template.py +++ b/sendgrid/rest/api/templates/v3/get_template.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.templates.v3.models.transactional_template import TransactionalTemplate + class GetTemplate: def __init__(self, client) -> None: self.client = client - + def send( self, - template_id: str, - on_behalf_of: Optional[str] = None, - + template_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/templates/{template_id}' + path = "/v3/templates/{template_id}" path = path.format( - template_id=template_id, + template_id=template_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/templates/v3/get_template_version.py b/sendgrid/rest/api/templates/v3/get_template_version.py index d648f187..4a590c9d 100644 --- a/sendgrid/rest/api/templates/v3/get_template_version.py +++ b/sendgrid/rest/api/templates/v3/get_template_version.py @@ -12,56 +12,53 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.templates.v3.models.transactional_template_version_output import TransactionalTemplateVersionOutput + class GetTemplateVersion: def __init__(self, client) -> None: self.client = client - + def send( self, - template_id: str, - version_id: str, - on_behalf_of: Optional[str] = None, - + template_id: str, + version_id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/templates/{template_id}/versions/{version_id}' + path = "/v3/templates/{template_id}/versions/{version_id}" path = path.format( - template_id=template_id, - version_id=version_id, + template_id=template_id, + version_id=version_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/templates/v3/list_template.py b/sendgrid/rest/api/templates/v3/list_template.py index 9d520eb1..77ce48a5 100644 --- a/sendgrid/rest/api/templates/v3/list_template.py +++ b/sendgrid/rest/api/templates/v3/list_template.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr -from typing import Optional, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.rest.api.templates.v3.models.generations import Generations -from sendgrid.rest.api.templates.v3.models.list_template200_response import ListTemplate200Response + class ListTemplate: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - generations: Optional[Generations] = None, - page_size: Optional[float] = None, - page_token: Optional[str] = None, - + on_behalf_of: Optional[str] = None, + generations: Optional[Generations] = None, + page_size: Optional[float] = None, + page_token: Optional[str] = None, ): - path='/v3/templates' + path = "/v3/templates" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/templates/v3/models/__init__.py b/sendgrid/rest/api/templates/v3/models/__init__.py index dc5c1e62..616713b1 100644 --- a/sendgrid/rest/api/templates/v3/models/__init__.py +++ b/sendgrid/rest/api/templates/v3/models/__init__.py @@ -11,27 +11,72 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.templates.v3.models.active import Active from sendgrid.rest.api.templates.v3.models.active1 import Active1 -from sendgrid.rest.api.templates.v3.models.create_template_request import CreateTemplateRequest -from sendgrid.rest.api.templates.v3.models.duplicate_template_request import DuplicateTemplateRequest +from sendgrid.rest.api.templates.v3.models.create_template_request import ( + CreateTemplateRequest, +) +from sendgrid.rest.api.templates.v3.models.duplicate_template_request import ( + DuplicateTemplateRequest, +) from sendgrid.rest.api.templates.v3.models.editor import Editor from sendgrid.rest.api.templates.v3.models.editor1 import Editor1 from sendgrid.rest.api.templates.v3.models.generation import Generation from sendgrid.rest.api.templates.v3.models.generation1 import Generation1 from sendgrid.rest.api.templates.v3.models.generations import Generations -from sendgrid.rest.api.templates.v3.models.list_template200_response import ListTemplate200Response -from sendgrid.rest.api.templates.v3.models.list_template400_response import ListTemplate400Response -from sendgrid.rest.api.templates.v3.models.list_template400_response_errors_inner import ListTemplate400ResponseErrorsInner +from sendgrid.rest.api.templates.v3.models.list_template200_response import ( + ListTemplate200Response, +) +from sendgrid.rest.api.templates.v3.models.list_template400_response import ( + ListTemplate400Response, +) +from sendgrid.rest.api.templates.v3.models.list_template400_response_errors_inner import ( + ListTemplate400ResponseErrorsInner, +) from sendgrid.rest.api.templates.v3.models.metadata import Metadata -from sendgrid.rest.api.templates.v3.models.transactional_template import TransactionalTemplate -from sendgrid.rest.api.templates.v3.models.transactional_template_version_create import TransactionalTemplateVersionCreate -from sendgrid.rest.api.templates.v3.models.transactional_template_version_output import TransactionalTemplateVersionOutput -from sendgrid.rest.api.templates.v3.models.transactional_template_warning import TransactionalTemplateWarning -from sendgrid.rest.api.templates.v3.models.transactional_templates_template_lean import TransactionalTemplatesTemplateLean -from sendgrid.rest.api.templates.v3.models.transactional_templates_version_output_lean import TransactionalTemplatesVersionOutputLean -from sendgrid.rest.api.templates.v3.models.update_template_request import UpdateTemplateRequest -__all__ = [ 'Active', 'Active1', 'CreateTemplateRequest', 'DuplicateTemplateRequest', 'Editor', 'Editor1', 'Generation', 'Generation1', 'Generations', 'ListTemplate200Response', 'ListTemplate400Response', 'ListTemplate400ResponseErrorsInner', 'Metadata', 'TransactionalTemplate', 'TransactionalTemplateVersionCreate', 'TransactionalTemplateVersionOutput', 'TransactionalTemplateWarning', 'TransactionalTemplatesTemplateLean', 'TransactionalTemplatesVersionOutputLean', 'UpdateTemplateRequest' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.templates.v3.models.transactional_template import ( + TransactionalTemplate, +) +from sendgrid.rest.api.templates.v3.models.transactional_template_version_create import ( + TransactionalTemplateVersionCreate, +) +from sendgrid.rest.api.templates.v3.models.transactional_template_version_output import ( + TransactionalTemplateVersionOutput, +) +from sendgrid.rest.api.templates.v3.models.transactional_template_warning import ( + TransactionalTemplateWarning, +) +from sendgrid.rest.api.templates.v3.models.transactional_templates_template_lean import ( + TransactionalTemplatesTemplateLean, +) +from sendgrid.rest.api.templates.v3.models.transactional_templates_version_output_lean import ( + TransactionalTemplatesVersionOutputLean, +) +from sendgrid.rest.api.templates.v3.models.update_template_request import ( + UpdateTemplateRequest, +) + +__all__ = [ + "Active", + "Active1", + "CreateTemplateRequest", + "DuplicateTemplateRequest", + "Editor", + "Editor1", + "Generation", + "Generation1", + "Generations", + "ListTemplate200Response", + "ListTemplate400Response", + "ListTemplate400ResponseErrorsInner", + "Metadata", + "TransactionalTemplate", + "TransactionalTemplateVersionCreate", + "TransactionalTemplateVersionOutput", + "TransactionalTemplateWarning", + "TransactionalTemplatesTemplateLean", + "TransactionalTemplatesVersionOutputLean", + "UpdateTemplateRequest", +] +# Testing code diff --git a/sendgrid/rest/api/templates/v3/models/active.py b/sendgrid/rest/api/templates/v3/models/active.py index 0b1a646f..65593356 100644 --- a/sendgrid/rest/api/templates/v3/models/active.py +++ b/sendgrid/rest/api/templates/v3/models/active.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Active(Enum): - NUMBER_0=0 - NUMBER_1=1 - + NUMBER_0 = 0 + NUMBER_1 = 1 diff --git a/sendgrid/rest/api/templates/v3/models/active1.py b/sendgrid/rest/api/templates/v3/models/active1.py index 0a200b2d..a730bf0c 100644 --- a/sendgrid/rest/api/templates/v3/models/active1.py +++ b/sendgrid/rest/api/templates/v3/models/active1.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Active1(Enum): - NUMBER_0=0 - NUMBER_1=1 - + NUMBER_0 = 0 + NUMBER_1 = 1 diff --git a/sendgrid/rest/api/templates/v3/models/create_template_request.py b/sendgrid/rest/api/templates/v3/models/create_template_request.py index 765e502f..f98f7ce4 100644 --- a/sendgrid/rest/api/templates/v3/models/create_template_request.py +++ b/sendgrid/rest/api/templates/v3/models/create_template_request.py @@ -1,26 +1,21 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.templates.v3.models.generation import Generation - class CreateTemplateRequest: def __init__( - self, - name: Optional[str]=None, - generation: Optional[Generation]=None + self, name: Optional[str] = None, generation: Optional[Generation] = None ): - self.name=name - self.generation=generation + self.name = name + self.generation = generation def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name, - "generation": self.generation - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name, "generation": self.generation}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +24,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateTemplateRequest( - name=payload.get('name'), - generation=payload.get('generation') - ) - + name=payload.get("name"), generation=payload.get("generation") + ) diff --git a/sendgrid/rest/api/templates/v3/models/duplicate_template_request.py b/sendgrid/rest/api/templates/v3/models/duplicate_template_request.py index 4eec8cc9..4431575e 100644 --- a/sendgrid/rest/api/templates/v3/models/duplicate_template_request.py +++ b/sendgrid/rest/api/templates/v3/models/duplicate_template_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class DuplicateTemplateRequest: - def __init__( - self, - name: Optional[str]=None - ): - self.name=name + def __init__(self, name: Optional[str] = None): + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return DuplicateTemplateRequest( - name=payload.get('name') - ) - + return DuplicateTemplateRequest(name=payload.get("name")) diff --git a/sendgrid/rest/api/templates/v3/models/editor.py b/sendgrid/rest/api/templates/v3/models/editor.py index cb1c4f64..47b41f47 100644 --- a/sendgrid/rest/api/templates/v3/models/editor.py +++ b/sendgrid/rest/api/templates/v3/models/editor.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Editor(Enum): - CODE='code' - DESIGN='design' - + CODE = "code" + DESIGN = "design" diff --git a/sendgrid/rest/api/templates/v3/models/editor1.py b/sendgrid/rest/api/templates/v3/models/editor1.py index dc0d0177..a50f81cc 100644 --- a/sendgrid/rest/api/templates/v3/models/editor1.py +++ b/sendgrid/rest/api/templates/v3/models/editor1.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Editor1(Enum): - CODE='code' - DESIGN='design' - + CODE = "code" + DESIGN = "design" diff --git a/sendgrid/rest/api/templates/v3/models/generation.py b/sendgrid/rest/api/templates/v3/models/generation.py index b826f114..59c0db9f 100644 --- a/sendgrid/rest/api/templates/v3/models/generation.py +++ b/sendgrid/rest/api/templates/v3/models/generation.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Generation(Enum): - LEGACY='legacy' - DYNAMIC='dynamic' - + LEGACY = "legacy" + DYNAMIC = "dynamic" diff --git a/sendgrid/rest/api/templates/v3/models/generation1.py b/sendgrid/rest/api/templates/v3/models/generation1.py index adeeb2eb..888519c2 100644 --- a/sendgrid/rest/api/templates/v3/models/generation1.py +++ b/sendgrid/rest/api/templates/v3/models/generation1.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Generation1(Enum): - LEGACY='legacy' - DYNAMIC='dynamic' - + LEGACY = "legacy" + DYNAMIC = "dynamic" diff --git a/sendgrid/rest/api/templates/v3/models/generations.py b/sendgrid/rest/api/templates/v3/models/generations.py index b6e25507..42f3e0a1 100644 --- a/sendgrid/rest/api/templates/v3/models/generations.py +++ b/sendgrid/rest/api/templates/v3/models/generations.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Generations(Enum): - LEGACY='legacy' - DYNAMIC='dynamic' - LEGACY_COMMA_DYNAMIC='legacy,dynamic' - + LEGACY = "legacy" + DYNAMIC = "dynamic" + LEGACY_COMMA_DYNAMIC = "legacy,dynamic" diff --git a/sendgrid/rest/api/templates/v3/models/list_template200_response.py b/sendgrid/rest/api/templates/v3/models/list_template200_response.py index 8a16f1c4..5b57ae2d 100644 --- a/sendgrid/rest/api/templates/v3/models/list_template200_response.py +++ b/sendgrid/rest/api/templates/v3/models/list_template200_response.py @@ -1,27 +1,29 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.templates.v3.models.metadata import Metadata -from sendgrid.rest.api.templates.v3.models.transactional_templates_template_lean import TransactionalTemplatesTemplateLean - +from sendgrid.rest.api.templates.v3.models.transactional_templates_template_lean import ( + TransactionalTemplatesTemplateLean, +) class ListTemplate200Response: def __init__( - self, - result: Optional[List[TransactionalTemplatesTemplateLean]]=None, - metadata: Optional[Metadata]=None + self, + result: Optional[List[TransactionalTemplatesTemplateLean]] = None, + metadata: Optional[Metadata] = None, ): - self.result=result - self.metadata=metadata + self.result = result + self.metadata = metadata def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "result": self.result, - "_metadata": self.metadata - }.items() if value is not None} + "result": self.result, + "_metadata": self.metadata, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -30,7 +32,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListTemplate200Response( - result=payload.get('result'), - metadata=payload.get('_metadata') - ) - + result=payload.get("result"), metadata=payload.get("_metadata") + ) diff --git a/sendgrid/rest/api/templates/v3/models/list_template400_response.py b/sendgrid/rest/api/templates/v3/models/list_template400_response.py index ff560fce..78d38671 100644 --- a/sendgrid/rest/api/templates/v3/models/list_template400_response.py +++ b/sendgrid/rest/api/templates/v3/models/list_template400_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.templates.v3.models.list_template400_response_errors_inner import ListTemplate400ResponseErrorsInner - +from sendgrid.rest.api.templates.v3.models.list_template400_response_errors_inner import ( + ListTemplate400ResponseErrorsInner, +) class ListTemplate400Response: def __init__( - self, - errors: Optional[List[ListTemplate400ResponseErrorsInner]]=None + self, errors: Optional[List[ListTemplate400ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListTemplate400Response( - errors=payload.get('errors') - ) - + return ListTemplate400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/templates/v3/models/list_template400_response_errors_inner.py b/sendgrid/rest/api/templates/v3/models/list_template400_response_errors_inner.py index 1bbf546c..c4e0826c 100644 --- a/sendgrid/rest/api/templates/v3/models/list_template400_response_errors_inner.py +++ b/sendgrid/rest/api/templates/v3/models/list_template400_response_errors_inner.py @@ -1,25 +1,21 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListTemplate400ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None, - error_id: Optional[str]=None - ): - self.message=message - self.error_id=error_id + def __init__(self, message: Optional[str] = None, error_id: Optional[str] = None): + self.message = message + self.error_id = error_id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "error_id": self.error_id - }.items() if value is not None} + "message": self.message, + "error_id": self.error_id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +24,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListTemplate400ResponseErrorsInner( - message=payload.get('message'), - error_id=payload.get('error_id') - ) - + message=payload.get("message"), error_id=payload.get("error_id") + ) diff --git a/sendgrid/rest/api/templates/v3/models/metadata.py b/sendgrid/rest/api/templates/v3/models/metadata.py index 88263186..3281a432 100644 --- a/sendgrid/rest/api/templates/v3/models/metadata.py +++ b/sendgrid/rest/api/templates/v3/models/metadata.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class Metadata: def __init__( - self, - prev: Optional[str]=None, - var_self: Optional[str]=None, - next: Optional[str]=None, - count: Optional[int]=None + self, + prev: Optional[str] = None, + var_self: Optional[str] = None, + next: Optional[str] = None, + count: Optional[int] = None, ): - self.prev=prev - self.var_self=var_self - self.next=next - self.count=count + self.prev = prev + self.var_self = var_self + self.next = next + self.count = count def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "prev": self.prev, - "self": self.var_self, - "next": self.next, - "count": self.count - }.items() if value is not None} + "prev": self.prev, + "self": self.var_self, + "next": self.next, + "count": self.count, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return Metadata( - prev=payload.get('prev'), - var_self=payload.get('self'), - next=payload.get('next'), - count=payload.get('count') - ) - + prev=payload.get("prev"), + var_self=payload.get("self"), + next=payload.get("next"), + count=payload.get("count"), + ) diff --git a/sendgrid/rest/api/templates/v3/models/transactional_template.py b/sendgrid/rest/api/templates/v3/models/transactional_template.py index b33d4772..bced593b 100644 --- a/sendgrid/rest/api/templates/v3/models/transactional_template.py +++ b/sendgrid/rest/api/templates/v3/models/transactional_template.py @@ -1,40 +1,44 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.templates.v3.models.generation1 import Generation1 -from sendgrid.rest.api.templates.v3.models.transactional_template_warning import TransactionalTemplateWarning -from sendgrid.rest.api.templates.v3.models.transactional_templates_version_output_lean import TransactionalTemplatesVersionOutputLean - +from sendgrid.rest.api.templates.v3.models.transactional_template_warning import ( + TransactionalTemplateWarning, +) +from sendgrid.rest.api.templates.v3.models.transactional_templates_version_output_lean import ( + TransactionalTemplatesVersionOutputLean, +) class TransactionalTemplate: def __init__( - self, - id: Optional[str]=None, - name: Optional[str]=None, - generation: Optional[Generation1]=None, - updated_at: Optional[str]=None, - versions: Optional[List[TransactionalTemplatesVersionOutputLean]]=None, - warning: Optional[TransactionalTemplateWarning]=None + self, + id: Optional[str] = None, + name: Optional[str] = None, + generation: Optional[Generation1] = None, + updated_at: Optional[str] = None, + versions: Optional[List[TransactionalTemplatesVersionOutputLean]] = None, + warning: Optional[TransactionalTemplateWarning] = None, ): - self.id=id - self.name=name - self.generation=generation - self.updated_at=updated_at - self.versions=versions - self.warning=warning + self.id = id + self.name = name + self.generation = generation + self.updated_at = updated_at + self.versions = versions + self.warning = warning def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "name": self.name, - "generation": self.generation, - "updated_at": self.updated_at, - "versions": self.versions, - "warning": self.warning - }.items() if value is not None} + "id": self.id, + "name": self.name, + "generation": self.generation, + "updated_at": self.updated_at, + "versions": self.versions, + "warning": self.warning, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -43,11 +47,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return TransactionalTemplate( - id=payload.get('id'), - name=payload.get('name'), - generation=payload.get('generation'), - updated_at=payload.get('updated_at'), - versions=payload.get('versions'), - warning=payload.get('warning') - ) - + id=payload.get("id"), + name=payload.get("name"), + generation=payload.get("generation"), + updated_at=payload.get("updated_at"), + versions=payload.get("versions"), + warning=payload.get("warning"), + ) diff --git a/sendgrid/rest/api/templates/v3/models/transactional_template_version_create.py b/sendgrid/rest/api/templates/v3/models/transactional_template_version_create.py index d4439202..63b19426 100644 --- a/sendgrid/rest/api/templates/v3/models/transactional_template_version_create.py +++ b/sendgrid/rest/api/templates/v3/models/transactional_template_version_create.py @@ -1,45 +1,45 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.templates.v3.models.active import Active from sendgrid.rest.api.templates.v3.models.editor import Editor - class TransactionalTemplateVersionCreate: def __init__( - self, - active: Optional[Active]=None, - name: Optional[str]=None, - html_content: Optional[str]=None, - plain_content: Optional[str]=None, - generate_plain_content: Optional[bool]=None, - subject: Optional[str]=None, - editor: Optional[Editor]=None, - test_data: Optional[str]=None + self, + active: Optional[Active] = None, + name: Optional[str] = None, + html_content: Optional[str] = None, + plain_content: Optional[str] = None, + generate_plain_content: Optional[bool] = None, + subject: Optional[str] = None, + editor: Optional[Editor] = None, + test_data: Optional[str] = None, ): - self.active=active - self.name=name - self.html_content=html_content - self.plain_content=plain_content - self.generate_plain_content=generate_plain_content - self.subject=subject - self.editor=editor - self.test_data=test_data + self.active = active + self.name = name + self.html_content = html_content + self.plain_content = plain_content + self.generate_plain_content = generate_plain_content + self.subject = subject + self.editor = editor + self.test_data = test_data def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "active": self.active, - "name": self.name, - "html_content": self.html_content, - "plain_content": self.plain_content, - "generate_plain_content": self.generate_plain_content, - "subject": self.subject, - "editor": self.editor, - "test_data": self.test_data - }.items() if value is not None} + "active": self.active, + "name": self.name, + "html_content": self.html_content, + "plain_content": self.plain_content, + "generate_plain_content": self.generate_plain_content, + "subject": self.subject, + "editor": self.editor, + "test_data": self.test_data, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -48,13 +48,12 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return TransactionalTemplateVersionCreate( - active=payload.get('active'), - name=payload.get('name'), - html_content=payload.get('html_content'), - plain_content=payload.get('plain_content'), - generate_plain_content=payload.get('generate_plain_content'), - subject=payload.get('subject'), - editor=payload.get('editor'), - test_data=payload.get('test_data') - ) - + active=payload.get("active"), + name=payload.get("name"), + html_content=payload.get("html_content"), + plain_content=payload.get("plain_content"), + generate_plain_content=payload.get("generate_plain_content"), + subject=payload.get("subject"), + editor=payload.get("editor"), + test_data=payload.get("test_data"), + ) diff --git a/sendgrid/rest/api/templates/v3/models/transactional_template_version_output.py b/sendgrid/rest/api/templates/v3/models/transactional_template_version_output.py index 26166e33..55b83ad3 100644 --- a/sendgrid/rest/api/templates/v3/models/transactional_template_version_output.py +++ b/sendgrid/rest/api/templates/v3/models/transactional_template_version_output.py @@ -1,61 +1,63 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.templates.v3.models.active1 import Active1 from sendgrid.rest.api.templates.v3.models.editor1 import Editor1 -from sendgrid.rest.api.templates.v3.models.transactional_template_warning import TransactionalTemplateWarning - +from sendgrid.rest.api.templates.v3.models.transactional_template_warning import ( + TransactionalTemplateWarning, +) class TransactionalTemplateVersionOutput: def __init__( - self, - warnings: Optional[List[TransactionalTemplateWarning]]=None, - active: Optional[Active1]=None, - name: Optional[str]=None, - html_content: Optional[str]=None, - plain_content: Optional[str]=None, - generate_plain_content: Optional[bool]=None, - subject: Optional[str]=None, - editor: Optional[Editor1]=None, - test_data: Optional[str]=None, - id: Optional[str]=None, - template_id: Optional[str]=None, - updated_at: Optional[str]=None, - thumbnail_url: Optional[str]=None + self, + warnings: Optional[List[TransactionalTemplateWarning]] = None, + active: Optional[Active1] = None, + name: Optional[str] = None, + html_content: Optional[str] = None, + plain_content: Optional[str] = None, + generate_plain_content: Optional[bool] = None, + subject: Optional[str] = None, + editor: Optional[Editor1] = None, + test_data: Optional[str] = None, + id: Optional[str] = None, + template_id: Optional[str] = None, + updated_at: Optional[str] = None, + thumbnail_url: Optional[str] = None, ): - self.warnings=warnings - self.active=active - self.name=name - self.html_content=html_content - self.plain_content=plain_content - self.generate_plain_content=generate_plain_content - self.subject=subject - self.editor=editor - self.test_data=test_data - self.id=id - self.template_id=template_id - self.updated_at=updated_at - self.thumbnail_url=thumbnail_url + self.warnings = warnings + self.active = active + self.name = name + self.html_content = html_content + self.plain_content = plain_content + self.generate_plain_content = generate_plain_content + self.subject = subject + self.editor = editor + self.test_data = test_data + self.id = id + self.template_id = template_id + self.updated_at = updated_at + self.thumbnail_url = thumbnail_url def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "warnings": self.warnings, - "active": self.active, - "name": self.name, - "html_content": self.html_content, - "plain_content": self.plain_content, - "generate_plain_content": self.generate_plain_content, - "subject": self.subject, - "editor": self.editor, - "test_data": self.test_data, - "id": self.id, - "template_id": self.template_id, - "updated_at": self.updated_at, - "thumbnail_url": self.thumbnail_url - }.items() if value is not None} + "warnings": self.warnings, + "active": self.active, + "name": self.name, + "html_content": self.html_content, + "plain_content": self.plain_content, + "generate_plain_content": self.generate_plain_content, + "subject": self.subject, + "editor": self.editor, + "test_data": self.test_data, + "id": self.id, + "template_id": self.template_id, + "updated_at": self.updated_at, + "thumbnail_url": self.thumbnail_url, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -64,18 +66,17 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return TransactionalTemplateVersionOutput( - warnings=payload.get('warnings'), - active=payload.get('active'), - name=payload.get('name'), - html_content=payload.get('html_content'), - plain_content=payload.get('plain_content'), - generate_plain_content=payload.get('generate_plain_content'), - subject=payload.get('subject'), - editor=payload.get('editor'), - test_data=payload.get('test_data'), - id=payload.get('id'), - template_id=payload.get('template_id'), - updated_at=payload.get('updated_at'), - thumbnail_url=payload.get('thumbnail_url') - ) - + warnings=payload.get("warnings"), + active=payload.get("active"), + name=payload.get("name"), + html_content=payload.get("html_content"), + plain_content=payload.get("plain_content"), + generate_plain_content=payload.get("generate_plain_content"), + subject=payload.get("subject"), + editor=payload.get("editor"), + test_data=payload.get("test_data"), + id=payload.get("id"), + template_id=payload.get("template_id"), + updated_at=payload.get("updated_at"), + thumbnail_url=payload.get("thumbnail_url"), + ) diff --git a/sendgrid/rest/api/templates/v3/models/transactional_template_warning.py b/sendgrid/rest/api/templates/v3/models/transactional_template_warning.py index 3ef7cc2c..9f04d4d6 100644 --- a/sendgrid/rest/api/templates/v3/models/transactional_template_warning.py +++ b/sendgrid/rest/api/templates/v3/models/transactional_template_warning.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class TransactionalTemplateWarning: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return TransactionalTemplateWarning( - message=payload.get('message') - ) - + return TransactionalTemplateWarning(message=payload.get("message")) diff --git a/sendgrid/rest/api/templates/v3/models/transactional_templates_template_lean.py b/sendgrid/rest/api/templates/v3/models/transactional_templates_template_lean.py index b9635a17..a25aa19c 100644 --- a/sendgrid/rest/api/templates/v3/models/transactional_templates_template_lean.py +++ b/sendgrid/rest/api/templates/v3/models/transactional_templates_template_lean.py @@ -1,36 +1,38 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.templates.v3.models.generation1 import Generation1 -from sendgrid.rest.api.templates.v3.models.transactional_templates_version_output_lean import TransactionalTemplatesVersionOutputLean - +from sendgrid.rest.api.templates.v3.models.transactional_templates_version_output_lean import ( + TransactionalTemplatesVersionOutputLean, +) class TransactionalTemplatesTemplateLean: def __init__( - self, - id: Optional[str]=None, - name: Optional[str]=None, - generation: Optional[Generation1]=None, - updated_at: Optional[str]=None, - versions: Optional[List[TransactionalTemplatesVersionOutputLean]]=None + self, + id: Optional[str] = None, + name: Optional[str] = None, + generation: Optional[Generation1] = None, + updated_at: Optional[str] = None, + versions: Optional[List[TransactionalTemplatesVersionOutputLean]] = None, ): - self.id=id - self.name=name - self.generation=generation - self.updated_at=updated_at - self.versions=versions + self.id = id + self.name = name + self.generation = generation + self.updated_at = updated_at + self.versions = versions def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "name": self.name, - "generation": self.generation, - "updated_at": self.updated_at, - "versions": self.versions - }.items() if value is not None} + "id": self.id, + "name": self.name, + "generation": self.generation, + "updated_at": self.updated_at, + "versions": self.versions, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -39,10 +41,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return TransactionalTemplatesTemplateLean( - id=payload.get('id'), - name=payload.get('name'), - generation=payload.get('generation'), - updated_at=payload.get('updated_at'), - versions=payload.get('versions') - ) - + id=payload.get("id"), + name=payload.get("name"), + generation=payload.get("generation"), + updated_at=payload.get("updated_at"), + versions=payload.get("versions"), + ) diff --git a/sendgrid/rest/api/templates/v3/models/transactional_templates_version_output_lean.py b/sendgrid/rest/api/templates/v3/models/transactional_templates_version_output_lean.py index f7c80b18..4472afc4 100644 --- a/sendgrid/rest/api/templates/v3/models/transactional_templates_version_output_lean.py +++ b/sendgrid/rest/api/templates/v3/models/transactional_templates_version_output_lean.py @@ -1,54 +1,54 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.templates.v3.models.active1 import Active1 from sendgrid.rest.api.templates.v3.models.editor1 import Editor1 - class TransactionalTemplatesVersionOutputLean: def __init__( - self, - id: Optional[str]=None, - template_id: Optional[str]=None, - active: Optional[Active1]=None, - name: Optional[str]=None, - subject: Optional[str]=None, - updated_at: Optional[str]=None, - generate_plain_content: Optional[bool]=None, - html_content: Optional[str]=None, - plain_content: Optional[str]=None, - editor: Optional[Editor1]=None, - thumbnail_url: Optional[str]=None + self, + id: Optional[str] = None, + template_id: Optional[str] = None, + active: Optional[Active1] = None, + name: Optional[str] = None, + subject: Optional[str] = None, + updated_at: Optional[str] = None, + generate_plain_content: Optional[bool] = None, + html_content: Optional[str] = None, + plain_content: Optional[str] = None, + editor: Optional[Editor1] = None, + thumbnail_url: Optional[str] = None, ): - self.id=id - self.template_id=template_id - self.active=active - self.name=name - self.subject=subject - self.updated_at=updated_at - self.generate_plain_content=generate_plain_content - self.html_content=html_content - self.plain_content=plain_content - self.editor=editor - self.thumbnail_url=thumbnail_url + self.id = id + self.template_id = template_id + self.active = active + self.name = name + self.subject = subject + self.updated_at = updated_at + self.generate_plain_content = generate_plain_content + self.html_content = html_content + self.plain_content = plain_content + self.editor = editor + self.thumbnail_url = thumbnail_url def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "template_id": self.template_id, - "active": self.active, - "name": self.name, - "subject": self.subject, - "updated_at": self.updated_at, - "generate_plain_content": self.generate_plain_content, - "html_content": self.html_content, - "plain_content": self.plain_content, - "editor": self.editor, - "thumbnail_url": self.thumbnail_url - }.items() if value is not None} + "id": self.id, + "template_id": self.template_id, + "active": self.active, + "name": self.name, + "subject": self.subject, + "updated_at": self.updated_at, + "generate_plain_content": self.generate_plain_content, + "html_content": self.html_content, + "plain_content": self.plain_content, + "editor": self.editor, + "thumbnail_url": self.thumbnail_url, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -57,16 +57,15 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return TransactionalTemplatesVersionOutputLean( - id=payload.get('id'), - template_id=payload.get('template_id'), - active=payload.get('active'), - name=payload.get('name'), - subject=payload.get('subject'), - updated_at=payload.get('updated_at'), - generate_plain_content=payload.get('generate_plain_content'), - html_content=payload.get('html_content'), - plain_content=payload.get('plain_content'), - editor=payload.get('editor'), - thumbnail_url=payload.get('thumbnail_url') - ) - + id=payload.get("id"), + template_id=payload.get("template_id"), + active=payload.get("active"), + name=payload.get("name"), + subject=payload.get("subject"), + updated_at=payload.get("updated_at"), + generate_plain_content=payload.get("generate_plain_content"), + html_content=payload.get("html_content"), + plain_content=payload.get("plain_content"), + editor=payload.get("editor"), + thumbnail_url=payload.get("thumbnail_url"), + ) diff --git a/sendgrid/rest/api/templates/v3/models/update_template_request.py b/sendgrid/rest/api/templates/v3/models/update_template_request.py index 8ed7a7b3..d329a716 100644 --- a/sendgrid/rest/api/templates/v3/models/update_template_request.py +++ b/sendgrid/rest/api/templates/v3/models/update_template_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateTemplateRequest: - def __init__( - self, - name: Optional[str]=None - ): - self.name=name + def __init__(self, name: Optional[str] = None): + self.name = name def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "name": self.name - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"name": self.name}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateTemplateRequest( - name=payload.get('name') - ) - + return UpdateTemplateRequest(name=payload.get("name")) diff --git a/sendgrid/rest/api/templates/v3/update_template.py b/sendgrid/rest/api/templates/v3/update_template.py index 7418185a..4ee9f8f9 100644 --- a/sendgrid/rest/api/templates/v3/update_template.py +++ b/sendgrid/rest/api/templates/v3/update_template.py @@ -12,59 +12,58 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.templates.v3.models.transactional_template import TransactionalTemplate -from sendgrid.rest.api.templates.v3.models.update_template_request import UpdateTemplateRequest +from sendgrid.rest.api.templates.v3.models.update_template_request import ( + UpdateTemplateRequest, +) + class UpdateTemplate: def __init__(self, client) -> None: self.client = client - + def send( self, - template_id: str, - on_behalf_of: Optional[str] = None, - update_template_request: Optional[UpdateTemplateRequest] = None, - + template_id: str, + on_behalf_of: Optional[str] = None, + update_template_request: Optional[UpdateTemplateRequest] = None, ): - path='/v3/templates/{template_id}' + path = "/v3/templates/{template_id}" path = path.format( - template_id=template_id, + template_id=template_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_template_request: data = update_template_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/templates/v3/update_template_version.py b/sendgrid/rest/api/templates/v3/update_template_version.py index c9dfc4de..529b00fc 100644 --- a/sendgrid/rest/api/templates/v3/update_template_version.py +++ b/sendgrid/rest/api/templates/v3/update_template_version.py @@ -12,61 +12,62 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.templates.v3.models.transactional_template_version_create import TransactionalTemplateVersionCreate -from sendgrid.rest.api.templates.v3.models.transactional_template_version_output import TransactionalTemplateVersionOutput +from sendgrid.rest.api.templates.v3.models.transactional_template_version_create import ( + TransactionalTemplateVersionCreate, +) + class UpdateTemplateVersion: def __init__(self, client) -> None: self.client = client - + def send( self, - template_id: str, - version_id: str, - on_behalf_of: Optional[str] = None, - transactional_template_version_create: Optional[TransactionalTemplateVersionCreate] = None, - + template_id: str, + version_id: str, + on_behalf_of: Optional[str] = None, + transactional_template_version_create: Optional[ + TransactionalTemplateVersionCreate + ] = None, ): - path='/v3/templates/{template_id}/versions/{version_id}' + path = "/v3/templates/{template_id}/versions/{version_id}" path = path.format( - template_id=template_id, - version_id=version_id, + template_id=template_id, + version_id=version_id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if transactional_template_version_create: data = transactional_template_version_create.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/tracking_settings/v3/__init__.py b/sendgrid/rest/api/tracking_settings/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/tracking_settings/v3/__init__.py +++ b/sendgrid/rest/api/tracking_settings/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/tracking_settings/v3/list_click_tracking_setting.py b/sendgrid/rest/api/tracking_settings/v3/list_click_tracking_setting.py index 575b8413..895974be 100644 --- a/sendgrid/rest/api/tracking_settings/v3/list_click_tracking_setting.py +++ b/sendgrid/rest/api/tracking_settings/v3/list_click_tracking_setting.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.tracking_settings.v3.models.click_tracking import ClickTracking + class ListClickTrackingSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/tracking_settings/click' + path = "/v3/tracking_settings/click" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/tracking_settings/v3/list_google_analytics_tracking_setting.py b/sendgrid/rest/api/tracking_settings/v3/list_google_analytics_tracking_setting.py index e178b65e..39bd35a9 100644 --- a/sendgrid/rest/api/tracking_settings/v3/list_google_analytics_tracking_setting.py +++ b/sendgrid/rest/api/tracking_settings/v3/list_google_analytics_tracking_setting.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.tracking_settings.v3.models.google_analytics_settings import GoogleAnalyticsSettings + class ListGoogleAnalyticsTrackingSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/tracking_settings/google_analytics' + path = "/v3/tracking_settings/google_analytics" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/tracking_settings/v3/list_open_tracking_setting.py b/sendgrid/rest/api/tracking_settings/v3/list_open_tracking_setting.py index b1cc7b61..7904c1c2 100644 --- a/sendgrid/rest/api/tracking_settings/v3/list_open_tracking_setting.py +++ b/sendgrid/rest/api/tracking_settings/v3/list_open_tracking_setting.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.tracking_settings.v3.models.list_open_tracking_setting200_response import ListOpenTrackingSetting200Response + class ListOpenTrackingSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/tracking_settings/open' + path = "/v3/tracking_settings/open" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/tracking_settings/v3/list_subscription_tracking_setting.py b/sendgrid/rest/api/tracking_settings/v3/list_subscription_tracking_setting.py index f46e3aa1..c486d329 100644 --- a/sendgrid/rest/api/tracking_settings/v3/list_subscription_tracking_setting.py +++ b/sendgrid/rest/api/tracking_settings/v3/list_subscription_tracking_setting.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.tracking_settings.v3.models.subscription_tracking_settings import SubscriptionTrackingSettings + class ListSubscriptionTrackingSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/tracking_settings/subscription' + path = "/v3/tracking_settings/subscription" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/tracking_settings/v3/list_tracking_setting.py b/sendgrid/rest/api/tracking_settings/v3/list_tracking_setting.py index 615b47c5..610af68c 100644 --- a/sendgrid/rest/api/tracking_settings/v3/list_tracking_setting.py +++ b/sendgrid/rest/api/tracking_settings/v3/list_tracking_setting.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.tracking_settings.v3.models.list_tracking_setting200_response import ListTrackingSetting200Response + class ListTrackingSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/tracking_settings' + path = "/v3/tracking_settings" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/tracking_settings/v3/models/__init__.py b/sendgrid/rest/api/tracking_settings/v3/models/__init__.py index babcf68e..37df41a9 100644 --- a/sendgrid/rest/api/tracking_settings/v3/models/__init__.py +++ b/sendgrid/rest/api/tracking_settings/v3/models/__init__.py @@ -11,15 +11,38 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.tracking_settings.v3.models.click_tracking import ClickTracking -from sendgrid.rest.api.tracking_settings.v3.models.google_analytics_settings import GoogleAnalyticsSettings -from sendgrid.rest.api.tracking_settings.v3.models.list_open_tracking_setting200_response import ListOpenTrackingSetting200Response -from sendgrid.rest.api.tracking_settings.v3.models.list_tracking_setting200_response import ListTrackingSetting200Response -from sendgrid.rest.api.tracking_settings.v3.models.list_tracking_setting200_response_result_inner import ListTrackingSetting200ResponseResultInner -from sendgrid.rest.api.tracking_settings.v3.models.subscription_tracking_settings import SubscriptionTrackingSettings -from sendgrid.rest.api.tracking_settings.v3.models.update_click_tracking_setting_request import UpdateClickTrackingSettingRequest -from sendgrid.rest.api.tracking_settings.v3.models.update_open_tracking_setting_request import UpdateOpenTrackingSettingRequest -__all__ = [ 'ClickTracking', 'GoogleAnalyticsSettings', 'ListOpenTrackingSetting200Response', 'ListTrackingSetting200Response', 'ListTrackingSetting200ResponseResultInner', 'SubscriptionTrackingSettings', 'UpdateClickTrackingSettingRequest', 'UpdateOpenTrackingSettingRequest' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.tracking_settings.v3.models.google_analytics_settings import ( + GoogleAnalyticsSettings, +) +from sendgrid.rest.api.tracking_settings.v3.models.list_open_tracking_setting200_response import ( + ListOpenTrackingSetting200Response, +) +from sendgrid.rest.api.tracking_settings.v3.models.list_tracking_setting200_response import ( + ListTrackingSetting200Response, +) +from sendgrid.rest.api.tracking_settings.v3.models.list_tracking_setting200_response_result_inner import ( + ListTrackingSetting200ResponseResultInner, +) +from sendgrid.rest.api.tracking_settings.v3.models.subscription_tracking_settings import ( + SubscriptionTrackingSettings, +) +from sendgrid.rest.api.tracking_settings.v3.models.update_click_tracking_setting_request import ( + UpdateClickTrackingSettingRequest, +) +from sendgrid.rest.api.tracking_settings.v3.models.update_open_tracking_setting_request import ( + UpdateOpenTrackingSettingRequest, +) + +__all__ = [ + "ClickTracking", + "GoogleAnalyticsSettings", + "ListOpenTrackingSetting200Response", + "ListTrackingSetting200Response", + "ListTrackingSetting200ResponseResultInner", + "SubscriptionTrackingSettings", + "UpdateClickTrackingSettingRequest", + "UpdateOpenTrackingSettingRequest", +] +# Testing code diff --git a/sendgrid/rest/api/tracking_settings/v3/models/click_tracking.py b/sendgrid/rest/api/tracking_settings/v3/models/click_tracking.py index 287c9a05..5f8690e4 100644 --- a/sendgrid/rest/api/tracking_settings/v3/models/click_tracking.py +++ b/sendgrid/rest/api/tracking_settings/v3/models/click_tracking.py @@ -1,25 +1,23 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ClickTracking: def __init__( - self, - enable_text: Optional[bool]=None, - enabled: Optional[bool]=None + self, enable_text: Optional[bool] = None, enabled: Optional[bool] = None ): - self.enable_text=enable_text - self.enabled=enabled + self.enable_text = enable_text + self.enabled = enabled def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enable_text": self.enable_text, - "enabled": self.enabled - }.items() if value is not None} + "enable_text": self.enable_text, + "enabled": self.enabled, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +26,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ClickTracking( - enable_text=payload.get('enable_text'), - enabled=payload.get('enabled') - ) - + enable_text=payload.get("enable_text"), enabled=payload.get("enabled") + ) diff --git a/sendgrid/rest/api/tracking_settings/v3/models/google_analytics_settings.py b/sendgrid/rest/api/tracking_settings/v3/models/google_analytics_settings.py index 979fc36b..a181d610 100644 --- a/sendgrid/rest/api/tracking_settings/v3/models/google_analytics_settings.py +++ b/sendgrid/rest/api/tracking_settings/v3/models/google_analytics_settings.py @@ -1,37 +1,37 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GoogleAnalyticsSettings: def __init__( - self, - enabled: Optional[bool]=None, - utm_campaign: Optional[str]=None, - utm_content: Optional[str]=None, - utm_medium: Optional[str]=None, - utm_source: Optional[str]=None, - utm_term: Optional[str]=None + self, + enabled: Optional[bool] = None, + utm_campaign: Optional[str] = None, + utm_content: Optional[str] = None, + utm_medium: Optional[str] = None, + utm_source: Optional[str] = None, + utm_term: Optional[str] = None, ): - self.enabled=enabled - self.utm_campaign=utm_campaign - self.utm_content=utm_content - self.utm_medium=utm_medium - self.utm_source=utm_source - self.utm_term=utm_term + self.enabled = enabled + self.utm_campaign = utm_campaign + self.utm_content = utm_content + self.utm_medium = utm_medium + self.utm_source = utm_source + self.utm_term = utm_term def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enabled": self.enabled, - "utm_campaign": self.utm_campaign, - "utm_content": self.utm_content, - "utm_medium": self.utm_medium, - "utm_source": self.utm_source, - "utm_term": self.utm_term - }.items() if value is not None} + "enabled": self.enabled, + "utm_campaign": self.utm_campaign, + "utm_content": self.utm_content, + "utm_medium": self.utm_medium, + "utm_source": self.utm_source, + "utm_term": self.utm_term, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -40,11 +40,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GoogleAnalyticsSettings( - enabled=payload.get('enabled'), - utm_campaign=payload.get('utm_campaign'), - utm_content=payload.get('utm_content'), - utm_medium=payload.get('utm_medium'), - utm_source=payload.get('utm_source'), - utm_term=payload.get('utm_term') - ) - + enabled=payload.get("enabled"), + utm_campaign=payload.get("utm_campaign"), + utm_content=payload.get("utm_content"), + utm_medium=payload.get("utm_medium"), + utm_source=payload.get("utm_source"), + utm_term=payload.get("utm_term"), + ) diff --git a/sendgrid/rest/api/tracking_settings/v3/models/list_open_tracking_setting200_response.py b/sendgrid/rest/api/tracking_settings/v3/models/list_open_tracking_setting200_response.py index eaf245d4..469cf1df 100644 --- a/sendgrid/rest/api/tracking_settings/v3/models/list_open_tracking_setting200_response.py +++ b/sendgrid/rest/api/tracking_settings/v3/models/list_open_tracking_setting200_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListOpenTrackingSetting200Response: - def __init__( - self, - enabled: Optional[bool]=None - ): - self.enabled=enabled + def __init__(self, enabled: Optional[bool] = None): + self.enabled = enabled def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "enabled": self.enabled - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"enabled": self.enabled}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListOpenTrackingSetting200Response( - enabled=payload.get('enabled') - ) - + return ListOpenTrackingSetting200Response(enabled=payload.get("enabled")) diff --git a/sendgrid/rest/api/tracking_settings/v3/models/list_tracking_setting200_response.py b/sendgrid/rest/api/tracking_settings/v3/models/list_tracking_setting200_response.py index 92896aa7..c3e76780 100644 --- a/sendgrid/rest/api/tracking_settings/v3/models/list_tracking_setting200_response.py +++ b/sendgrid/rest/api/tracking_settings/v3/models/list_tracking_setting200_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.tracking_settings.v3.models.list_tracking_setting200_response_result_inner import ListTrackingSetting200ResponseResultInner - +from sendgrid.rest.api.tracking_settings.v3.models.list_tracking_setting200_response_result_inner import ( + ListTrackingSetting200ResponseResultInner, +) class ListTrackingSetting200Response: def __init__( - self, - result: Optional[List[ListTrackingSetting200ResponseResultInner]]=None + self, result: Optional[List[ListTrackingSetting200ResponseResultInner]] = None ): - self.result=result + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListTrackingSetting200Response( - result=payload.get('result') - ) - + return ListTrackingSetting200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/tracking_settings/v3/models/list_tracking_setting200_response_result_inner.py b/sendgrid/rest/api/tracking_settings/v3/models/list_tracking_setting200_response_result_inner.py index ae2ed181..a8d6d629 100644 --- a/sendgrid/rest/api/tracking_settings/v3/models/list_tracking_setting200_response_result_inner.py +++ b/sendgrid/rest/api/tracking_settings/v3/models/list_tracking_setting200_response_result_inner.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListTrackingSetting200ResponseResultInner: def __init__( - self, - name: Optional[str]=None, - title: Optional[str]=None, - description: Optional[str]=None, - enabled: Optional[bool]=None + self, + name: Optional[str] = None, + title: Optional[str] = None, + description: Optional[str] = None, + enabled: Optional[bool] = None, ): - self.name=name - self.title=title - self.description=description - self.enabled=enabled + self.name = name + self.title = title + self.description = description + self.enabled = enabled def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "name": self.name, - "title": self.title, - "description": self.description, - "enabled": self.enabled - }.items() if value is not None} + "name": self.name, + "title": self.title, + "description": self.description, + "enabled": self.enabled, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListTrackingSetting200ResponseResultInner( - name=payload.get('name'), - title=payload.get('title'), - description=payload.get('description'), - enabled=payload.get('enabled') - ) - + name=payload.get("name"), + title=payload.get("title"), + description=payload.get("description"), + enabled=payload.get("enabled"), + ) diff --git a/sendgrid/rest/api/tracking_settings/v3/models/subscription_tracking_settings.py b/sendgrid/rest/api/tracking_settings/v3/models/subscription_tracking_settings.py index 1d420385..a36e575c 100644 --- a/sendgrid/rest/api/tracking_settings/v3/models/subscription_tracking_settings.py +++ b/sendgrid/rest/api/tracking_settings/v3/models/subscription_tracking_settings.py @@ -1,37 +1,37 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class SubscriptionTrackingSettings: def __init__( - self, - enabled: Optional[bool]=None, - html_content: Optional[str]=None, - landing: Optional[str]=None, - plain_content: Optional[str]=None, - replace: Optional[str]=None, - url: Optional[str]=None + self, + enabled: Optional[bool] = None, + html_content: Optional[str] = None, + landing: Optional[str] = None, + plain_content: Optional[str] = None, + replace: Optional[str] = None, + url: Optional[str] = None, ): - self.enabled=enabled - self.html_content=html_content - self.landing=landing - self.plain_content=plain_content - self.replace=replace - self.url=url + self.enabled = enabled + self.html_content = html_content + self.landing = landing + self.plain_content = plain_content + self.replace = replace + self.url = url def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enabled": self.enabled, - "html_content": self.html_content, - "landing": self.landing, - "plain_content": self.plain_content, - "replace": self.replace, - "url": self.url - }.items() if value is not None} + "enabled": self.enabled, + "html_content": self.html_content, + "landing": self.landing, + "plain_content": self.plain_content, + "replace": self.replace, + "url": self.url, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -40,11 +40,10 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return SubscriptionTrackingSettings( - enabled=payload.get('enabled'), - html_content=payload.get('html_content'), - landing=payload.get('landing'), - plain_content=payload.get('plain_content'), - replace=payload.get('replace'), - url=payload.get('url') - ) - + enabled=payload.get("enabled"), + html_content=payload.get("html_content"), + landing=payload.get("landing"), + plain_content=payload.get("plain_content"), + replace=payload.get("replace"), + url=payload.get("url"), + ) diff --git a/sendgrid/rest/api/tracking_settings/v3/models/update_click_tracking_setting_request.py b/sendgrid/rest/api/tracking_settings/v3/models/update_click_tracking_setting_request.py index 90a4c4d3..98c0beb6 100644 --- a/sendgrid/rest/api/tracking_settings/v3/models/update_click_tracking_setting_request.py +++ b/sendgrid/rest/api/tracking_settings/v3/models/update_click_tracking_setting_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateClickTrackingSettingRequest: - def __init__( - self, - enabled: Optional[bool]=None - ): - self.enabled=enabled + def __init__(self, enabled: Optional[bool] = None): + self.enabled = enabled def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "enabled": self.enabled - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"enabled": self.enabled}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateClickTrackingSettingRequest( - enabled=payload.get('enabled') - ) - + return UpdateClickTrackingSettingRequest(enabled=payload.get("enabled")) diff --git a/sendgrid/rest/api/tracking_settings/v3/models/update_open_tracking_setting_request.py b/sendgrid/rest/api/tracking_settings/v3/models/update_open_tracking_setting_request.py index c338ed44..4ec8af7f 100644 --- a/sendgrid/rest/api/tracking_settings/v3/models/update_open_tracking_setting_request.py +++ b/sendgrid/rest/api/tracking_settings/v3/models/update_open_tracking_setting_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateOpenTrackingSettingRequest: - def __init__( - self, - enabled: Optional[bool]=None - ): - self.enabled=enabled + def __init__(self, enabled: Optional[bool] = None): + self.enabled = enabled def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "enabled": self.enabled - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"enabled": self.enabled}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateOpenTrackingSettingRequest( - enabled=payload.get('enabled') - ) - + return UpdateOpenTrackingSettingRequest(enabled=payload.get("enabled")) diff --git a/sendgrid/rest/api/tracking_settings/v3/update_click_tracking_setting.py b/sendgrid/rest/api/tracking_settings/v3/update_click_tracking_setting.py index 90090f9f..26ed03cf 100644 --- a/sendgrid/rest/api/tracking_settings/v3/update_click_tracking_setting.py +++ b/sendgrid/rest/api/tracking_settings/v3/update_click_tracking_setting.py @@ -12,55 +12,56 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.tracking_settings.v3.models.click_tracking import ClickTracking -from sendgrid.rest.api.tracking_settings.v3.models.update_click_tracking_setting_request import UpdateClickTrackingSettingRequest +from sendgrid.rest.api.tracking_settings.v3.models.update_click_tracking_setting_request import ( + UpdateClickTrackingSettingRequest, +) + class UpdateClickTrackingSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - update_click_tracking_setting_request: Optional[UpdateClickTrackingSettingRequest] = None, - + on_behalf_of: Optional[str] = None, + update_click_tracking_setting_request: Optional[ + UpdateClickTrackingSettingRequest + ] = None, ): - path='/v3/tracking_settings/click' + path = "/v3/tracking_settings/click" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_click_tracking_setting_request: data = update_click_tracking_setting_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/tracking_settings/v3/update_google_analytics_tracking_setting.py b/sendgrid/rest/api/tracking_settings/v3/update_google_analytics_tracking_setting.py index 1545edb3..5e388c43 100644 --- a/sendgrid/rest/api/tracking_settings/v3/update_google_analytics_tracking_setting.py +++ b/sendgrid/rest/api/tracking_settings/v3/update_google_analytics_tracking_setting.py @@ -12,54 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.tracking_settings.v3.models.google_analytics_settings import GoogleAnalyticsSettings +from sendgrid.rest.api.tracking_settings.v3.models.google_analytics_settings import ( + GoogleAnalyticsSettings, +) + class UpdateGoogleAnalyticsTrackingSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - google_analytics_settings: Optional[GoogleAnalyticsSettings] = None, - + on_behalf_of: Optional[str] = None, + google_analytics_settings: Optional[GoogleAnalyticsSettings] = None, ): - path='/v3/tracking_settings/google_analytics' + path = "/v3/tracking_settings/google_analytics" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if google_analytics_settings: data = google_analytics_settings.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/tracking_settings/v3/update_open_tracking_setting.py b/sendgrid/rest/api/tracking_settings/v3/update_open_tracking_setting.py index 99437b39..e6368758 100644 --- a/sendgrid/rest/api/tracking_settings/v3/update_open_tracking_setting.py +++ b/sendgrid/rest/api/tracking_settings/v3/update_open_tracking_setting.py @@ -12,55 +12,56 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.tracking_settings.v3.models.list_open_tracking_setting200_response import ListOpenTrackingSetting200Response -from sendgrid.rest.api.tracking_settings.v3.models.update_open_tracking_setting_request import UpdateOpenTrackingSettingRequest +from sendgrid.rest.api.tracking_settings.v3.models.update_open_tracking_setting_request import ( + UpdateOpenTrackingSettingRequest, +) + class UpdateOpenTrackingSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - update_open_tracking_setting_request: Optional[UpdateOpenTrackingSettingRequest] = None, - + on_behalf_of: Optional[str] = None, + update_open_tracking_setting_request: Optional[ + UpdateOpenTrackingSettingRequest + ] = None, ): - path='/v3/tracking_settings/open' + path = "/v3/tracking_settings/open" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_open_tracking_setting_request: data = update_open_tracking_setting_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/tracking_settings/v3/update_subscription_tracking_setting.py b/sendgrid/rest/api/tracking_settings/v3/update_subscription_tracking_setting.py index 78a61b58..03cbd72c 100644 --- a/sendgrid/rest/api/tracking_settings/v3/update_subscription_tracking_setting.py +++ b/sendgrid/rest/api/tracking_settings/v3/update_subscription_tracking_setting.py @@ -12,54 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.tracking_settings.v3.models.subscription_tracking_settings import SubscriptionTrackingSettings +from sendgrid.rest.api.tracking_settings.v3.models.subscription_tracking_settings import ( + SubscriptionTrackingSettings, +) + class UpdateSubscriptionTrackingSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - subscription_tracking_settings: Optional[SubscriptionTrackingSettings] = None, - + on_behalf_of: Optional[str] = None, + subscription_tracking_settings: Optional[SubscriptionTrackingSettings] = None, ): - path='/v3/tracking_settings/subscription' + path = "/v3/tracking_settings/subscription" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if subscription_tracking_settings: data = subscription_tracking_settings.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/user/v3/__init__.py b/sendgrid/rest/api/user/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/user/v3/__init__.py +++ b/sendgrid/rest/api/user/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/user/v3/list_account.py b/sendgrid/rest/api/user/v3/list_account.py index ccd89520..e20632f0 100644 --- a/sendgrid/rest/api/user/v3/list_account.py +++ b/sendgrid/rest/api/user/v3/list_account.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.user.v3.models.get_user_account_response import GETUserAccountResponse + class ListAccount: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/user/account' + path = "/v3/user/account" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/user/v3/list_credit.py b/sendgrid/rest/api/user/v3/list_credit.py index 5958d72f..681036ca 100644 --- a/sendgrid/rest/api/user/v3/list_credit.py +++ b/sendgrid/rest/api/user/v3/list_credit.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.user.v3.models.list_credit200_response import ListCredit200Response + class ListCredit: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/user/credits' + path = "/v3/user/credits" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/user/v3/list_email.py b/sendgrid/rest/api/user/v3/list_email.py index f50ba2c3..83789020 100644 --- a/sendgrid/rest/api/user/v3/list_email.py +++ b/sendgrid/rest/api/user/v3/list_email.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.user.v3.models.list_email200_response import ListEmail200Response + class ListEmail: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/user/email' + path = "/v3/user/email" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/user/v3/list_profile.py b/sendgrid/rest/api/user/v3/list_profile.py index ff75b85a..3aa6d92d 100644 --- a/sendgrid/rest/api/user/v3/list_profile.py +++ b/sendgrid/rest/api/user/v3/list_profile.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.user.v3.models.get_user_profile_response import GETUserProfileResponse + class ListProfile: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/user/profile' + path = "/v3/user/profile" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/user/v3/list_username.py b/sendgrid/rest/api/user/v3/list_username.py index 695204ca..68d9db83 100644 --- a/sendgrid/rest/api/user/v3/list_username.py +++ b/sendgrid/rest/api/user/v3/list_username.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.user.v3.models.list_username200_response import ListUsername200Response + class ListUsername: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/user/username' + path = "/v3/user/username" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/user/v3/models/__init__.py b/sendgrid/rest/api/user/v3/models/__init__.py index 22740859..5675a1cf 100644 --- a/sendgrid/rest/api/user/v3/models/__init__.py +++ b/sendgrid/rest/api/user/v3/models/__init__.py @@ -11,21 +11,54 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.user.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.user.v3.models.error_response_errors_inner import ErrorResponseErrorsInner -from sendgrid.rest.api.user.v3.models.get_user_account_response import GETUserAccountResponse -from sendgrid.rest.api.user.v3.models.get_user_profile_response import GETUserProfileResponse -from sendgrid.rest.api.user.v3.models.list_credit200_response import ListCredit200Response +from sendgrid.rest.api.user.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) +from sendgrid.rest.api.user.v3.models.get_user_account_response import ( + GETUserAccountResponse, +) +from sendgrid.rest.api.user.v3.models.get_user_profile_response import ( + GETUserProfileResponse, +) +from sendgrid.rest.api.user.v3.models.list_credit200_response import ( + ListCredit200Response, +) from sendgrid.rest.api.user.v3.models.list_email200_response import ListEmail200Response -from sendgrid.rest.api.user.v3.models.list_username200_response import ListUsername200Response +from sendgrid.rest.api.user.v3.models.list_username200_response import ( + ListUsername200Response, +) from sendgrid.rest.api.user.v3.models.type import Type -from sendgrid.rest.api.user.v3.models.update_email200_response import UpdateEmail200Response +from sendgrid.rest.api.user.v3.models.update_email200_response import ( + UpdateEmail200Response, +) from sendgrid.rest.api.user.v3.models.update_email_request import UpdateEmailRequest -from sendgrid.rest.api.user.v3.models.update_password_request import UpdatePasswordRequest -from sendgrid.rest.api.user.v3.models.update_username200_response import UpdateUsername200Response -from sendgrid.rest.api.user.v3.models.update_username_request import UpdateUsernameRequest +from sendgrid.rest.api.user.v3.models.update_password_request import ( + UpdatePasswordRequest, +) +from sendgrid.rest.api.user.v3.models.update_username200_response import ( + UpdateUsername200Response, +) +from sendgrid.rest.api.user.v3.models.update_username_request import ( + UpdateUsernameRequest, +) from sendgrid.rest.api.user.v3.models.user_profile import UserProfile -__all__ = [ 'ErrorResponse', 'ErrorResponseErrorsInner', 'GETUserAccountResponse', 'GETUserProfileResponse', 'ListCredit200Response', 'ListEmail200Response', 'ListUsername200Response', 'Type', 'UpdateEmail200Response', 'UpdateEmailRequest', 'UpdatePasswordRequest', 'UpdateUsername200Response', 'UpdateUsernameRequest', 'UserProfile' ] -# Testing code \ No newline at end of file + +__all__ = [ + "ErrorResponse", + "ErrorResponseErrorsInner", + "GETUserAccountResponse", + "GETUserProfileResponse", + "ListCredit200Response", + "ListEmail200Response", + "ListUsername200Response", + "Type", + "UpdateEmail200Response", + "UpdateEmailRequest", + "UpdatePasswordRequest", + "UpdateUsername200Response", + "UpdateUsernameRequest", + "UserProfile", +] +# Testing code diff --git a/sendgrid/rest/api/user/v3/models/error_response.py b/sendgrid/rest/api/user/v3/models/error_response.py index c8d6a5ef..ca0448da 100644 --- a/sendgrid/rest/api/user/v3/models/error_response.py +++ b/sendgrid/rest/api/user/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.user.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.user.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/user/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/user/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/user/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/user/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/user/v3/models/get_user_account_response.py b/sendgrid/rest/api/user/v3/models/get_user_account_response.py index 654f2420..91a7dee3 100644 --- a/sendgrid/rest/api/user/v3/models/get_user_account_response.py +++ b/sendgrid/rest/api/user/v3/models/get_user_account_response.py @@ -1,26 +1,19 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.user.v3.models.type import Type - class GETUserAccountResponse: - def __init__( - self, - type: Optional[Type]=None, - reputation: Optional[float]=None - ): - self.type=type - self.reputation=reputation + def __init__(self, type: Optional[Type] = None, reputation: Optional[float] = None): + self.type = type + self.reputation = reputation def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "type": self.type, - "reputation": self.reputation - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"type": self.type, "reputation": self.reputation}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +22,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GETUserAccountResponse( - type=payload.get('type'), - reputation=payload.get('reputation') - ) - + type=payload.get("type"), reputation=payload.get("reputation") + ) diff --git a/sendgrid/rest/api/user/v3/models/get_user_profile_response.py b/sendgrid/rest/api/user/v3/models/get_user_profile_response.py index 826208a0..ebd95ed7 100644 --- a/sendgrid/rest/api/user/v3/models/get_user_profile_response.py +++ b/sendgrid/rest/api/user/v3/models/get_user_profile_response.py @@ -1,52 +1,52 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GETUserProfileResponse: def __init__( - self, - address: Optional[str]=None, - address2: Optional[str]=None, - city: Optional[str]=None, - company: Optional[str]=None, - country: Optional[str]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - phone: Optional[str]=None, - state: Optional[str]=None, - website: Optional[str]=None, - zip: Optional[str]=None + self, + address: Optional[str] = None, + address2: Optional[str] = None, + city: Optional[str] = None, + company: Optional[str] = None, + country: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + phone: Optional[str] = None, + state: Optional[str] = None, + website: Optional[str] = None, + zip: Optional[str] = None, ): - self.address=address - self.address2=address2 - self.city=city - self.company=company - self.country=country - self.first_name=first_name - self.last_name=last_name - self.phone=phone - self.state=state - self.website=website - self.zip=zip + self.address = address + self.address2 = address2 + self.city = city + self.company = company + self.country = country + self.first_name = first_name + self.last_name = last_name + self.phone = phone + self.state = state + self.website = website + self.zip = zip def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "address": self.address, - "address2": self.address2, - "city": self.city, - "company": self.company, - "country": self.country, - "first_name": self.first_name, - "last_name": self.last_name, - "phone": self.phone, - "state": self.state, - "website": self.website, - "zip": self.zip - }.items() if value is not None} + "address": self.address, + "address2": self.address2, + "city": self.city, + "company": self.company, + "country": self.country, + "first_name": self.first_name, + "last_name": self.last_name, + "phone": self.phone, + "state": self.state, + "website": self.website, + "zip": self.zip, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -55,16 +55,15 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GETUserProfileResponse( - address=payload.get('address'), - address2=payload.get('address2'), - city=payload.get('city'), - company=payload.get('company'), - country=payload.get('country'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - phone=payload.get('phone'), - state=payload.get('state'), - website=payload.get('website'), - zip=payload.get('zip') - ) - + address=payload.get("address"), + address2=payload.get("address2"), + city=payload.get("city"), + company=payload.get("company"), + country=payload.get("country"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + phone=payload.get("phone"), + state=payload.get("state"), + website=payload.get("website"), + zip=payload.get("zip"), + ) diff --git a/sendgrid/rest/api/user/v3/models/list_credit200_response.py b/sendgrid/rest/api/user/v3/models/list_credit200_response.py index 538f3c59..447fcb90 100644 --- a/sendgrid/rest/api/user/v3/models/list_credit200_response.py +++ b/sendgrid/rest/api/user/v3/models/list_credit200_response.py @@ -1,40 +1,40 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListCredit200Response: def __init__( - self, - remain: Optional[int]=None, - total: Optional[int]=None, - overage: Optional[int]=None, - used: Optional[int]=None, - last_reset: Optional[str]=None, - next_reset: Optional[str]=None, - reset_frequency: Optional[str]=None + self, + remain: Optional[int] = None, + total: Optional[int] = None, + overage: Optional[int] = None, + used: Optional[int] = None, + last_reset: Optional[str] = None, + next_reset: Optional[str] = None, + reset_frequency: Optional[str] = None, ): - self.remain=remain - self.total=total - self.overage=overage - self.used=used - self.last_reset=last_reset - self.next_reset=next_reset - self.reset_frequency=reset_frequency + self.remain = remain + self.total = total + self.overage = overage + self.used = used + self.last_reset = last_reset + self.next_reset = next_reset + self.reset_frequency = reset_frequency def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "remain": self.remain, - "total": self.total, - "overage": self.overage, - "used": self.used, - "last_reset": self.last_reset, - "next_reset": self.next_reset, - "reset_frequency": self.reset_frequency - }.items() if value is not None} + "remain": self.remain, + "total": self.total, + "overage": self.overage, + "used": self.used, + "last_reset": self.last_reset, + "next_reset": self.next_reset, + "reset_frequency": self.reset_frequency, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -43,12 +43,11 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListCredit200Response( - remain=payload.get('remain'), - total=payload.get('total'), - overage=payload.get('overage'), - used=payload.get('used'), - last_reset=payload.get('last_reset'), - next_reset=payload.get('next_reset'), - reset_frequency=payload.get('reset_frequency') - ) - + remain=payload.get("remain"), + total=payload.get("total"), + overage=payload.get("overage"), + used=payload.get("used"), + last_reset=payload.get("last_reset"), + next_reset=payload.get("next_reset"), + reset_frequency=payload.get("reset_frequency"), + ) diff --git a/sendgrid/rest/api/user/v3/models/list_email200_response.py b/sendgrid/rest/api/user/v3/models/list_email200_response.py index 093ae963..35008600 100644 --- a/sendgrid/rest/api/user/v3/models/list_email200_response.py +++ b/sendgrid/rest/api/user/v3/models/list_email200_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListEmail200Response: - def __init__( - self, - email: Optional[str]=None - ): - self.email=email + def __init__(self, email: Optional[str] = None): + self.email = email def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListEmail200Response( - email=payload.get('email') - ) - + return ListEmail200Response(email=payload.get("email")) diff --git a/sendgrid/rest/api/user/v3/models/list_username200_response.py b/sendgrid/rest/api/user/v3/models/list_username200_response.py index 335f9a2c..ab5719c8 100644 --- a/sendgrid/rest/api/user/v3/models/list_username200_response.py +++ b/sendgrid/rest/api/user/v3/models/list_username200_response.py @@ -1,25 +1,21 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListUsername200Response: - def __init__( - self, - username: Optional[str]=None, - user_id: Optional[int]=None - ): - self.username=username - self.user_id=user_id + def __init__(self, username: Optional[str] = None, user_id: Optional[int] = None): + self.username = username + self.user_id = user_id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "username": self.username, - "user_id": self.user_id - }.items() if value is not None} + "username": self.username, + "user_id": self.user_id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +24,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListUsername200Response( - username=payload.get('username'), - user_id=payload.get('user_id') - ) - + username=payload.get("username"), user_id=payload.get("user_id") + ) diff --git a/sendgrid/rest/api/user/v3/models/type.py b/sendgrid/rest/api/user/v3/models/type.py index 265bd973..a0731f2d 100644 --- a/sendgrid/rest/api/user/v3/models/type.py +++ b/sendgrid/rest/api/user/v3/models/type.py @@ -1,11 +1,7 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class Type(Enum): - FREE='free' - PAID='paid' - + FREE = "free" + PAID = "paid" diff --git a/sendgrid/rest/api/user/v3/models/update_email200_response.py b/sendgrid/rest/api/user/v3/models/update_email200_response.py index 7708c48e..f51a20ef 100644 --- a/sendgrid/rest/api/user/v3/models/update_email200_response.py +++ b/sendgrid/rest/api/user/v3/models/update_email200_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateEmail200Response: - def __init__( - self, - email: Optional[str]=None - ): - self.email=email + def __init__(self, email: Optional[str] = None): + self.email = email def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateEmail200Response( - email=payload.get('email') - ) - + return UpdateEmail200Response(email=payload.get("email")) diff --git a/sendgrid/rest/api/user/v3/models/update_email_request.py b/sendgrid/rest/api/user/v3/models/update_email_request.py index 1cf006ab..9e5b7ca1 100644 --- a/sendgrid/rest/api/user/v3/models/update_email_request.py +++ b/sendgrid/rest/api/user/v3/models/update_email_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateEmailRequest: - def __init__( - self, - email: Optional[str]=None - ): - self.email=email + def __init__(self, email: Optional[str] = None): + self.email = email def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "email": self.email - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"email": self.email}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateEmailRequest( - email=payload.get('email') - ) - + return UpdateEmailRequest(email=payload.get("email")) diff --git a/sendgrid/rest/api/user/v3/models/update_password_request.py b/sendgrid/rest/api/user/v3/models/update_password_request.py index 5d9dd291..98b0e656 100644 --- a/sendgrid/rest/api/user/v3/models/update_password_request.py +++ b/sendgrid/rest/api/user/v3/models/update_password_request.py @@ -1,25 +1,23 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdatePasswordRequest: def __init__( - self, - new_password: Optional[str]=None, - old_password: Optional[str]=None + self, new_password: Optional[str] = None, old_password: Optional[str] = None ): - self.new_password=new_password - self.old_password=old_password + self.new_password = new_password + self.old_password = old_password def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "new_password": self.new_password, - "old_password": self.old_password - }.items() if value is not None} + "new_password": self.new_password, + "old_password": self.old_password, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +26,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UpdatePasswordRequest( - new_password=payload.get('new_password'), - old_password=payload.get('old_password') - ) - + new_password=payload.get("new_password"), + old_password=payload.get("old_password"), + ) diff --git a/sendgrid/rest/api/user/v3/models/update_username200_response.py b/sendgrid/rest/api/user/v3/models/update_username200_response.py index a5331a95..c33479c7 100644 --- a/sendgrid/rest/api/user/v3/models/update_username200_response.py +++ b/sendgrid/rest/api/user/v3/models/update_username200_response.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateUsername200Response: - def __init__( - self, - username: Optional[str]=None - ): - self.username=username + def __init__(self, username: Optional[str] = None): + self.username = username def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "username": self.username - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"username": self.username}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateUsername200Response( - username=payload.get('username') - ) - + return UpdateUsername200Response(username=payload.get("username")) diff --git a/sendgrid/rest/api/user/v3/models/update_username_request.py b/sendgrid/rest/api/user/v3/models/update_username_request.py index 1e43a182..fd780920 100644 --- a/sendgrid/rest/api/user/v3/models/update_username_request.py +++ b/sendgrid/rest/api/user/v3/models/update_username_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateUsernameRequest: - def __init__( - self, - username: Optional[str]=None - ): - self.username=username + def __init__(self, username: Optional[str] = None): + self.username = username def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "username": self.username - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"username": self.username}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateUsernameRequest( - username=payload.get('username') - ) - + return UpdateUsernameRequest(username=payload.get("username")) diff --git a/sendgrid/rest/api/user/v3/models/user_profile.py b/sendgrid/rest/api/user/v3/models/user_profile.py index 316fa7ff..487c550c 100644 --- a/sendgrid/rest/api/user/v3/models/user_profile.py +++ b/sendgrid/rest/api/user/v3/models/user_profile.py @@ -1,52 +1,52 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UserProfile: def __init__( - self, - address: Optional[str]=None, - address2: Optional[str]=None, - city: Optional[str]=None, - company: Optional[str]=None, - country: Optional[str]=None, - first_name: Optional[str]=None, - last_name: Optional[str]=None, - phone: Optional[str]=None, - state: Optional[str]=None, - website: Optional[str]=None, - zip: Optional[str]=None + self, + address: Optional[str] = None, + address2: Optional[str] = None, + city: Optional[str] = None, + company: Optional[str] = None, + country: Optional[str] = None, + first_name: Optional[str] = None, + last_name: Optional[str] = None, + phone: Optional[str] = None, + state: Optional[str] = None, + website: Optional[str] = None, + zip: Optional[str] = None, ): - self.address=address - self.address2=address2 - self.city=city - self.company=company - self.country=country - self.first_name=first_name - self.last_name=last_name - self.phone=phone - self.state=state - self.website=website - self.zip=zip + self.address = address + self.address2 = address2 + self.city = city + self.company = company + self.country = country + self.first_name = first_name + self.last_name = last_name + self.phone = phone + self.state = state + self.website = website + self.zip = zip def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "address": self.address, - "address2": self.address2, - "city": self.city, - "company": self.company, - "country": self.country, - "first_name": self.first_name, - "last_name": self.last_name, - "phone": self.phone, - "state": self.state, - "website": self.website, - "zip": self.zip - }.items() if value is not None} + "address": self.address, + "address2": self.address2, + "city": self.city, + "company": self.company, + "country": self.country, + "first_name": self.first_name, + "last_name": self.last_name, + "phone": self.phone, + "state": self.state, + "website": self.website, + "zip": self.zip, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -55,16 +55,15 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return UserProfile( - address=payload.get('address'), - address2=payload.get('address2'), - city=payload.get('city'), - company=payload.get('company'), - country=payload.get('country'), - first_name=payload.get('first_name'), - last_name=payload.get('last_name'), - phone=payload.get('phone'), - state=payload.get('state'), - website=payload.get('website'), - zip=payload.get('zip') - ) - + address=payload.get("address"), + address2=payload.get("address2"), + city=payload.get("city"), + company=payload.get("company"), + country=payload.get("country"), + first_name=payload.get("first_name"), + last_name=payload.get("last_name"), + phone=payload.get("phone"), + state=payload.get("state"), + website=payload.get("website"), + zip=payload.get("zip"), + ) diff --git a/sendgrid/rest/api/user/v3/update_email.py b/sendgrid/rest/api/user/v3/update_email.py index 5a6263cd..30fff87f 100644 --- a/sendgrid/rest/api/user/v3/update_email.py +++ b/sendgrid/rest/api/user/v3/update_email.py @@ -12,55 +12,52 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.user.v3.models.update_email200_response import UpdateEmail200Response from sendgrid.rest.api.user.v3.models.update_email_request import UpdateEmailRequest + class UpdateEmail: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - update_email_request: Optional[UpdateEmailRequest] = None, - + on_behalf_of: Optional[str] = None, + update_email_request: Optional[UpdateEmailRequest] = None, ): - path='/v3/user/email' + path = "/v3/user/email" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_email_request: data = update_email_request.to_dict() - request = Request( - method='PUT', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/user/v3/update_password.py b/sendgrid/rest/api/user/v3/update_password.py index 6e725899..0fa46bb8 100644 --- a/sendgrid/rest/api/user/v3/update_password.py +++ b/sendgrid/rest/api/user/v3/update_password.py @@ -12,54 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.user.v3.models.update_password_request import UpdatePasswordRequest +from sendgrid.rest.api.user.v3.models.update_password_request import ( + UpdatePasswordRequest, +) + class UpdatePassword: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - update_password_request: Optional[UpdatePasswordRequest] = None, - + on_behalf_of: Optional[str] = None, + update_password_request: Optional[UpdatePasswordRequest] = None, ): - path='/v3/user/password' + path = "/v3/user/password" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_password_request: data = update_password_request.to_dict() - request = Request( - method='PUT', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/user/v3/update_profile.py b/sendgrid/rest/api/user/v3/update_profile.py index c063a921..61b97846 100644 --- a/sendgrid/rest/api/user/v3/update_profile.py +++ b/sendgrid/rest/api/user/v3/update_profile.py @@ -12,54 +12,52 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.user.v3.models.user_profile import UserProfile + class UpdateProfile: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - user_profile: Optional[UserProfile] = None, - + on_behalf_of: Optional[str] = None, + user_profile: Optional[UserProfile] = None, ): - path='/v3/user/profile' + path = "/v3/user/profile" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if user_profile: data = user_profile.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/user/v3/update_username.py b/sendgrid/rest/api/user/v3/update_username.py index 74bf8846..4c7d589d 100644 --- a/sendgrid/rest/api/user/v3/update_username.py +++ b/sendgrid/rest/api/user/v3/update_username.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.user.v3.models.update_username200_response import UpdateUsername200Response -from sendgrid.rest.api.user.v3.models.update_username_request import UpdateUsernameRequest +from sendgrid.rest.api.user.v3.models.update_username_request import ( + UpdateUsernameRequest, +) + class UpdateUsername: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - update_username_request: Optional[UpdateUsernameRequest] = None, - + on_behalf_of: Optional[str] = None, + update_username_request: Optional[UpdateUsernameRequest] = None, ): - path='/v3/user/username' + path = "/v3/user/username" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_username_request: data = update_username_request.to_dict() - request = Request( - method='PUT', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PUT", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/verified_senders/v3/__init__.py b/sendgrid/rest/api/verified_senders/v3/__init__.py new file mode 100644 index 00000000..46409041 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/__init__.py @@ -0,0 +1 @@ +# TODO diff --git a/sendgrid/rest/api/verified_senders/v3/create_verified_sender.py b/sendgrid/rest/api/verified_senders/v3/create_verified_sender.py new file mode 100644 index 00000000..bb518ca4 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/create_verified_sender.py @@ -0,0 +1,57 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Verified Senders API + The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.verified_senders.v3.models.verified_sender_request import ( + VerifiedSenderRequest, +) + + +class CreateVerifiedSender: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + verified_sender_request: Optional[VerifiedSenderRequest] = None, + ): + path = "/v3/verified_senders" + + data = None + if verified_sender_request: + data = verified_sender_request.to_dict() + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/verified_senders/v3/delete_verified_sender.py b/sendgrid/rest/api/verified_senders/v3/delete_verified_sender.py new file mode 100644 index 00000000..0a63655a --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/delete_verified_sender.py @@ -0,0 +1,52 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Verified Senders API + The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + + +class DeleteVerifiedSender: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + ): + path = "/v3/verified_senders/{id}" + path = path.format( + id=id, + ) + + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/verified_senders/v3/list_verified_sender.py b/sendgrid/rest/api/verified_senders/v3/list_verified_sender.py new file mode 100644 index 00000000..2d794395 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/list_verified_sender.py @@ -0,0 +1,54 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Verified Senders API + The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional + + +class ListVerifiedSender: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + limit: Optional[float] = None, + last_seen_id: Optional[float] = None, + id: Optional[int] = None, + ): + path = "/v3/verified_senders" + + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/verified_senders/v3/list_verified_sender_domain.py b/sendgrid/rest/api/verified_senders/v3/list_verified_sender_domain.py new file mode 100644 index 00000000..55436ee4 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/list_verified_sender_domain.py @@ -0,0 +1,48 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Verified Senders API + The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + + +class ListVerifiedSenderDomain: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + ): + path = "/v3/verified_senders/domains" + + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/verified_senders/v3/list_verified_sender_steps_completed.py b/sendgrid/rest/api/verified_senders/v3/list_verified_sender_steps_completed.py new file mode 100644 index 00000000..80fcfcb5 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/list_verified_sender_steps_completed.py @@ -0,0 +1,48 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Verified Senders API + The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + + +class ListVerifiedSenderStepsCompleted: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + ): + path = "/v3/verified_senders/steps_completed" + + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/verified_senders/v3/models/__init__.py b/sendgrid/rest/api/verified_senders/v3/models/__init__.py new file mode 100644 index 00000000..a6c5265a --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/__init__.py @@ -0,0 +1,72 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Verified Senders API + The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +# import models into model package +from sendgrid.rest.api.verified_senders.v3.models.create_verified_sender400_response import ( + CreateVerifiedSender400Response, +) +from sendgrid.rest.api.verified_senders.v3.models.create_verified_sender400_response_errors_inner import ( + CreateVerifiedSender400ResponseErrorsInner, +) +from sendgrid.rest.api.verified_senders.v3.models.delete_verified_sender403_response import ( + DeleteVerifiedSender403Response, +) +from sendgrid.rest.api.verified_senders.v3.models.delete_verified_sender403_response_errors_inner import ( + DeleteVerifiedSender403ResponseErrorsInner, +) +from sendgrid.rest.api.verified_senders.v3.models.delete_verified_sender404_response import ( + DeleteVerifiedSender404Response, +) +from sendgrid.rest.api.verified_senders.v3.models.error_response import ErrorResponse +from sendgrid.rest.api.verified_senders.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) +from sendgrid.rest.api.verified_senders.v3.models.list_verified_sender200_response import ( + ListVerifiedSender200Response, +) +from sendgrid.rest.api.verified_senders.v3.models.list_verified_sender_domain200_response import ( + ListVerifiedSenderDomain200Response, +) +from sendgrid.rest.api.verified_senders.v3.models.list_verified_sender_domain200_response_results import ( + ListVerifiedSenderDomain200ResponseResults, +) +from sendgrid.rest.api.verified_senders.v3.models.list_verified_sender_steps_completed200_response import ( + ListVerifiedSenderStepsCompleted200Response, +) +from sendgrid.rest.api.verified_senders.v3.models.list_verified_sender_steps_completed200_response_results import ( + ListVerifiedSenderStepsCompleted200ResponseResults, +) +from sendgrid.rest.api.verified_senders.v3.models.verified_sender_request import ( + VerifiedSenderRequest, +) +from sendgrid.rest.api.verified_senders.v3.models.verified_sender_response import ( + VerifiedSenderResponse, +) + +__all__ = [ + "CreateVerifiedSender400Response", + "CreateVerifiedSender400ResponseErrorsInner", + "DeleteVerifiedSender403Response", + "DeleteVerifiedSender403ResponseErrorsInner", + "DeleteVerifiedSender404Response", + "ErrorResponse", + "ErrorResponseErrorsInner", + "ListVerifiedSender200Response", + "ListVerifiedSenderDomain200Response", + "ListVerifiedSenderDomain200ResponseResults", + "ListVerifiedSenderStepsCompleted200Response", + "ListVerifiedSenderStepsCompleted200ResponseResults", + "VerifiedSenderRequest", + "VerifiedSenderResponse", +] +# Testing code diff --git a/sendgrid/rest/api/verified_senders/v3/models/create_verified_sender400_response.py b/sendgrid/rest/api/verified_senders/v3/models/create_verified_sender400_response.py new file mode 100644 index 00000000..f8a977c1 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/create_verified_sender400_response.py @@ -0,0 +1,27 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.verified_senders.v3.models.create_verified_sender400_response_errors_inner import ( + CreateVerifiedSender400ResponseErrorsInner, +) + + +class CreateVerifiedSender400Response: + def __init__( + self, errors: Optional[List[CreateVerifiedSender400ResponseErrorsInner]] = None + ): + self.errors = errors + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return CreateVerifiedSender400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/verified_senders/v3/models/create_verified_sender400_response_errors_inner.py b/sendgrid/rest/api/verified_senders/v3/models/create_verified_sender400_response_errors_inner.py new file mode 100644 index 00000000..6b8c57b5 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/create_verified_sender400_response_errors_inner.py @@ -0,0 +1,37 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class CreateVerifiedSender400ResponseErrorsInner: + def __init__( + self, + field: Optional[str] = None, + message: Optional[str] = None, + error_id: Optional[str] = None, + ): + self.field = field + self.message = message + self.error_id = error_id + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "field": self.field, + "message": self.message, + "error_id": self.error_id, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return CreateVerifiedSender400ResponseErrorsInner( + field=payload.get("field"), + message=payload.get("message"), + error_id=payload.get("error_id"), + ) diff --git a/sendgrid/rest/api/verified_senders/v3/models/delete_verified_sender403_response.py b/sendgrid/rest/api/verified_senders/v3/models/delete_verified_sender403_response.py new file mode 100644 index 00000000..154740ab --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/delete_verified_sender403_response.py @@ -0,0 +1,27 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.verified_senders.v3.models.delete_verified_sender403_response_errors_inner import ( + DeleteVerifiedSender403ResponseErrorsInner, +) + + +class DeleteVerifiedSender403Response: + def __init__( + self, errors: Optional[List[DeleteVerifiedSender403ResponseErrorsInner]] = None + ): + self.errors = errors + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return DeleteVerifiedSender403Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/verified_senders/v3/models/delete_verified_sender403_response_errors_inner.py b/sendgrid/rest/api/verified_senders/v3/models/delete_verified_sender403_response_errors_inner.py new file mode 100644 index 00000000..08ee53c2 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/delete_verified_sender403_response_errors_inner.py @@ -0,0 +1,28 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class DeleteVerifiedSender403ResponseErrorsInner: + def __init__(self, message: Optional[str] = None, error_id: Optional[str] = None): + self.message = message + self.error_id = error_id + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "message": self.message, + "error_id": self.error_id, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return DeleteVerifiedSender403ResponseErrorsInner( + message=payload.get("message"), error_id=payload.get("error_id") + ) diff --git a/sendgrid/rest/api/verified_senders/v3/models/delete_verified_sender404_response.py b/sendgrid/rest/api/verified_senders/v3/models/delete_verified_sender404_response.py new file mode 100644 index 00000000..9e917466 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/delete_verified_sender404_response.py @@ -0,0 +1,27 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.verified_senders.v3.models.delete_verified_sender403_response_errors_inner import ( + DeleteVerifiedSender403ResponseErrorsInner, +) + + +class DeleteVerifiedSender404Response: + def __init__( + self, errors: Optional[List[DeleteVerifiedSender403ResponseErrorsInner]] = None + ): + self.errors = errors + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return DeleteVerifiedSender404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/verified_senders/v3/models/error_response.py b/sendgrid/rest/api/verified_senders/v3/models/error_response.py new file mode 100644 index 00000000..56434e65 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/error_response.py @@ -0,0 +1,30 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.verified_senders.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) + + +class ErrorResponse: + def __init__( + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, + ): + self.errors = errors + self.id = id + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/verified_senders/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/verified_senders/v3/models/error_response_errors_inner.py new file mode 100644 index 00000000..4cbf78ef --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/error_response_errors_inner.py @@ -0,0 +1,37 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class ErrorResponseErrorsInner: + def __init__( + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, + ): + self.message = message + self.field = field + self.help = help + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ErrorResponseErrorsInner( + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender200_response.py b/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender200_response.py new file mode 100644 index 00000000..e369690b --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender200_response.py @@ -0,0 +1,25 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.verified_senders.v3.models.verified_sender_response import ( + VerifiedSenderResponse, +) + + +class ListVerifiedSender200Response: + def __init__(self, results: Optional[List[VerifiedSenderResponse]] = None): + self.results = results + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"results": self.results}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListVerifiedSender200Response(results=payload.get("results")) diff --git a/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_domain200_response.py b/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_domain200_response.py new file mode 100644 index 00000000..ffea4bf1 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_domain200_response.py @@ -0,0 +1,27 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.verified_senders.v3.models.list_verified_sender_domain200_response_results import ( + ListVerifiedSenderDomain200ResponseResults, +) + + +class ListVerifiedSenderDomain200Response: + def __init__( + self, results: Optional[ListVerifiedSenderDomain200ResponseResults] = None + ): + self.results = results + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"results": self.results}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListVerifiedSenderDomain200Response(results=payload.get("results")) diff --git a/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_domain200_response_results.py b/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_domain200_response_results.py new file mode 100644 index 00000000..cfdf2fe1 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_domain200_response_results.py @@ -0,0 +1,33 @@ +from typing import Optional, Dict, List +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class ListVerifiedSenderDomain200ResponseResults: + def __init__( + self, + soft_failures: Optional[List[str]] = None, + hard_failures: Optional[List[str]] = None, + ): + self.soft_failures = soft_failures + self.hard_failures = hard_failures + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "soft_failures": self.soft_failures, + "hard_failures": self.hard_failures, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListVerifiedSenderDomain200ResponseResults( + soft_failures=payload.get("soft_failures"), + hard_failures=payload.get("hard_failures"), + ) diff --git a/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_steps_completed200_response.py b/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_steps_completed200_response.py new file mode 100644 index 00000000..4f5370dd --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_steps_completed200_response.py @@ -0,0 +1,30 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable +from sendgrid.rest.api.verified_senders.v3.models.list_verified_sender_steps_completed200_response_results import ( + ListVerifiedSenderStepsCompleted200ResponseResults, +) + + +class ListVerifiedSenderStepsCompleted200Response: + def __init__( + self, + results: Optional[ListVerifiedSenderStepsCompleted200ResponseResults] = None, + ): + self.results = results + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in {"results": self.results}.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListVerifiedSenderStepsCompleted200Response( + results=payload.get("results") + ) diff --git a/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_steps_completed200_response_results.py b/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_steps_completed200_response_results.py new file mode 100644 index 00000000..8a00b969 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/list_verified_sender_steps_completed200_response_results.py @@ -0,0 +1,33 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class ListVerifiedSenderStepsCompleted200ResponseResults: + def __init__( + self, + sender_verified: Optional[bool] = None, + domain_verified: Optional[bool] = None, + ): + self.sender_verified = sender_verified + self.domain_verified = domain_verified + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "sender_verified": self.sender_verified, + "domain_verified": self.domain_verified, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return ListVerifiedSenderStepsCompleted200ResponseResults( + sender_verified=payload.get("sender_verified"), + domain_verified=payload.get("domain_verified"), + ) diff --git a/sendgrid/rest/api/verified_senders/v3/models/verified_sender_request.py b/sendgrid/rest/api/verified_senders/v3/models/verified_sender_request.py new file mode 100644 index 00000000..5244308a --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/verified_sender_request.py @@ -0,0 +1,69 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class VerifiedSenderRequest: + def __init__( + self, + nickname: Optional[str] = None, + from_email: Optional[str] = None, + from_name: Optional[str] = None, + reply_to: Optional[str] = None, + reply_to_name: Optional[str] = None, + address: Optional[str] = None, + address2: Optional[str] = None, + state: Optional[str] = None, + city: Optional[str] = None, + zip: Optional[str] = None, + country: Optional[str] = None, + ): + self.nickname = nickname + self.from_email = from_email + self.from_name = from_name + self.reply_to = reply_to + self.reply_to_name = reply_to_name + self.address = address + self.address2 = address2 + self.state = state + self.city = city + self.zip = zip + self.country = country + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "nickname": self.nickname, + "from_email": self.from_email, + "from_name": self.from_name, + "reply_to": self.reply_to, + "reply_to_name": self.reply_to_name, + "address": self.address, + "address2": self.address2, + "state": self.state, + "city": self.city, + "zip": self.zip, + "country": self.country, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return VerifiedSenderRequest( + nickname=payload.get("nickname"), + from_email=payload.get("from_email"), + from_name=payload.get("from_name"), + reply_to=payload.get("reply_to"), + reply_to_name=payload.get("reply_to_name"), + address=payload.get("address"), + address2=payload.get("address2"), + state=payload.get("state"), + city=payload.get("city"), + zip=payload.get("zip"), + country=payload.get("country"), + ) diff --git a/sendgrid/rest/api/verified_senders/v3/models/verified_sender_response.py b/sendgrid/rest/api/verified_senders/v3/models/verified_sender_response.py new file mode 100644 index 00000000..c6fc8a07 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/models/verified_sender_response.py @@ -0,0 +1,81 @@ +from typing import Optional, Dict +from sendgrid.converters.serialize import to_serializable, from_serializable + + +class VerifiedSenderResponse: + def __init__( + self, + id: Optional[int] = None, + nickname: Optional[str] = None, + from_email: Optional[str] = None, + from_name: Optional[str] = None, + reply_to: Optional[str] = None, + reply_to_name: Optional[str] = None, + address: Optional[str] = None, + address2: Optional[str] = None, + state: Optional[str] = None, + city: Optional[str] = None, + zip: Optional[str] = None, + country: Optional[str] = None, + verified: Optional[bool] = None, + locked: Optional[bool] = None, + ): + self.id = id + self.nickname = nickname + self.from_email = from_email + self.from_name = from_name + self.reply_to = reply_to + self.reply_to_name = reply_to_name + self.address = address + self.address2 = address2 + self.state = state + self.city = city + self.zip = zip + self.country = country + self.verified = verified + self.locked = locked + + def to_dict(self): + return { + key: to_serializable(value) + for key, value in { + "id": self.id, + "nickname": self.nickname, + "from_email": self.from_email, + "from_name": self.from_name, + "reply_to": self.reply_to, + "reply_to_name": self.reply_to_name, + "address": self.address, + "address2": self.address2, + "state": self.state, + "city": self.city, + "zip": self.zip, + "country": self.country, + "verified": self.verified, + "locked": self.locked, + }.items() + if value is not None + } + + @classmethod + def from_dict(cls, data): + return from_serializable(data, cls) + + @staticmethod + def generate_model(payload: Dict[str, object]): + return VerifiedSenderResponse( + id=payload.get("id"), + nickname=payload.get("nickname"), + from_email=payload.get("from_email"), + from_name=payload.get("from_name"), + reply_to=payload.get("reply_to"), + reply_to_name=payload.get("reply_to_name"), + address=payload.get("address"), + address2=payload.get("address2"), + state=payload.get("state"), + city=payload.get("city"), + zip=payload.get("zip"), + country=payload.get("country"), + verified=payload.get("verified"), + locked=payload.get("locked"), + ) diff --git a/sendgrid/rest/api/verified_senders/v3/resend_verified_sender.py b/sendgrid/rest/api/verified_senders/v3/resend_verified_sender.py new file mode 100644 index 00000000..7a24b882 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/resend_verified_sender.py @@ -0,0 +1,52 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Verified Senders API + The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + + +class ResendVerifiedSender: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + ): + path = "/v3/verified_senders/resend/{id}" + path = path.format( + id=id, + ) + + data = None + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/verified_senders/v3/update_verified_sender.py b/sendgrid/rest/api/verified_senders/v3/update_verified_sender.py new file mode 100644 index 00000000..bea03a41 --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/update_verified_sender.py @@ -0,0 +1,61 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Verified Senders API + The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from typing import Optional +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + +from typing import Optional +from sendgrid.rest.api.verified_senders.v3.models.verified_sender_request import ( + VerifiedSenderRequest, +) + + +class UpdateVerifiedSender: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + id: str, + verified_sender_request: Optional[VerifiedSenderRequest] = None, + ): + path = "/v3/verified_senders/{id}" + path = path.format( + id=id, + ) + + data = None + if verified_sender_request: + data = verified_sender_request.to_dict() + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/verified_senders/v3/verify_sender_token.py b/sendgrid/rest/api/verified_senders/v3/verify_sender_token.py new file mode 100644 index 00000000..20bac7ce --- /dev/null +++ b/sendgrid/rest/api/verified_senders/v3/verify_sender_token.py @@ -0,0 +1,52 @@ +""" + This code was generated by + + SENDGRID-OAI-GENERATOR + + Twilio SendGrid Verified Senders API + The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +import json +from sendgrid.exceptions import ApiException +from sendgrid.http.request import Request +from sendgrid.http.response import ApiResponse + + +class VerifySenderToken: + def __init__(self, client) -> None: + self.client = client + + def send( + self, + token: str, + ): + path = "/v3/verified_senders/verify/{token}" + path = path.format( + token=token, + ) + + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) + if response is None: + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) + + if response.text: + text = json.loads(response.text) + else: + text = "" + if response.is_success(): + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) + else: + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/__init__.py b/sendgrid/rest/api/webhooks/v3/__init__.py index f87f5c14..46409041 100644 --- a/sendgrid/rest/api/webhooks/v3/__init__.py +++ b/sendgrid/rest/api/webhooks/v3/__init__.py @@ -1 +1 @@ -# TODO \ No newline at end of file +# TODO diff --git a/sendgrid/rest/api/webhooks/v3/create_event_webhook.py b/sendgrid/rest/api/webhooks/v3/create_event_webhook.py index 9aacac7e..379af7cb 100644 --- a/sendgrid/rest/api/webhooks/v3/create_event_webhook.py +++ b/sendgrid/rest/api/webhooks/v3/create_event_webhook.py @@ -12,55 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.webhooks.v3.models.event_webhook_request import EventWebhookRequest -from sendgrid.rest.api.webhooks.v3.models.event_webhook_unsigned_response import EventWebhookUnsignedResponse +from sendgrid.rest.api.webhooks.v3.models.event_webhook_request import ( + EventWebhookRequest, +) + class CreateEventWebhook: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - event_webhook_request: Optional[EventWebhookRequest] = None, - + on_behalf_of: Optional[str] = None, + event_webhook_request: Optional[EventWebhookRequest] = None, ): - path='/v3/user/webhooks/event/settings' + path = "/v3/user/webhooks/event/settings" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if event_webhook_request: data = event_webhook_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/create_parse_setting.py b/sendgrid/rest/api/webhooks/v3/create_parse_setting.py index 2b2baa57..329ddd89 100644 --- a/sendgrid/rest/api/webhooks/v3/create_parse_setting.py +++ b/sendgrid/rest/api/webhooks/v3/create_parse_setting.py @@ -12,54 +12,52 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.webhooks.v3.models.parse_setting import ParseSetting + class CreateParseSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - parse_setting: Optional[ParseSetting] = None, - + on_behalf_of: Optional[str] = None, + parse_setting: Optional[ParseSetting] = None, ): - path='/v3/user/webhooks/parse/settings' + path = "/v3/user/webhooks/parse/settings" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if parse_setting: data = parse_setting.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/delete_event_webhook.py b/sendgrid/rest/api/webhooks/v3/delete_event_webhook.py index b99d1b7d..30b046ba 100644 --- a/sendgrid/rest/api/webhooks/v3/delete_event_webhook.py +++ b/sendgrid/rest/api/webhooks/v3/delete_event_webhook.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteEventWebhook: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - on_behalf_of: Optional[str] = None, - + id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/user/webhooks/event/settings/{id}' + path = "/v3/user/webhooks/event/settings/{id}" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/delete_parse_setting.py b/sendgrid/rest/api/webhooks/v3/delete_parse_setting.py index b6d4d5b2..cc46aea8 100644 --- a/sendgrid/rest/api/webhooks/v3/delete_parse_setting.py +++ b/sendgrid/rest/api/webhooks/v3/delete_parse_setting.py @@ -12,53 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated + class DeleteParseSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - hostname: str, - on_behalf_of: Optional[str] = None, - + hostname: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/user/webhooks/parse/settings/{hostname}' + path = "/v3/user/webhooks/parse/settings/{hostname}" path = path.format( - hostname=hostname, + hostname=hostname, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='DELETE', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="DELETE", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/get_event_webhook.py b/sendgrid/rest/api/webhooks/v3/get_event_webhook.py index 2f31ab89..7983dc13 100644 --- a/sendgrid/rest/api/webhooks/v3/get_event_webhook.py +++ b/sendgrid/rest/api/webhooks/v3/get_event_webhook.py @@ -12,55 +12,52 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.webhooks.v3.models.event_webhook_no_dates_response import EventWebhookNoDatesResponse + class GetEventWebhook: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - on_behalf_of: Optional[str] = None, - include: Optional[str] = None, - + id: str, + on_behalf_of: Optional[str] = None, + include: Optional[str] = None, ): - path='/v3/user/webhooks/event/settings/{id}' + path = "/v3/user/webhooks/event/settings/{id}" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/get_parse_setting.py b/sendgrid/rest/api/webhooks/v3/get_parse_setting.py index 8482f9c8..683a04b3 100644 --- a/sendgrid/rest/api/webhooks/v3/get_parse_setting.py +++ b/sendgrid/rest/api/webhooks/v3/get_parse_setting.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.webhooks.v3.models.parse_setting import ParseSetting + class GetParseSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - hostname: str, - on_behalf_of: Optional[str] = None, - + hostname: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/user/webhooks/parse/settings/{hostname}' + path = "/v3/user/webhooks/parse/settings/{hostname}" path = path.format( - hostname=hostname, + hostname=hostname, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/get_signed_event_webhook.py b/sendgrid/rest/api/webhooks/v3/get_signed_event_webhook.py index 046c0ae1..48b11131 100644 --- a/sendgrid/rest/api/webhooks/v3/get_signed_event_webhook.py +++ b/sendgrid/rest/api/webhooks/v3/get_signed_event_webhook.py @@ -12,54 +12,51 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.webhooks.v3.models.get_signed_event_webhook200_response import GetSignedEventWebhook200Response + class GetSignedEventWebhook: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - on_behalf_of: Optional[str] = None, - + id: str, + on_behalf_of: Optional[str] = None, ): - path='/v3/user/webhooks/event/settings/signed/{id}' + path = "/v3/user/webhooks/event/settings/signed/{id}" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/list_event_webhook.py b/sendgrid/rest/api/webhooks/v3/list_event_webhook.py index 06c96760..dca9a1ce 100644 --- a/sendgrid/rest/api/webhooks/v3/list_event_webhook.py +++ b/sendgrid/rest/api/webhooks/v3/list_event_webhook.py @@ -12,51 +12,48 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.webhooks.v3.models.event_webhook_all_response import EventWebhookAllResponse + class ListEventWebhook: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - include: Optional[str] = None, - + on_behalf_of: Optional[str] = None, + include: Optional[str] = None, ): - path='/v3/user/webhooks/event/settings/all' + path = "/v3/user/webhooks/event/settings/all" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/list_parse_setting.py b/sendgrid/rest/api/webhooks/v3/list_parse_setting.py index f807fb4f..d6b94e47 100644 --- a/sendgrid/rest/api/webhooks/v3/list_parse_setting.py +++ b/sendgrid/rest/api/webhooks/v3/list_parse_setting.py @@ -12,50 +12,47 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.webhooks.v3.models.list_parse_setting200_response import ListParseSetting200Response + class ListParseSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - + on_behalf_of: Optional[str] = None, ): - path='/v3/user/webhooks/parse/settings' + path = "/v3/user/webhooks/parse/settings" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/list_parse_static.py b/sendgrid/rest/api/webhooks/v3/list_parse_static.py index 2f5d4149..b26a2380 100644 --- a/sendgrid/rest/api/webhooks/v3/list_parse_static.py +++ b/sendgrid/rest/api/webhooks/v3/list_parse_static.py @@ -12,56 +12,53 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.webhooks.v3.models.aggregated_by import AggregatedBy -from sendgrid.rest.api.webhooks.v3.models.list_parse_static200_response_inner import ListParseStatic200ResponseInner + class ListParseStatic: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - limit: Optional[str] = None, - offset: Optional[str] = None, - aggregated_by: Optional[AggregatedBy] = None, - start_date: Optional[str] = None, - end_date: Optional[str] = None, - + on_behalf_of: Optional[str] = None, + limit: Optional[str] = None, + offset: Optional[str] = None, + aggregated_by: Optional[AggregatedBy] = None, + start_date: Optional[str] = None, + end_date: Optional[str] = None, ): - path='/v3/user/webhooks/parse/stats' + path = "/v3/user/webhooks/parse/stats" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) - data = None - request = Request( - method='GET', - url=path, - data=data, - headers=headers + { + "on-behalf-of": on_behalf_of, + } ) - response=self.client.send(request) + data = None + request = Request(method="GET", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/__init__.py b/sendgrid/rest/api/webhooks/v3/models/__init__.py index 2acf8c18..1202452a 100644 --- a/sendgrid/rest/api/webhooks/v3/models/__init__.py +++ b/sendgrid/rest/api/webhooks/v3/models/__init__.py @@ -11,31 +11,98 @@ Do not edit the class manually. """ - # import models into model package from sendgrid.rest.api.webhooks.v3.models.aggregated_by import AggregatedBy -from sendgrid.rest.api.webhooks.v3.models.create_event_webhook400_response import CreateEventWebhook400Response -from sendgrid.rest.api.webhooks.v3.models.create_event_webhook400_response_errors_inner import CreateEventWebhook400ResponseErrorsInner +from sendgrid.rest.api.webhooks.v3.models.create_event_webhook400_response import ( + CreateEventWebhook400Response, +) +from sendgrid.rest.api.webhooks.v3.models.create_event_webhook400_response_errors_inner import ( + CreateEventWebhook400ResponseErrorsInner, +) from sendgrid.rest.api.webhooks.v3.models.error_response import ErrorResponse -from sendgrid.rest.api.webhooks.v3.models.error_response_errors_inner import ErrorResponseErrorsInner -from sendgrid.rest.api.webhooks.v3.models.event_webhook_all_response import EventWebhookAllResponse -from sendgrid.rest.api.webhooks.v3.models.event_webhook_base_response_props import EventWebhookBaseResponseProps -from sendgrid.rest.api.webhooks.v3.models.event_webhook_date_response_props import EventWebhookDateResponseProps -from sendgrid.rest.api.webhooks.v3.models.event_webhook_no_dates_response import EventWebhookNoDatesResponse -from sendgrid.rest.api.webhooks.v3.models.event_webhook_oauth_response_props import EventWebhookOauthResponseProps -from sendgrid.rest.api.webhooks.v3.models.event_webhook_request import EventWebhookRequest -from sendgrid.rest.api.webhooks.v3.models.event_webhook_signed_response import EventWebhookSignedResponse -from sendgrid.rest.api.webhooks.v3.models.event_webhook_signed_response_prop import EventWebhookSignedResponseProp -from sendgrid.rest.api.webhooks.v3.models.event_webhook_test_request import EventWebhookTestRequest -from sendgrid.rest.api.webhooks.v3.models.event_webhook_unsigned_response import EventWebhookUnsignedResponse -from sendgrid.rest.api.webhooks.v3.models.get_signed_event_webhook200_response import GetSignedEventWebhook200Response -from sendgrid.rest.api.webhooks.v3.models.get_signed_event_webhook404_response import GetSignedEventWebhook404Response -from sendgrid.rest.api.webhooks.v3.models.get_signed_event_webhook404_response_errors_inner import GetSignedEventWebhook404ResponseErrorsInner -from sendgrid.rest.api.webhooks.v3.models.list_parse_setting200_response import ListParseSetting200Response -from sendgrid.rest.api.webhooks.v3.models.list_parse_static200_response_inner import ListParseStatic200ResponseInner -from sendgrid.rest.api.webhooks.v3.models.list_parse_static200_response_inner_stats_inner import ListParseStatic200ResponseInnerStatsInner -from sendgrid.rest.api.webhooks.v3.models.list_parse_static200_response_inner_stats_inner_metrics import ListParseStatic200ResponseInnerStatsInnerMetrics +from sendgrid.rest.api.webhooks.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) +from sendgrid.rest.api.webhooks.v3.models.event_webhook_all_response import ( + EventWebhookAllResponse, +) +from sendgrid.rest.api.webhooks.v3.models.event_webhook_base_response_props import ( + EventWebhookBaseResponseProps, +) +from sendgrid.rest.api.webhooks.v3.models.event_webhook_date_response_props import ( + EventWebhookDateResponseProps, +) +from sendgrid.rest.api.webhooks.v3.models.event_webhook_no_dates_response import ( + EventWebhookNoDatesResponse, +) +from sendgrid.rest.api.webhooks.v3.models.event_webhook_oauth_response_props import ( + EventWebhookOauthResponseProps, +) +from sendgrid.rest.api.webhooks.v3.models.event_webhook_request import ( + EventWebhookRequest, +) +from sendgrid.rest.api.webhooks.v3.models.event_webhook_signed_response import ( + EventWebhookSignedResponse, +) +from sendgrid.rest.api.webhooks.v3.models.event_webhook_signed_response_prop import ( + EventWebhookSignedResponseProp, +) +from sendgrid.rest.api.webhooks.v3.models.event_webhook_test_request import ( + EventWebhookTestRequest, +) +from sendgrid.rest.api.webhooks.v3.models.event_webhook_unsigned_response import ( + EventWebhookUnsignedResponse, +) +from sendgrid.rest.api.webhooks.v3.models.get_signed_event_webhook200_response import ( + GetSignedEventWebhook200Response, +) +from sendgrid.rest.api.webhooks.v3.models.get_signed_event_webhook404_response import ( + GetSignedEventWebhook404Response, +) +from sendgrid.rest.api.webhooks.v3.models.get_signed_event_webhook404_response_errors_inner import ( + GetSignedEventWebhook404ResponseErrorsInner, +) +from sendgrid.rest.api.webhooks.v3.models.list_parse_setting200_response import ( + ListParseSetting200Response, +) +from sendgrid.rest.api.webhooks.v3.models.list_parse_static200_response_inner import ( + ListParseStatic200ResponseInner, +) +from sendgrid.rest.api.webhooks.v3.models.list_parse_static200_response_inner_stats_inner import ( + ListParseStatic200ResponseInnerStatsInner, +) +from sendgrid.rest.api.webhooks.v3.models.list_parse_static200_response_inner_stats_inner_metrics import ( + ListParseStatic200ResponseInnerStatsInnerMetrics, +) from sendgrid.rest.api.webhooks.v3.models.parse_setting import ParseSetting -from sendgrid.rest.api.webhooks.v3.models.update_signed_event_webhook_request import UpdateSignedEventWebhookRequest -__all__ = [ 'AggregatedBy', 'CreateEventWebhook400Response', 'CreateEventWebhook400ResponseErrorsInner', 'ErrorResponse', 'ErrorResponseErrorsInner', 'EventWebhookAllResponse', 'EventWebhookBaseResponseProps', 'EventWebhookDateResponseProps', 'EventWebhookNoDatesResponse', 'EventWebhookOauthResponseProps', 'EventWebhookRequest', 'EventWebhookSignedResponse', 'EventWebhookSignedResponseProp', 'EventWebhookTestRequest', 'EventWebhookUnsignedResponse', 'GetSignedEventWebhook200Response', 'GetSignedEventWebhook404Response', 'GetSignedEventWebhook404ResponseErrorsInner', 'ListParseSetting200Response', 'ListParseStatic200ResponseInner', 'ListParseStatic200ResponseInnerStatsInner', 'ListParseStatic200ResponseInnerStatsInnerMetrics', 'ParseSetting', 'UpdateSignedEventWebhookRequest' ] -# Testing code \ No newline at end of file +from sendgrid.rest.api.webhooks.v3.models.update_signed_event_webhook_request import ( + UpdateSignedEventWebhookRequest, +) + +__all__ = [ + "AggregatedBy", + "CreateEventWebhook400Response", + "CreateEventWebhook400ResponseErrorsInner", + "ErrorResponse", + "ErrorResponseErrorsInner", + "EventWebhookAllResponse", + "EventWebhookBaseResponseProps", + "EventWebhookDateResponseProps", + "EventWebhookNoDatesResponse", + "EventWebhookOauthResponseProps", + "EventWebhookRequest", + "EventWebhookSignedResponse", + "EventWebhookSignedResponseProp", + "EventWebhookTestRequest", + "EventWebhookUnsignedResponse", + "GetSignedEventWebhook200Response", + "GetSignedEventWebhook404Response", + "GetSignedEventWebhook404ResponseErrorsInner", + "ListParseSetting200Response", + "ListParseStatic200ResponseInner", + "ListParseStatic200ResponseInnerStatsInner", + "ListParseStatic200ResponseInnerStatsInnerMetrics", + "ParseSetting", + "UpdateSignedEventWebhookRequest", +] +# Testing code diff --git a/sendgrid/rest/api/webhooks/v3/models/aggregated_by.py b/sendgrid/rest/api/webhooks/v3/models/aggregated_by.py index 03766c63..8139656a 100644 --- a/sendgrid/rest/api/webhooks/v3/models/aggregated_by.py +++ b/sendgrid/rest/api/webhooks/v3/models/aggregated_by.py @@ -1,12 +1,8 @@ from enum import Enum -from typing import Optional, Dict, List -from sendgrid.converters.serialize import to_serializable, from_serializable from enum import Enum - class AggregatedBy(Enum): - DAY='day' - WEEK='week' - MONTH='month' - + DAY = "day" + WEEK = "week" + MONTH = "month" diff --git a/sendgrid/rest/api/webhooks/v3/models/create_event_webhook400_response.py b/sendgrid/rest/api/webhooks/v3/models/create_event_webhook400_response.py index ace2b5a1..5ac1ad73 100644 --- a/sendgrid/rest/api/webhooks/v3/models/create_event_webhook400_response.py +++ b/sendgrid/rest/api/webhooks/v3/models/create_event_webhook400_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.webhooks.v3.models.create_event_webhook400_response_errors_inner import CreateEventWebhook400ResponseErrorsInner - +from sendgrid.rest.api.webhooks.v3.models.create_event_webhook400_response_errors_inner import ( + CreateEventWebhook400ResponseErrorsInner, +) class CreateEventWebhook400Response: def __init__( - self, - errors: Optional[List[CreateEventWebhook400ResponseErrorsInner]]=None + self, errors: Optional[List[CreateEventWebhook400ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return CreateEventWebhook400Response( - errors=payload.get('errors') - ) - + return CreateEventWebhook400Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/webhooks/v3/models/create_event_webhook400_response_errors_inner.py b/sendgrid/rest/api/webhooks/v3/models/create_event_webhook400_response_errors_inner.py index 87e8eb11..9e262f4a 100644 --- a/sendgrid/rest/api/webhooks/v3/models/create_event_webhook400_response_errors_inner.py +++ b/sendgrid/rest/api/webhooks/v3/models/create_event_webhook400_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class CreateEventWebhook400ResponseErrorsInner: def __init__( - self, - id: Optional[str]=None, - message: Optional[str]=None, - url: Optional[str]=None + self, + id: Optional[str] = None, + message: Optional[str] = None, + url: Optional[str] = None, ): - self.id=id - self.message=message - self.url=url + self.id = id + self.message = message + self.url = url def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "message": self.message, - "url": self.url - }.items() if value is not None} + "id": self.id, + "message": self.message, + "url": self.url, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return CreateEventWebhook400ResponseErrorsInner( - id=payload.get('id'), - message=payload.get('message'), - url=payload.get('url') - ) - + id=payload.get("id"), message=payload.get("message"), url=payload.get("url") + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/error_response.py b/sendgrid/rest/api/webhooks/v3/models/error_response.py index 491d8992..13daba92 100644 --- a/sendgrid/rest/api/webhooks/v3/models/error_response.py +++ b/sendgrid/rest/api/webhooks/v3/models/error_response.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.webhooks.v3.models.error_response_errors_inner import ErrorResponseErrorsInner - +from sendgrid.rest.api.webhooks.v3.models.error_response_errors_inner import ( + ErrorResponseErrorsInner, +) class ErrorResponse: def __init__( - self, - errors: Optional[List[ErrorResponseErrorsInner]]=None, - id: Optional[str]=None + self, + errors: Optional[List[ErrorResponseErrorsInner]] = None, + id: Optional[str] = None, ): - self.errors=errors - self.id=id + self.errors = errors + self.id = id def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors, - "id": self.id - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors, "id": self.id}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,8 +27,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ErrorResponse( - errors=payload.get('errors'), - id=payload.get('id') - ) - + return ErrorResponse(errors=payload.get("errors"), id=payload.get("id")) diff --git a/sendgrid/rest/api/webhooks/v3/models/error_response_errors_inner.py b/sendgrid/rest/api/webhooks/v3/models/error_response_errors_inner.py index f8725bb0..4cbf78ef 100644 --- a/sendgrid/rest/api/webhooks/v3/models/error_response_errors_inner.py +++ b/sendgrid/rest/api/webhooks/v3/models/error_response_errors_inner.py @@ -1,28 +1,28 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ErrorResponseErrorsInner: def __init__( - self, - message: Optional[str]=None, - field: Optional[str]=None, - help: Optional[object]=None + self, + message: Optional[str] = None, + field: Optional[str] = None, + help: Optional[object] = None, ): - self.message=message - self.field=field - self.help=help + self.message = message + self.field = field + self.help = help def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "message": self.message, - "field": self.field, - "help": self.help - }.items() if value is not None} + "message": self.message, + "field": self.field, + "help": self.help, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -31,8 +31,7 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ErrorResponseErrorsInner( - message=payload.get('message'), - field=payload.get('field'), - help=payload.get('help') - ) - + message=payload.get("message"), + field=payload.get("field"), + help=payload.get("help"), + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/event_webhook_all_response.py b/sendgrid/rest/api/webhooks/v3/models/event_webhook_all_response.py index ece929c9..9ff509af 100644 --- a/sendgrid/rest/api/webhooks/v3/models/event_webhook_all_response.py +++ b/sendgrid/rest/api/webhooks/v3/models/event_webhook_all_response.py @@ -1,26 +1,28 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.webhooks.v3.models.event_webhook_signed_response import EventWebhookSignedResponse - +from sendgrid.rest.api.webhooks.v3.models.event_webhook_signed_response import ( + EventWebhookSignedResponse, +) class EventWebhookAllResponse: def __init__( - self, - max_allowed: Optional[float]=None, - webhooks: Optional[List[EventWebhookSignedResponse]]=None + self, + max_allowed: Optional[float] = None, + webhooks: Optional[List[EventWebhookSignedResponse]] = None, ): - self.max_allowed=max_allowed - self.webhooks=webhooks + self.max_allowed = max_allowed + self.webhooks = webhooks def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "max_allowed": self.max_allowed, - "webhooks": self.webhooks - }.items() if value is not None} + "max_allowed": self.max_allowed, + "webhooks": self.webhooks, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +31,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return EventWebhookAllResponse( - max_allowed=payload.get('max_allowed'), - webhooks=payload.get('webhooks') - ) - + max_allowed=payload.get("max_allowed"), webhooks=payload.get("webhooks") + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/event_webhook_base_response_props.py b/sendgrid/rest/api/webhooks/v3/models/event_webhook_base_response_props.py index a5fa6a55..bb39c23b 100644 --- a/sendgrid/rest/api/webhooks/v3/models/event_webhook_base_response_props.py +++ b/sendgrid/rest/api/webhooks/v3/models/event_webhook_base_response_props.py @@ -1,67 +1,67 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class EventWebhookBaseResponseProps: def __init__( - self, - enabled: Optional[bool]=None, - url: Optional[str]=None, - account_status_change: Optional[bool]=None, - group_resubscribe: Optional[bool]=None, - delivered: Optional[bool]=None, - group_unsubscribe: Optional[bool]=None, - spam_report: Optional[bool]=None, - bounce: Optional[bool]=None, - deferred: Optional[bool]=None, - unsubscribe: Optional[bool]=None, - processed: Optional[bool]=None, - open: Optional[bool]=None, - click: Optional[bool]=None, - dropped: Optional[bool]=None, - friendly_name: Optional[str]=None, - id: Optional[str]=None + self, + enabled: Optional[bool] = None, + url: Optional[str] = None, + account_status_change: Optional[bool] = None, + group_resubscribe: Optional[bool] = None, + delivered: Optional[bool] = None, + group_unsubscribe: Optional[bool] = None, + spam_report: Optional[bool] = None, + bounce: Optional[bool] = None, + deferred: Optional[bool] = None, + unsubscribe: Optional[bool] = None, + processed: Optional[bool] = None, + open: Optional[bool] = None, + click: Optional[bool] = None, + dropped: Optional[bool] = None, + friendly_name: Optional[str] = None, + id: Optional[str] = None, ): - self.enabled=enabled - self.url=url - self.account_status_change=account_status_change - self.group_resubscribe=group_resubscribe - self.delivered=delivered - self.group_unsubscribe=group_unsubscribe - self.spam_report=spam_report - self.bounce=bounce - self.deferred=deferred - self.unsubscribe=unsubscribe - self.processed=processed - self.open=open - self.click=click - self.dropped=dropped - self.friendly_name=friendly_name - self.id=id + self.enabled = enabled + self.url = url + self.account_status_change = account_status_change + self.group_resubscribe = group_resubscribe + self.delivered = delivered + self.group_unsubscribe = group_unsubscribe + self.spam_report = spam_report + self.bounce = bounce + self.deferred = deferred + self.unsubscribe = unsubscribe + self.processed = processed + self.open = open + self.click = click + self.dropped = dropped + self.friendly_name = friendly_name + self.id = id def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enabled": self.enabled, - "url": self.url, - "account_status_change": self.account_status_change, - "group_resubscribe": self.group_resubscribe, - "delivered": self.delivered, - "group_unsubscribe": self.group_unsubscribe, - "spam_report": self.spam_report, - "bounce": self.bounce, - "deferred": self.deferred, - "unsubscribe": self.unsubscribe, - "processed": self.processed, - "open": self.open, - "click": self.click, - "dropped": self.dropped, - "friendly_name": self.friendly_name, - "id": self.id - }.items() if value is not None} + "enabled": self.enabled, + "url": self.url, + "account_status_change": self.account_status_change, + "group_resubscribe": self.group_resubscribe, + "delivered": self.delivered, + "group_unsubscribe": self.group_unsubscribe, + "spam_report": self.spam_report, + "bounce": self.bounce, + "deferred": self.deferred, + "unsubscribe": self.unsubscribe, + "processed": self.processed, + "open": self.open, + "click": self.click, + "dropped": self.dropped, + "friendly_name": self.friendly_name, + "id": self.id, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -70,21 +70,20 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return EventWebhookBaseResponseProps( - enabled=payload.get('enabled'), - url=payload.get('url'), - account_status_change=payload.get('account_status_change'), - group_resubscribe=payload.get('group_resubscribe'), - delivered=payload.get('delivered'), - group_unsubscribe=payload.get('group_unsubscribe'), - spam_report=payload.get('spam_report'), - bounce=payload.get('bounce'), - deferred=payload.get('deferred'), - unsubscribe=payload.get('unsubscribe'), - processed=payload.get('processed'), - open=payload.get('open'), - click=payload.get('click'), - dropped=payload.get('dropped'), - friendly_name=payload.get('friendly_name'), - id=payload.get('id') - ) - + enabled=payload.get("enabled"), + url=payload.get("url"), + account_status_change=payload.get("account_status_change"), + group_resubscribe=payload.get("group_resubscribe"), + delivered=payload.get("delivered"), + group_unsubscribe=payload.get("group_unsubscribe"), + spam_report=payload.get("spam_report"), + bounce=payload.get("bounce"), + deferred=payload.get("deferred"), + unsubscribe=payload.get("unsubscribe"), + processed=payload.get("processed"), + open=payload.get("open"), + click=payload.get("click"), + dropped=payload.get("dropped"), + friendly_name=payload.get("friendly_name"), + id=payload.get("id"), + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/event_webhook_date_response_props.py b/sendgrid/rest/api/webhooks/v3/models/event_webhook_date_response_props.py index c453f3df..84cbf75e 100644 --- a/sendgrid/rest/api/webhooks/v3/models/event_webhook_date_response_props.py +++ b/sendgrid/rest/api/webhooks/v3/models/event_webhook_date_response_props.py @@ -1,25 +1,25 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class EventWebhookDateResponseProps: def __init__( - self, - created_date: Optional[datetime]=None, - updated_date: Optional[datetime]=None + self, + created_date: Optional[datetime] = None, + updated_date: Optional[datetime] = None, ): - self.created_date=created_date - self.updated_date=updated_date + self.created_date = created_date + self.updated_date = updated_date def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "created_date": self.created_date, - "updated_date": self.updated_date - }.items() if value is not None} + "created_date": self.created_date, + "updated_date": self.updated_date, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +28,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return EventWebhookDateResponseProps( - created_date=payload.get('created_date'), - updated_date=payload.get('updated_date') - ) - + created_date=payload.get("created_date"), + updated_date=payload.get("updated_date"), + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/event_webhook_no_dates_response.py b/sendgrid/rest/api/webhooks/v3/models/event_webhook_no_dates_response.py index f0a0e9cd..044bd353 100644 --- a/sendgrid/rest/api/webhooks/v3/models/event_webhook_no_dates_response.py +++ b/sendgrid/rest/api/webhooks/v3/models/event_webhook_no_dates_response.py @@ -1,76 +1,76 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class EventWebhookNoDatesResponse: def __init__( - self, - enabled: Optional[bool]=None, - url: Optional[str]=None, - account_status_change: Optional[bool]=None, - group_resubscribe: Optional[bool]=None, - delivered: Optional[bool]=None, - group_unsubscribe: Optional[bool]=None, - spam_report: Optional[bool]=None, - bounce: Optional[bool]=None, - deferred: Optional[bool]=None, - unsubscribe: Optional[bool]=None, - processed: Optional[bool]=None, - open: Optional[bool]=None, - click: Optional[bool]=None, - dropped: Optional[bool]=None, - friendly_name: Optional[str]=None, - id: Optional[str]=None, - oauth_client_id: Optional[str]=None, - oauth_token_url: Optional[str]=None, - public_key: Optional[str]=None + self, + enabled: Optional[bool] = None, + url: Optional[str] = None, + account_status_change: Optional[bool] = None, + group_resubscribe: Optional[bool] = None, + delivered: Optional[bool] = None, + group_unsubscribe: Optional[bool] = None, + spam_report: Optional[bool] = None, + bounce: Optional[bool] = None, + deferred: Optional[bool] = None, + unsubscribe: Optional[bool] = None, + processed: Optional[bool] = None, + open: Optional[bool] = None, + click: Optional[bool] = None, + dropped: Optional[bool] = None, + friendly_name: Optional[str] = None, + id: Optional[str] = None, + oauth_client_id: Optional[str] = None, + oauth_token_url: Optional[str] = None, + public_key: Optional[str] = None, ): - self.enabled=enabled - self.url=url - self.account_status_change=account_status_change - self.group_resubscribe=group_resubscribe - self.delivered=delivered - self.group_unsubscribe=group_unsubscribe - self.spam_report=spam_report - self.bounce=bounce - self.deferred=deferred - self.unsubscribe=unsubscribe - self.processed=processed - self.open=open - self.click=click - self.dropped=dropped - self.friendly_name=friendly_name - self.id=id - self.oauth_client_id=oauth_client_id - self.oauth_token_url=oauth_token_url - self.public_key=public_key + self.enabled = enabled + self.url = url + self.account_status_change = account_status_change + self.group_resubscribe = group_resubscribe + self.delivered = delivered + self.group_unsubscribe = group_unsubscribe + self.spam_report = spam_report + self.bounce = bounce + self.deferred = deferred + self.unsubscribe = unsubscribe + self.processed = processed + self.open = open + self.click = click + self.dropped = dropped + self.friendly_name = friendly_name + self.id = id + self.oauth_client_id = oauth_client_id + self.oauth_token_url = oauth_token_url + self.public_key = public_key def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enabled": self.enabled, - "url": self.url, - "account_status_change": self.account_status_change, - "group_resubscribe": self.group_resubscribe, - "delivered": self.delivered, - "group_unsubscribe": self.group_unsubscribe, - "spam_report": self.spam_report, - "bounce": self.bounce, - "deferred": self.deferred, - "unsubscribe": self.unsubscribe, - "processed": self.processed, - "open": self.open, - "click": self.click, - "dropped": self.dropped, - "friendly_name": self.friendly_name, - "id": self.id, - "oauth_client_id": self.oauth_client_id, - "oauth_token_url": self.oauth_token_url, - "public_key": self.public_key - }.items() if value is not None} + "enabled": self.enabled, + "url": self.url, + "account_status_change": self.account_status_change, + "group_resubscribe": self.group_resubscribe, + "delivered": self.delivered, + "group_unsubscribe": self.group_unsubscribe, + "spam_report": self.spam_report, + "bounce": self.bounce, + "deferred": self.deferred, + "unsubscribe": self.unsubscribe, + "processed": self.processed, + "open": self.open, + "click": self.click, + "dropped": self.dropped, + "friendly_name": self.friendly_name, + "id": self.id, + "oauth_client_id": self.oauth_client_id, + "oauth_token_url": self.oauth_token_url, + "public_key": self.public_key, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -79,24 +79,23 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return EventWebhookNoDatesResponse( - enabled=payload.get('enabled'), - url=payload.get('url'), - account_status_change=payload.get('account_status_change'), - group_resubscribe=payload.get('group_resubscribe'), - delivered=payload.get('delivered'), - group_unsubscribe=payload.get('group_unsubscribe'), - spam_report=payload.get('spam_report'), - bounce=payload.get('bounce'), - deferred=payload.get('deferred'), - unsubscribe=payload.get('unsubscribe'), - processed=payload.get('processed'), - open=payload.get('open'), - click=payload.get('click'), - dropped=payload.get('dropped'), - friendly_name=payload.get('friendly_name'), - id=payload.get('id'), - oauth_client_id=payload.get('oauth_client_id'), - oauth_token_url=payload.get('oauth_token_url'), - public_key=payload.get('public_key') - ) - + enabled=payload.get("enabled"), + url=payload.get("url"), + account_status_change=payload.get("account_status_change"), + group_resubscribe=payload.get("group_resubscribe"), + delivered=payload.get("delivered"), + group_unsubscribe=payload.get("group_unsubscribe"), + spam_report=payload.get("spam_report"), + bounce=payload.get("bounce"), + deferred=payload.get("deferred"), + unsubscribe=payload.get("unsubscribe"), + processed=payload.get("processed"), + open=payload.get("open"), + click=payload.get("click"), + dropped=payload.get("dropped"), + friendly_name=payload.get("friendly_name"), + id=payload.get("id"), + oauth_client_id=payload.get("oauth_client_id"), + oauth_token_url=payload.get("oauth_token_url"), + public_key=payload.get("public_key"), + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/event_webhook_oauth_response_props.py b/sendgrid/rest/api/webhooks/v3/models/event_webhook_oauth_response_props.py index f242a37b..25bf8a27 100644 --- a/sendgrid/rest/api/webhooks/v3/models/event_webhook_oauth_response_props.py +++ b/sendgrid/rest/api/webhooks/v3/models/event_webhook_oauth_response_props.py @@ -1,25 +1,25 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class EventWebhookOauthResponseProps: def __init__( - self, - oauth_client_id: Optional[str]=None, - oauth_token_url: Optional[str]=None + self, + oauth_client_id: Optional[str] = None, + oauth_token_url: Optional[str] = None, ): - self.oauth_client_id=oauth_client_id - self.oauth_token_url=oauth_token_url + self.oauth_client_id = oauth_client_id + self.oauth_token_url = oauth_token_url def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "oauth_client_id": self.oauth_client_id, - "oauth_token_url": self.oauth_token_url - }.items() if value is not None} + "oauth_client_id": self.oauth_client_id, + "oauth_token_url": self.oauth_token_url, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +28,6 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return EventWebhookOauthResponseProps( - oauth_client_id=payload.get('oauth_client_id'), - oauth_token_url=payload.get('oauth_token_url') - ) - + oauth_client_id=payload.get("oauth_client_id"), + oauth_token_url=payload.get("oauth_token_url"), + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/event_webhook_request.py b/sendgrid/rest/api/webhooks/v3/models/event_webhook_request.py index 29059f12..e7e5d27f 100644 --- a/sendgrid/rest/api/webhooks/v3/models/event_webhook_request.py +++ b/sendgrid/rest/api/webhooks/v3/models/event_webhook_request.py @@ -1,70 +1,70 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class EventWebhookRequest: def __init__( - self, - enabled: Optional[bool]=None, - url: Optional[str]=None, - group_resubscribe: Optional[bool]=None, - delivered: Optional[bool]=None, - group_unsubscribe: Optional[bool]=None, - spam_report: Optional[bool]=None, - bounce: Optional[bool]=None, - deferred: Optional[bool]=None, - unsubscribe: Optional[bool]=None, - processed: Optional[bool]=None, - open: Optional[bool]=None, - click: Optional[bool]=None, - dropped: Optional[bool]=None, - friendly_name: Optional[str]=None, - oauth_client_id: Optional[str]=None, - oauth_client_secret: Optional[str]=None, - oauth_token_url: Optional[str]=None + self, + enabled: Optional[bool] = None, + url: Optional[str] = None, + group_resubscribe: Optional[bool] = None, + delivered: Optional[bool] = None, + group_unsubscribe: Optional[bool] = None, + spam_report: Optional[bool] = None, + bounce: Optional[bool] = None, + deferred: Optional[bool] = None, + unsubscribe: Optional[bool] = None, + processed: Optional[bool] = None, + open: Optional[bool] = None, + click: Optional[bool] = None, + dropped: Optional[bool] = None, + friendly_name: Optional[str] = None, + oauth_client_id: Optional[str] = None, + oauth_client_secret: Optional[str] = None, + oauth_token_url: Optional[str] = None, ): - self.enabled=enabled - self.url=url - self.group_resubscribe=group_resubscribe - self.delivered=delivered - self.group_unsubscribe=group_unsubscribe - self.spam_report=spam_report - self.bounce=bounce - self.deferred=deferred - self.unsubscribe=unsubscribe - self.processed=processed - self.open=open - self.click=click - self.dropped=dropped - self.friendly_name=friendly_name - self.oauth_client_id=oauth_client_id - self.oauth_client_secret=oauth_client_secret - self.oauth_token_url=oauth_token_url + self.enabled = enabled + self.url = url + self.group_resubscribe = group_resubscribe + self.delivered = delivered + self.group_unsubscribe = group_unsubscribe + self.spam_report = spam_report + self.bounce = bounce + self.deferred = deferred + self.unsubscribe = unsubscribe + self.processed = processed + self.open = open + self.click = click + self.dropped = dropped + self.friendly_name = friendly_name + self.oauth_client_id = oauth_client_id + self.oauth_client_secret = oauth_client_secret + self.oauth_token_url = oauth_token_url def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enabled": self.enabled, - "url": self.url, - "group_resubscribe": self.group_resubscribe, - "delivered": self.delivered, - "group_unsubscribe": self.group_unsubscribe, - "spam_report": self.spam_report, - "bounce": self.bounce, - "deferred": self.deferred, - "unsubscribe": self.unsubscribe, - "processed": self.processed, - "open": self.open, - "click": self.click, - "dropped": self.dropped, - "friendly_name": self.friendly_name, - "oauth_client_id": self.oauth_client_id, - "oauth_client_secret": self.oauth_client_secret, - "oauth_token_url": self.oauth_token_url - }.items() if value is not None} + "enabled": self.enabled, + "url": self.url, + "group_resubscribe": self.group_resubscribe, + "delivered": self.delivered, + "group_unsubscribe": self.group_unsubscribe, + "spam_report": self.spam_report, + "bounce": self.bounce, + "deferred": self.deferred, + "unsubscribe": self.unsubscribe, + "processed": self.processed, + "open": self.open, + "click": self.click, + "dropped": self.dropped, + "friendly_name": self.friendly_name, + "oauth_client_id": self.oauth_client_id, + "oauth_client_secret": self.oauth_client_secret, + "oauth_token_url": self.oauth_token_url, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -73,22 +73,21 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return EventWebhookRequest( - enabled=payload.get('enabled'), - url=payload.get('url'), - group_resubscribe=payload.get('group_resubscribe'), - delivered=payload.get('delivered'), - group_unsubscribe=payload.get('group_unsubscribe'), - spam_report=payload.get('spam_report'), - bounce=payload.get('bounce'), - deferred=payload.get('deferred'), - unsubscribe=payload.get('unsubscribe'), - processed=payload.get('processed'), - open=payload.get('open'), - click=payload.get('click'), - dropped=payload.get('dropped'), - friendly_name=payload.get('friendly_name'), - oauth_client_id=payload.get('oauth_client_id'), - oauth_client_secret=payload.get('oauth_client_secret'), - oauth_token_url=payload.get('oauth_token_url') - ) - + enabled=payload.get("enabled"), + url=payload.get("url"), + group_resubscribe=payload.get("group_resubscribe"), + delivered=payload.get("delivered"), + group_unsubscribe=payload.get("group_unsubscribe"), + spam_report=payload.get("spam_report"), + bounce=payload.get("bounce"), + deferred=payload.get("deferred"), + unsubscribe=payload.get("unsubscribe"), + processed=payload.get("processed"), + open=payload.get("open"), + click=payload.get("click"), + dropped=payload.get("dropped"), + friendly_name=payload.get("friendly_name"), + oauth_client_id=payload.get("oauth_client_id"), + oauth_client_secret=payload.get("oauth_client_secret"), + oauth_token_url=payload.get("oauth_token_url"), + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/event_webhook_signed_response.py b/sendgrid/rest/api/webhooks/v3/models/event_webhook_signed_response.py index 3dbeba69..d3b21d31 100644 --- a/sendgrid/rest/api/webhooks/v3/models/event_webhook_signed_response.py +++ b/sendgrid/rest/api/webhooks/v3/models/event_webhook_signed_response.py @@ -1,82 +1,82 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class EventWebhookSignedResponse: def __init__( - self, - enabled: Optional[bool]=None, - url: Optional[str]=None, - account_status_change: Optional[bool]=None, - group_resubscribe: Optional[bool]=None, - delivered: Optional[bool]=None, - group_unsubscribe: Optional[bool]=None, - spam_report: Optional[bool]=None, - bounce: Optional[bool]=None, - deferred: Optional[bool]=None, - unsubscribe: Optional[bool]=None, - processed: Optional[bool]=None, - open: Optional[bool]=None, - click: Optional[bool]=None, - dropped: Optional[bool]=None, - friendly_name: Optional[str]=None, - id: Optional[str]=None, - created_date: Optional[datetime]=None, - updated_date: Optional[datetime]=None, - oauth_client_id: Optional[str]=None, - oauth_token_url: Optional[str]=None, - public_key: Optional[str]=None + self, + enabled: Optional[bool] = None, + url: Optional[str] = None, + account_status_change: Optional[bool] = None, + group_resubscribe: Optional[bool] = None, + delivered: Optional[bool] = None, + group_unsubscribe: Optional[bool] = None, + spam_report: Optional[bool] = None, + bounce: Optional[bool] = None, + deferred: Optional[bool] = None, + unsubscribe: Optional[bool] = None, + processed: Optional[bool] = None, + open: Optional[bool] = None, + click: Optional[bool] = None, + dropped: Optional[bool] = None, + friendly_name: Optional[str] = None, + id: Optional[str] = None, + created_date: Optional[datetime] = None, + updated_date: Optional[datetime] = None, + oauth_client_id: Optional[str] = None, + oauth_token_url: Optional[str] = None, + public_key: Optional[str] = None, ): - self.enabled=enabled - self.url=url - self.account_status_change=account_status_change - self.group_resubscribe=group_resubscribe - self.delivered=delivered - self.group_unsubscribe=group_unsubscribe - self.spam_report=spam_report - self.bounce=bounce - self.deferred=deferred - self.unsubscribe=unsubscribe - self.processed=processed - self.open=open - self.click=click - self.dropped=dropped - self.friendly_name=friendly_name - self.id=id - self.created_date=created_date - self.updated_date=updated_date - self.oauth_client_id=oauth_client_id - self.oauth_token_url=oauth_token_url - self.public_key=public_key + self.enabled = enabled + self.url = url + self.account_status_change = account_status_change + self.group_resubscribe = group_resubscribe + self.delivered = delivered + self.group_unsubscribe = group_unsubscribe + self.spam_report = spam_report + self.bounce = bounce + self.deferred = deferred + self.unsubscribe = unsubscribe + self.processed = processed + self.open = open + self.click = click + self.dropped = dropped + self.friendly_name = friendly_name + self.id = id + self.created_date = created_date + self.updated_date = updated_date + self.oauth_client_id = oauth_client_id + self.oauth_token_url = oauth_token_url + self.public_key = public_key def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enabled": self.enabled, - "url": self.url, - "account_status_change": self.account_status_change, - "group_resubscribe": self.group_resubscribe, - "delivered": self.delivered, - "group_unsubscribe": self.group_unsubscribe, - "spam_report": self.spam_report, - "bounce": self.bounce, - "deferred": self.deferred, - "unsubscribe": self.unsubscribe, - "processed": self.processed, - "open": self.open, - "click": self.click, - "dropped": self.dropped, - "friendly_name": self.friendly_name, - "id": self.id, - "created_date": self.created_date, - "updated_date": self.updated_date, - "oauth_client_id": self.oauth_client_id, - "oauth_token_url": self.oauth_token_url, - "public_key": self.public_key - }.items() if value is not None} + "enabled": self.enabled, + "url": self.url, + "account_status_change": self.account_status_change, + "group_resubscribe": self.group_resubscribe, + "delivered": self.delivered, + "group_unsubscribe": self.group_unsubscribe, + "spam_report": self.spam_report, + "bounce": self.bounce, + "deferred": self.deferred, + "unsubscribe": self.unsubscribe, + "processed": self.processed, + "open": self.open, + "click": self.click, + "dropped": self.dropped, + "friendly_name": self.friendly_name, + "id": self.id, + "created_date": self.created_date, + "updated_date": self.updated_date, + "oauth_client_id": self.oauth_client_id, + "oauth_token_url": self.oauth_token_url, + "public_key": self.public_key, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -85,26 +85,25 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return EventWebhookSignedResponse( - enabled=payload.get('enabled'), - url=payload.get('url'), - account_status_change=payload.get('account_status_change'), - group_resubscribe=payload.get('group_resubscribe'), - delivered=payload.get('delivered'), - group_unsubscribe=payload.get('group_unsubscribe'), - spam_report=payload.get('spam_report'), - bounce=payload.get('bounce'), - deferred=payload.get('deferred'), - unsubscribe=payload.get('unsubscribe'), - processed=payload.get('processed'), - open=payload.get('open'), - click=payload.get('click'), - dropped=payload.get('dropped'), - friendly_name=payload.get('friendly_name'), - id=payload.get('id'), - created_date=payload.get('created_date'), - updated_date=payload.get('updated_date'), - oauth_client_id=payload.get('oauth_client_id'), - oauth_token_url=payload.get('oauth_token_url'), - public_key=payload.get('public_key') - ) - + enabled=payload.get("enabled"), + url=payload.get("url"), + account_status_change=payload.get("account_status_change"), + group_resubscribe=payload.get("group_resubscribe"), + delivered=payload.get("delivered"), + group_unsubscribe=payload.get("group_unsubscribe"), + spam_report=payload.get("spam_report"), + bounce=payload.get("bounce"), + deferred=payload.get("deferred"), + unsubscribe=payload.get("unsubscribe"), + processed=payload.get("processed"), + open=payload.get("open"), + click=payload.get("click"), + dropped=payload.get("dropped"), + friendly_name=payload.get("friendly_name"), + id=payload.get("id"), + created_date=payload.get("created_date"), + updated_date=payload.get("updated_date"), + oauth_client_id=payload.get("oauth_client_id"), + oauth_token_url=payload.get("oauth_token_url"), + public_key=payload.get("public_key"), + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/event_webhook_signed_response_prop.py b/sendgrid/rest/api/webhooks/v3/models/event_webhook_signed_response_prop.py index 2cb93f9c..f54d185d 100644 --- a/sendgrid/rest/api/webhooks/v3/models/event_webhook_signed_response_prop.py +++ b/sendgrid/rest/api/webhooks/v3/models/event_webhook_signed_response_prop.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class EventWebhookSignedResponseProp: - def __init__( - self, - public_key: Optional[str]=None - ): - self.public_key=public_key + def __init__(self, public_key: Optional[str] = None): + self.public_key = public_key def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "public_key": self.public_key - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"public_key": self.public_key}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return EventWebhookSignedResponseProp( - public_key=payload.get('public_key') - ) - + return EventWebhookSignedResponseProp(public_key=payload.get("public_key")) diff --git a/sendgrid/rest/api/webhooks/v3/models/event_webhook_test_request.py b/sendgrid/rest/api/webhooks/v3/models/event_webhook_test_request.py index 9279f618..5fac3e5e 100644 --- a/sendgrid/rest/api/webhooks/v3/models/event_webhook_test_request.py +++ b/sendgrid/rest/api/webhooks/v3/models/event_webhook_test_request.py @@ -1,34 +1,34 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class EventWebhookTestRequest: def __init__( - self, - id: Optional[str]=None, - url: Optional[str]=None, - oauth_client_id: Optional[str]=None, - oauth_client_secret: Optional[str]=None, - oauth_token_url: Optional[str]=None + self, + id: Optional[str] = None, + url: Optional[str] = None, + oauth_client_id: Optional[str] = None, + oauth_client_secret: Optional[str] = None, + oauth_token_url: Optional[str] = None, ): - self.id=id - self.url=url - self.oauth_client_id=oauth_client_id - self.oauth_client_secret=oauth_client_secret - self.oauth_token_url=oauth_token_url + self.id = id + self.url = url + self.oauth_client_id = oauth_client_id + self.oauth_client_secret = oauth_client_secret + self.oauth_token_url = oauth_token_url def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "id": self.id, - "url": self.url, - "oauth_client_id": self.oauth_client_id, - "oauth_client_secret": self.oauth_client_secret, - "oauth_token_url": self.oauth_token_url - }.items() if value is not None} + "id": self.id, + "url": self.url, + "oauth_client_id": self.oauth_client_id, + "oauth_client_secret": self.oauth_client_secret, + "oauth_token_url": self.oauth_token_url, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -37,10 +37,9 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return EventWebhookTestRequest( - id=payload.get('id'), - url=payload.get('url'), - oauth_client_id=payload.get('oauth_client_id'), - oauth_client_secret=payload.get('oauth_client_secret'), - oauth_token_url=payload.get('oauth_token_url') - ) - + id=payload.get("id"), + url=payload.get("url"), + oauth_client_id=payload.get("oauth_client_id"), + oauth_client_secret=payload.get("oauth_client_secret"), + oauth_token_url=payload.get("oauth_token_url"), + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/event_webhook_unsigned_response.py b/sendgrid/rest/api/webhooks/v3/models/event_webhook_unsigned_response.py index 5006c80d..235e6b4f 100644 --- a/sendgrid/rest/api/webhooks/v3/models/event_webhook_unsigned_response.py +++ b/sendgrid/rest/api/webhooks/v3/models/event_webhook_unsigned_response.py @@ -1,79 +1,79 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class EventWebhookUnsignedResponse: def __init__( - self, - enabled: Optional[bool]=None, - url: Optional[str]=None, - account_status_change: Optional[bool]=None, - group_resubscribe: Optional[bool]=None, - delivered: Optional[bool]=None, - group_unsubscribe: Optional[bool]=None, - spam_report: Optional[bool]=None, - bounce: Optional[bool]=None, - deferred: Optional[bool]=None, - unsubscribe: Optional[bool]=None, - processed: Optional[bool]=None, - open: Optional[bool]=None, - click: Optional[bool]=None, - dropped: Optional[bool]=None, - friendly_name: Optional[str]=None, - id: Optional[str]=None, - created_date: Optional[datetime]=None, - updated_date: Optional[datetime]=None, - oauth_client_id: Optional[str]=None, - oauth_token_url: Optional[str]=None + self, + enabled: Optional[bool] = None, + url: Optional[str] = None, + account_status_change: Optional[bool] = None, + group_resubscribe: Optional[bool] = None, + delivered: Optional[bool] = None, + group_unsubscribe: Optional[bool] = None, + spam_report: Optional[bool] = None, + bounce: Optional[bool] = None, + deferred: Optional[bool] = None, + unsubscribe: Optional[bool] = None, + processed: Optional[bool] = None, + open: Optional[bool] = None, + click: Optional[bool] = None, + dropped: Optional[bool] = None, + friendly_name: Optional[str] = None, + id: Optional[str] = None, + created_date: Optional[datetime] = None, + updated_date: Optional[datetime] = None, + oauth_client_id: Optional[str] = None, + oauth_token_url: Optional[str] = None, ): - self.enabled=enabled - self.url=url - self.account_status_change=account_status_change - self.group_resubscribe=group_resubscribe - self.delivered=delivered - self.group_unsubscribe=group_unsubscribe - self.spam_report=spam_report - self.bounce=bounce - self.deferred=deferred - self.unsubscribe=unsubscribe - self.processed=processed - self.open=open - self.click=click - self.dropped=dropped - self.friendly_name=friendly_name - self.id=id - self.created_date=created_date - self.updated_date=updated_date - self.oauth_client_id=oauth_client_id - self.oauth_token_url=oauth_token_url + self.enabled = enabled + self.url = url + self.account_status_change = account_status_change + self.group_resubscribe = group_resubscribe + self.delivered = delivered + self.group_unsubscribe = group_unsubscribe + self.spam_report = spam_report + self.bounce = bounce + self.deferred = deferred + self.unsubscribe = unsubscribe + self.processed = processed + self.open = open + self.click = click + self.dropped = dropped + self.friendly_name = friendly_name + self.id = id + self.created_date = created_date + self.updated_date = updated_date + self.oauth_client_id = oauth_client_id + self.oauth_token_url = oauth_token_url def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "enabled": self.enabled, - "url": self.url, - "account_status_change": self.account_status_change, - "group_resubscribe": self.group_resubscribe, - "delivered": self.delivered, - "group_unsubscribe": self.group_unsubscribe, - "spam_report": self.spam_report, - "bounce": self.bounce, - "deferred": self.deferred, - "unsubscribe": self.unsubscribe, - "processed": self.processed, - "open": self.open, - "click": self.click, - "dropped": self.dropped, - "friendly_name": self.friendly_name, - "id": self.id, - "created_date": self.created_date, - "updated_date": self.updated_date, - "oauth_client_id": self.oauth_client_id, - "oauth_token_url": self.oauth_token_url - }.items() if value is not None} + "enabled": self.enabled, + "url": self.url, + "account_status_change": self.account_status_change, + "group_resubscribe": self.group_resubscribe, + "delivered": self.delivered, + "group_unsubscribe": self.group_unsubscribe, + "spam_report": self.spam_report, + "bounce": self.bounce, + "deferred": self.deferred, + "unsubscribe": self.unsubscribe, + "processed": self.processed, + "open": self.open, + "click": self.click, + "dropped": self.dropped, + "friendly_name": self.friendly_name, + "id": self.id, + "created_date": self.created_date, + "updated_date": self.updated_date, + "oauth_client_id": self.oauth_client_id, + "oauth_token_url": self.oauth_token_url, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -82,25 +82,24 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return EventWebhookUnsignedResponse( - enabled=payload.get('enabled'), - url=payload.get('url'), - account_status_change=payload.get('account_status_change'), - group_resubscribe=payload.get('group_resubscribe'), - delivered=payload.get('delivered'), - group_unsubscribe=payload.get('group_unsubscribe'), - spam_report=payload.get('spam_report'), - bounce=payload.get('bounce'), - deferred=payload.get('deferred'), - unsubscribe=payload.get('unsubscribe'), - processed=payload.get('processed'), - open=payload.get('open'), - click=payload.get('click'), - dropped=payload.get('dropped'), - friendly_name=payload.get('friendly_name'), - id=payload.get('id'), - created_date=payload.get('created_date'), - updated_date=payload.get('updated_date'), - oauth_client_id=payload.get('oauth_client_id'), - oauth_token_url=payload.get('oauth_token_url') - ) - + enabled=payload.get("enabled"), + url=payload.get("url"), + account_status_change=payload.get("account_status_change"), + group_resubscribe=payload.get("group_resubscribe"), + delivered=payload.get("delivered"), + group_unsubscribe=payload.get("group_unsubscribe"), + spam_report=payload.get("spam_report"), + bounce=payload.get("bounce"), + deferred=payload.get("deferred"), + unsubscribe=payload.get("unsubscribe"), + processed=payload.get("processed"), + open=payload.get("open"), + click=payload.get("click"), + dropped=payload.get("dropped"), + friendly_name=payload.get("friendly_name"), + id=payload.get("id"), + created_date=payload.get("created_date"), + updated_date=payload.get("updated_date"), + oauth_client_id=payload.get("oauth_client_id"), + oauth_token_url=payload.get("oauth_token_url"), + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/get_signed_event_webhook200_response.py b/sendgrid/rest/api/webhooks/v3/models/get_signed_event_webhook200_response.py index 8cc5a476..cbfa34dc 100644 --- a/sendgrid/rest/api/webhooks/v3/models/get_signed_event_webhook200_response.py +++ b/sendgrid/rest/api/webhooks/v3/models/get_signed_event_webhook200_response.py @@ -1,25 +1,18 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GetSignedEventWebhook200Response: - def __init__( - self, - id: Optional[str]=None, - public_key: Optional[str]=None - ): - self.id=id - self.public_key=public_key + def __init__(self, id: Optional[str] = None, public_key: Optional[str] = None): + self.id = id + self.public_key = public_key def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "id": self.id, - "public_key": self.public_key - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"id": self.id, "public_key": self.public_key}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -28,7 +21,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetSignedEventWebhook200Response( - id=payload.get('id'), - public_key=payload.get('public_key') - ) - + id=payload.get("id"), public_key=payload.get("public_key") + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/get_signed_event_webhook404_response.py b/sendgrid/rest/api/webhooks/v3/models/get_signed_event_webhook404_response.py index 0db6156e..1a3e31d8 100644 --- a/sendgrid/rest/api/webhooks/v3/models/get_signed_event_webhook404_response.py +++ b/sendgrid/rest/api/webhooks/v3/models/get_signed_event_webhook404_response.py @@ -1,23 +1,22 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.webhooks.v3.models.get_signed_event_webhook404_response_errors_inner import GetSignedEventWebhook404ResponseErrorsInner - +from sendgrid.rest.api.webhooks.v3.models.get_signed_event_webhook404_response_errors_inner import ( + GetSignedEventWebhook404ResponseErrorsInner, +) class GetSignedEventWebhook404Response: def __init__( - self, - errors: Optional[List[GetSignedEventWebhook404ResponseErrorsInner]]=None + self, errors: Optional[List[GetSignedEventWebhook404ResponseErrorsInner]] = None ): - self.errors=errors + self.errors = errors def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "errors": self.errors - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"errors": self.errors}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return GetSignedEventWebhook404Response( - errors=payload.get('errors') - ) - + return GetSignedEventWebhook404Response(errors=payload.get("errors")) diff --git a/sendgrid/rest/api/webhooks/v3/models/get_signed_event_webhook404_response_errors_inner.py b/sendgrid/rest/api/webhooks/v3/models/get_signed_event_webhook404_response_errors_inner.py index f14821dc..4366ed72 100644 --- a/sendgrid/rest/api/webhooks/v3/models/get_signed_event_webhook404_response_errors_inner.py +++ b/sendgrid/rest/api/webhooks/v3/models/get_signed_event_webhook404_response_errors_inner.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class GetSignedEventWebhook404ResponseErrorsInner: - def __init__( - self, - message: Optional[str]=None - ): - self.message=message + def __init__(self, message: Optional[str] = None): + self.message = message def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "message": self.message - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"message": self.message}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,6 +20,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return GetSignedEventWebhook404ResponseErrorsInner( - message=payload.get('message') - ) - + message=payload.get("message") + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/list_parse_setting200_response.py b/sendgrid/rest/api/webhooks/v3/models/list_parse_setting200_response.py index 4fd26a3b..56c0bd70 100644 --- a/sendgrid/rest/api/webhooks/v3/models/list_parse_setting200_response.py +++ b/sendgrid/rest/api/webhooks/v3/models/list_parse_setting200_response.py @@ -1,23 +1,18 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum from sendgrid.rest.api.webhooks.v3.models.parse_setting import ParseSetting - class ListParseSetting200Response: - def __init__( - self, - result: Optional[List[ParseSetting]]=None - ): - self.result=result + def __init__(self, result: Optional[List[ParseSetting]] = None): + self.result = result def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "result": self.result - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"result": self.result}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +20,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListParseSetting200Response( - result=payload.get('result') - ) - + return ListParseSetting200Response(result=payload.get("result")) diff --git a/sendgrid/rest/api/webhooks/v3/models/list_parse_static200_response_inner.py b/sendgrid/rest/api/webhooks/v3/models/list_parse_static200_response_inner.py index fbdb3469..e9bcf036 100644 --- a/sendgrid/rest/api/webhooks/v3/models/list_parse_static200_response_inner.py +++ b/sendgrid/rest/api/webhooks/v3/models/list_parse_static200_response_inner.py @@ -1,26 +1,25 @@ -from enum import Enum from typing import Optional, Dict, List from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.webhooks.v3.models.list_parse_static200_response_inner_stats_inner import ListParseStatic200ResponseInnerStatsInner - +from sendgrid.rest.api.webhooks.v3.models.list_parse_static200_response_inner_stats_inner import ( + ListParseStatic200ResponseInnerStatsInner, +) class ListParseStatic200ResponseInner: def __init__( - self, - var_date: Optional[str]=None, - stats: Optional[List[ListParseStatic200ResponseInnerStatsInner]]=None + self, + var_date: Optional[str] = None, + stats: Optional[List[ListParseStatic200ResponseInnerStatsInner]] = None, ): - self.var_date=var_date - self.stats=stats + self.var_date = var_date + self.stats = stats def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "date": self.var_date, - "stats": self.stats - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"date": self.var_date, "stats": self.stats}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -29,7 +28,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListParseStatic200ResponseInner( - var_date=payload.get('date'), - stats=payload.get('stats') - ) - + var_date=payload.get("date"), stats=payload.get("stats") + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/list_parse_static200_response_inner_stats_inner.py b/sendgrid/rest/api/webhooks/v3/models/list_parse_static200_response_inner_stats_inner.py index 2651a0c8..596daa7d 100644 --- a/sendgrid/rest/api/webhooks/v3/models/list_parse_static200_response_inner_stats_inner.py +++ b/sendgrid/rest/api/webhooks/v3/models/list_parse_static200_response_inner_stats_inner.py @@ -1,23 +1,22 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum -from sendgrid.rest.api.webhooks.v3.models.list_parse_static200_response_inner_stats_inner_metrics import ListParseStatic200ResponseInnerStatsInnerMetrics - +from sendgrid.rest.api.webhooks.v3.models.list_parse_static200_response_inner_stats_inner_metrics import ( + ListParseStatic200ResponseInnerStatsInnerMetrics, +) class ListParseStatic200ResponseInnerStatsInner: def __init__( - self, - metrics: Optional[ListParseStatic200ResponseInnerStatsInnerMetrics]=None + self, metrics: Optional[ListParseStatic200ResponseInnerStatsInnerMetrics] = None ): - self.metrics=metrics + self.metrics = metrics def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "metrics": self.metrics - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"metrics": self.metrics}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,7 +24,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return ListParseStatic200ResponseInnerStatsInner( - metrics=payload.get('metrics') - ) - + return ListParseStatic200ResponseInnerStatsInner(metrics=payload.get("metrics")) diff --git a/sendgrid/rest/api/webhooks/v3/models/list_parse_static200_response_inner_stats_inner_metrics.py b/sendgrid/rest/api/webhooks/v3/models/list_parse_static200_response_inner_stats_inner_metrics.py index 92fdff82..71227be5 100644 --- a/sendgrid/rest/api/webhooks/v3/models/list_parse_static200_response_inner_stats_inner_metrics.py +++ b/sendgrid/rest/api/webhooks/v3/models/list_parse_static200_response_inner_stats_inner_metrics.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ListParseStatic200ResponseInnerStatsInnerMetrics: - def __init__( - self, - received: Optional[float]=None - ): - self.received=received + def __init__(self, received: Optional[float] = None): + self.received = received def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "received": self.received - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"received": self.received}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -25,6 +20,5 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ListParseStatic200ResponseInnerStatsInnerMetrics( - received=payload.get('received') - ) - + received=payload.get("received") + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/parse_setting.py b/sendgrid/rest/api/webhooks/v3/models/parse_setting.py index 2cdd949a..05af2565 100644 --- a/sendgrid/rest/api/webhooks/v3/models/parse_setting.py +++ b/sendgrid/rest/api/webhooks/v3/models/parse_setting.py @@ -1,31 +1,31 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class ParseSetting: def __init__( - self, - url: Optional[str]=None, - hostname: Optional[str]=None, - spam_check: Optional[bool]=None, - send_raw: Optional[bool]=None + self, + url: Optional[str] = None, + hostname: Optional[str] = None, + spam_check: Optional[bool] = None, + send_raw: Optional[bool] = None, ): - self.url=url - self.hostname=hostname - self.spam_check=spam_check - self.send_raw=send_raw + self.url = url + self.hostname = hostname + self.spam_check = spam_check + self.send_raw = send_raw def to_dict(self): - return {key: to_serializable(value) + return { + key: to_serializable(value) for key, value in { - "url": self.url, - "hostname": self.hostname, - "spam_check": self.spam_check, - "send_raw": self.send_raw - }.items() if value is not None} + "url": self.url, + "hostname": self.hostname, + "spam_check": self.spam_check, + "send_raw": self.send_raw, + }.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -34,9 +34,8 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): return ParseSetting( - url=payload.get('url'), - hostname=payload.get('hostname'), - spam_check=payload.get('spam_check'), - send_raw=payload.get('send_raw') - ) - + url=payload.get("url"), + hostname=payload.get("hostname"), + spam_check=payload.get("spam_check"), + send_raw=payload.get("send_raw"), + ) diff --git a/sendgrid/rest/api/webhooks/v3/models/update_signed_event_webhook_request.py b/sendgrid/rest/api/webhooks/v3/models/update_signed_event_webhook_request.py index df93bca0..90debf2e 100644 --- a/sendgrid/rest/api/webhooks/v3/models/update_signed_event_webhook_request.py +++ b/sendgrid/rest/api/webhooks/v3/models/update_signed_event_webhook_request.py @@ -1,22 +1,17 @@ -from enum import Enum -from typing import Optional, Dict, List +from typing import Optional, Dict from sendgrid.converters.serialize import to_serializable, from_serializable -from enum import Enum - class UpdateSignedEventWebhookRequest: - def __init__( - self, - enabled: Optional[bool]=None - ): - self.enabled=enabled + def __init__(self, enabled: Optional[bool] = None): + self.enabled = enabled def to_dict(self): - return {key: to_serializable(value) - for key, value in { - "enabled": self.enabled - }.items() if value is not None} + return { + key: to_serializable(value) + for key, value in {"enabled": self.enabled}.items() + if value is not None + } @classmethod def from_dict(cls, data): @@ -24,7 +19,4 @@ def from_dict(cls, data): @staticmethod def generate_model(payload: Dict[str, object]): - return UpdateSignedEventWebhookRequest( - enabled=payload.get('enabled') - ) - + return UpdateSignedEventWebhookRequest(enabled=payload.get("enabled")) diff --git a/sendgrid/rest/api/webhooks/v3/test_event_webhook.py b/sendgrid/rest/api/webhooks/v3/test_event_webhook.py index 4d9e713e..0cd90afb 100644 --- a/sendgrid/rest/api/webhooks/v3/test_event_webhook.py +++ b/sendgrid/rest/api/webhooks/v3/test_event_webhook.py @@ -12,54 +12,54 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.webhooks.v3.models.event_webhook_test_request import EventWebhookTestRequest +from sendgrid.rest.api.webhooks.v3.models.event_webhook_test_request import ( + EventWebhookTestRequest, +) + class TestEventWebhook: def __init__(self, client) -> None: self.client = client - + def send( self, - on_behalf_of: Optional[str] = None, - event_webhook_test_request: Optional[EventWebhookTestRequest] = None, - + on_behalf_of: Optional[str] = None, + event_webhook_test_request: Optional[EventWebhookTestRequest] = None, ): - path='/v3/user/webhooks/event/test' + path = "/v3/user/webhooks/event/test" headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if event_webhook_test_request: data = event_webhook_test_request.to_dict() - request = Request( - method='POST', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="POST", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/update_event_webhook.py b/sendgrid/rest/api/webhooks/v3/update_event_webhook.py index a0c70007..bc603045 100644 --- a/sendgrid/rest/api/webhooks/v3/update_event_webhook.py +++ b/sendgrid/rest/api/webhooks/v3/update_event_webhook.py @@ -12,60 +12,59 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.webhooks.v3.models.event_webhook_request import EventWebhookRequest -from sendgrid.rest.api.webhooks.v3.models.event_webhook_unsigned_response import EventWebhookUnsignedResponse +from sendgrid.rest.api.webhooks.v3.models.event_webhook_request import ( + EventWebhookRequest, +) + class UpdateEventWebhook: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - on_behalf_of: Optional[str] = None, - include: Optional[str] = None, - event_webhook_request: Optional[EventWebhookRequest] = None, - + id: str, + on_behalf_of: Optional[str] = None, + include: Optional[str] = None, + event_webhook_request: Optional[EventWebhookRequest] = None, ): - path='/v3/user/webhooks/event/settings/{id}' + path = "/v3/user/webhooks/event/settings/{id}" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if event_webhook_request: data = event_webhook_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/update_parse_setting.py b/sendgrid/rest/api/webhooks/v3/update_parse_setting.py index a4110835..cd82932e 100644 --- a/sendgrid/rest/api/webhooks/v3/update_parse_setting.py +++ b/sendgrid/rest/api/webhooks/v3/update_parse_setting.py @@ -12,58 +12,56 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated from sendgrid.rest.api.webhooks.v3.models.parse_setting import ParseSetting + class UpdateParseSetting: def __init__(self, client) -> None: self.client = client - + def send( self, - hostname: str, - on_behalf_of: Optional[str] = None, - parse_setting: Optional[ParseSetting] = None, - + hostname: str, + on_behalf_of: Optional[str] = None, + parse_setting: Optional[ParseSetting] = None, ): - path='/v3/user/webhooks/parse/settings/{hostname}' + path = "/v3/user/webhooks/parse/settings/{hostname}" path = path.format( - hostname=hostname, + hostname=hostname, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if parse_setting: data = parse_setting.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + ) diff --git a/sendgrid/rest/api/webhooks/v3/update_signed_event_webhook.py b/sendgrid/rest/api/webhooks/v3/update_signed_event_webhook.py index 87434225..fdd92aae 100644 --- a/sendgrid/rest/api/webhooks/v3/update_signed_event_webhook.py +++ b/sendgrid/rest/api/webhooks/v3/update_signed_event_webhook.py @@ -12,59 +12,60 @@ """ import json -import warnings -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from typing import Optional from sendgrid.base import values from sendgrid.exceptions import ApiException from sendgrid.http.request import Request from sendgrid.http.response import ApiResponse -from pydantic import Field, StrictStr from typing import Optional -from typing_extensions import Annotated -from sendgrid.rest.api.webhooks.v3.models.get_signed_event_webhook200_response import GetSignedEventWebhook200Response -from sendgrid.rest.api.webhooks.v3.models.update_signed_event_webhook_request import UpdateSignedEventWebhookRequest +from sendgrid.rest.api.webhooks.v3.models.update_signed_event_webhook_request import ( + UpdateSignedEventWebhookRequest, +) + class UpdateSignedEventWebhook: def __init__(self, client) -> None: self.client = client - + def send( self, - id: str, - on_behalf_of: Optional[str] = None, - update_signed_event_webhook_request: Optional[UpdateSignedEventWebhookRequest] = None, - + id: str, + on_behalf_of: Optional[str] = None, + update_signed_event_webhook_request: Optional[ + UpdateSignedEventWebhookRequest + ] = None, ): - path='/v3/user/webhooks/event/settings/signed/{id}' + path = "/v3/user/webhooks/event/settings/signed/{id}" path = path.format( - id=id, + id=id, ) headers = values.of( - { - 'on-behalf-of': on_behalf_of, - }) + { + "on-behalf-of": on_behalf_of, + } + ) headers["Content-Type"] = "application/json" data = None if update_signed_event_webhook_request: data = update_signed_event_webhook_request.to_dict() - request = Request( - method='PATCH', - url=path, - data=data, - headers=headers - ) - response=self.client.send(request) + request = Request(method="PATCH", url=path, data=data, headers=headers) + response = self.client.send(request) if response is None: - raise ApiException(error="CreateAlert creation failed: Unable to connect to server") + raise ApiException( + error="CreateAlert creation failed: Unable to connect to server" + ) if response.text: text = json.loads(response.text) else: text = "" if response.is_success(): - return ApiResponse(status_code=response.status_code, model=text, headers=response.headers) + return ApiResponse( + status_code=response.status_code, model=text, headers=response.headers + ) else: - raise ApiException(status_code=response.status_code, error=text, headers=response.headers) + raise ApiException( + status_code=response.status_code, error=text, headers=response.headers + )